feat: resolve feature subgraphs in federated graph field usage - #3144
feat: resolve feature subgraphs in federated graph field usage#3144JivusAyrus wants to merge 2 commits into
Conversation
WalkthroughThe platform response now carries feature subgraphs. The control plane retrieves and converts them with RBAC context. Studio passes them through graph context and displays them without SDL links. ChangesFeature subgraph response flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@controlplane/src/core/repositories/FeatureFlagRepository.ts`:
- Around line 464-472: Update the feature-subgraph query flow in the repository
method accepting federatedGraphId, namespaceId, fedGraphLabelMatchers, limit,
offset, query, and rbac so IdP and RBAC predicates are applied before baseQuery
computes totalCount and applies pagination. Preserve the existing filtering near
line 557 as defense in depth, ensuring counts and pages contain only accessible
feature subgraphs.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7ab8151d-28d1-4bfe-b30e-57608dc290d0
⛔ Files ignored due to path filters (1)
connect-go/gen/proto/wg/cosmo/platform/v1/platform.pb.gois excluded by!**/*.pb.go,!**/gen/**
📒 Files selected for processing (7)
connect/src/wg/cosmo/platform/v1/platform_pb.tscontrolplane/src/core/bufservices/federated-graph/getFederatedGraphByName.tscontrolplane/src/core/repositories/FeatureFlagRepository.tscontrolplane/src/core/util.tsproto/wg/cosmo/platform/v1/platform.protostudio/src/components/analytics/field-usage.tsxstudio/src/components/layout/graph-layout.tsx
Router-nonroot image scan passed✅ No security vulnerabilities found in image: |
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (70.37%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #3144 +/- ##
===========================================
- Coverage 62.37% 43.85% -18.52%
===========================================
Files 262 1071 +809
Lines 31003 140249 +109246
Branches 0 7361 +7361
===========================================
+ Hits 19337 61507 +42170
- Misses 10158 76879 +66721
- Partials 1508 1863 +355
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
controlplane/src/core/repositories/FeatureFlagRepository.ts (1)
464-472: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winPass
authContext.rbacto the public handler call.Without it, both repository RBAC filters are skipped, including the final subgraph lookup. Make
rbacrequired if unrestricted internal calls are not valid.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@controlplane/src/core/repositories/FeatureFlagRepository.ts` around lines 464 - 472, Update the public handler that invokes the repository method containing the rbac parameter to pass authContext.rbac explicitly, ensuring both repository RBAC filters and the final subgraph lookup execute. Make the rbac parameter required in the relevant method signature unless unrestricted internal calls are intentionally supported.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@controlplane/src/core/repositories/FeatureFlagRepository.ts`:
- Around line 464-472: Update the public handler that invokes the repository
method containing the rbac parameter to pass authContext.rbac explicitly,
ensuring both repository RBAC filters and the final subgraph lookup execute.
Make the rbac parameter required in the relevant method signature unless
unrestricted internal calls are intentionally supported.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9b143f6b-57d2-43e0-9afc-d5fc9f7207d0
📒 Files selected for processing (1)
controlplane/src/core/repositories/FeatureFlagRepository.ts
Summary by CodeRabbit
New Features
Bug Fixes
Checklist