fix(azure): leave AZConfig and Deployment empty on a managed-instance page error - #240
Conversation
… page error A page error or cancellation mid-walk returned the partial counts, and fetchServerInfo derived AZConfig and Deployment from them as if complete. Report completeness from walkManagedInstances and emit empty signals when the walk did not finish.
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. 📝 WalkthroughWalkthroughThe managed-instance pager walk now reports whether it completed. Conversion leaves ChangesAzure managed-instance signals
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Incomplete managed-instance walks now leave AZConfig and Deployment empty instead of deriving them from partial counts. No merge-blocking risk was found in the supplied changes. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
What
walkManagedInstances now reports whether the walk completed. On a page error, context cancellation or pager-construction failure, fetchServerInfo returns empty AZConfig and Deployment instead of deriving them from the partial sample.
Why
A failure on page two made page one's counts look like the whole subscription, stamping a confident "zoneRedundant"/"none" AZConfig (and a Deployment value) on recommendations.
Behaviour change
Pager-construction failure previously could still yield Deployment="single" when regular servers existed; it now leaves Deployment empty, matching the logged 'AZConfig/Deployment signal unavailable'. Conversion still does not fail.
Verified
completeguard or treating cancellation as complete makes these tests fail.Note: serverInfoOnce caches an empty result for the client's lifetime (client.go, cachedDominantAZConfig). This is pre-existing and tracked separately.
Closes #94
Summary by CodeRabbit