gitops-engine icon indicating copy to clipboard operation
gitops-engine copied to clipboard

feat: Expose validation webhook warnings in Argo CD UI

Open Sergey-Kizimov opened this issue 3 years ago • 7 comments

A warning handler has been added to this PR to display webhook validation warnings in the Argo CD user interface. This PR is related to Issue posted before and PR in the ArgoCD repo.

Warnings in the ArgoCD UI will look like this:

Screen Shot 2022-12-28 at 2 43 40 PM Screen Shot 2022-12-28 at 2 44 01 PM

Sergey-Kizimov avatar Dec 28 '22 23:12 Sergey-Kizimov

Codecov Report

Base: 55.75% // Head: 55.65% // Decreases project coverage by -0.10% :warning:

Coverage data is based on head (d4fd681) compared to base (917f5a0). Patch coverage: 21.42% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #493      +/-   ##
==========================================
- Coverage   55.75%   55.65%   -0.11%     
==========================================
  Files          41       41              
  Lines        4525     4537      +12     
==========================================
+ Hits         2523     2525       +2     
- Misses       1808     1816       +8     
- Partials      194      196       +2     
Impacted Files Coverage Δ
pkg/sync/common/types.go 50.00% <0.00%> (-4.17%) :arrow_down:
pkg/sync/sync_context.go 72.75% <27.27%> (-0.60%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Dec 28 '22 23:12 codecov[bot]

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Jan 13 '23 21:01 sonarqubecloud[bot]

Any news on this one?

NitriKx avatar Aug 08 '23 13:08 NitriKx

@NitriKx looks like the original author is unresponsive. I think my comment still needs to be addressed. Are you up to pick this PR up and run with it?

crenshaw-dev avatar Aug 08 '23 15:08 crenshaw-dev

Sorry that I didn't answer for a long time, during my tests I found one bug, when synchronizing one object everything works correctly, but when synchronizing several objects (this should trigger several warnings), all warnings for objects are returned only for the last applied object, as I understood this is probably due to the fact that when synchronizing several objects, one session is used and several goroutines apply objects in parallel and for some reason there is no synchronization between the operation and the returned warning, I have no idea how to fix this. I need help with this

Sergey-Kizimov avatar Aug 08 '23 15:08 Sergey-Kizimov

One hack that I see here is that we can publish warning messages in the operationState.message field without separating by resources, in this case it isn't necessary to care which resource caused the warning because all warnings will be merged. @crenshaw-dev What do you think?

Sergey-Kizimov avatar Aug 08 '23 19:08 Sergey-Kizimov

I haven't dived into the code, but it looks to me like there's a tasks list where the result of each task is stored. Maybe that's the appropriate place to handle/persist the webhook warning response?

crenshaw-dev avatar Aug 09 '23 14:08 crenshaw-dev