Skip to content

Conversation

jcogilvie
Copy link

@jcogilvie jcogilvie requested a review from a team as a code owner September 3, 2025 20:36
@jcogilvie jcogilvie marked this pull request as draft September 3, 2025 20:37
Copy link

codecov bot commented Sep 3, 2025

Codecov Report

❌ Patch coverage is 89.36170% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.82%. Comparing base (8849c3f) to head (a3fa709).
⚠️ 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 ⚠️
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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@jcogilvie jcogilvie force-pushed the fix/cross-namespace-hierarchy-traversal branch from 68c589d to d042f32 Compare September 3, 2025 21:28
@jcogilvie jcogilvie marked this pull request as ready for review September 3, 2025 21:44
Copy link

@todaywasawesome todaywasawesome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, as was suggested in contrib meeting we should have an environmental variable. I think this should be disabled by default and only enabled when needed.

@jcogilvie
Copy link
Author

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.

Copy link

sonarqubecloud bot commented Sep 4, 2025

@jcogilvie
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Namespaced objects missing from hierarchy when owned by cluster-scoped objects
2 participants