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

Track ownerrefs between cluster-scoped and namespaced objects

Open jcogilvie opened this issue 4 months ago • 5 comments

Fixes https://github.com/argoproj/argo-cd/issues/24379

jcogilvie avatar Sep 03 '25 20:09 jcogilvie

Codecov Report

:x: Patch coverage is 89.36170% with 5 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 47.82%. Comparing base (8849c3f) to head (a3fa709). :warning: Report is 59 commits behind head on master.

Files with missing lines Patch % Lines
pkg/cache/cluster.go 89.36% 3 Missing and 2 partials :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #774      +/-   ##
==========================================
- Coverage   54.26%   47.82%   -6.45%     
==========================================
  Files          64       64              
  Lines        6164     6622     +458     
==========================================
- Hits         3345     3167     -178     
- Misses       2549     3199     +650     
+ Partials      270      256      -14     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Sep 03 '25 20:09 codecov[bot]

I heard some other opinions in the contributor meeting. I agree with adding the escape hatch, but I'm not sure whether we should implement "conditional enable" or "emergency disable". Environment variable? App annotation? Other thoughts?

@crenshaw-dev had an opinion I know.

jcogilvie avatar Sep 04 '25 19:09 jcogilvie

I went ahead with implementing this as a disable flag.

I did have an idea about a possible optimization, though it may change things a little more broadly than just buildGraph.

I was thinking if IterateHierarchyV2 were to always process the global/cluster-scoped (non-)namespace slice element last, we could keep track of missing refs that we hit along the way and resolve them all at once in a single go. Sound viable?

jcogilvie avatar Sep 04 '25 20:09 jcogilvie

What's next for this?

jcogilvie avatar Sep 18 '25 15:09 jcogilvie