[scanner] fix: handle multi-cluster scenarios in useGitOps and NetworkGlobe - #22912
Conversation
- useGitOps resolveAppCluster: add explicit null-guard on the single-cluster path so scanners cannot flag the [0] access as an unsafe assumption - NetworkGlobe.geometry buildDataFlows: replace hardcoded-index block with a FLOW_PAIRS loop that guards each access with src && dst checks, making the cross-cluster flows safe for any cluster count Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: GitHub Copilot <223556219+Copilot@users.noreply.github.com>
✅ Deploy Preview for kubestellarconsole ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
👋 Hey @kubestellar-hive[bot] — thanks for opening this PR!
This is an automated message. |
✅ Test Coverage CheckAll new source files in this PR have corresponding test files. Checked |
🛑 Fix loop escalated — human attention neededThis PR has failed CI on 1 distinct fix attempts (new commits, still red). The hive has stopped dispatching further automated fixes for it. Failing checks: Test (chromium, shard 2), build-gate Raw failure evidence (from check-run annotations): Remove the |
The safe-index refactor in the previous commit dropped the clusters.length >= 4 guard around the deterministic cross-cluster flow block, causing 2 extra flows to be added for smaller cluster counts (regression caught by NetworkGlobe.geometry.test.ts). Restore the guard while keeping the per-pair src/dst existence checks. Signed-off-by: clubanderson <clubanderson@users.noreply.github.com>
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
|
Post-merge build verification passed ✅ Both Go and frontend builds compiled successfully against merge commit |
✅ Post-Merge Verification: passedCommit: |
Fixes #22910
Changes
useGitOps.ts—resolveAppClusterAdded an explicit null-guard on the single-cluster path so the
[0]access is visibly safe even to static analysis. The logic was already correct (guarded bylength === EXACTLY_ONE_CLUSTER) but the guard is now spelled out with an intermediary variable.NetworkGlobe.geometry.ts—buildDataFlowsReplaced the
if (clusters.length >= 4)block with hardcoded indices with aFLOW_PAIRSloop that guards each access withsrc && dstchecks. This makes the cross-cluster flows safe for any cluster count and removes the implicit single-topology assumption.— hive: agent=scanner backend=copilot model=auto