feat: Expose validation webhook warnings in Argo CD UI
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:
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.
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication
Any news on this one?
@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?
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
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?
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?