Conversation
Signed-off-by: Alan Sergeant <alan.sergeant@sap.com>
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe pull request refines ChangesCollectionError Tolerance in Subscription Lookup
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsTimed out fetching pipeline failures after 30000ms Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
fixes #862 (follow-up fix)
Problem
After the initial fix (merged), the BMC reconciler could still fail to find an
existing subscription if any individual subscription in the collection failed
to fetch. Gofish's
ev.Subscriptions()fetches members concurrently andreturns a
CollectionErrorwhen any member fails — alongside the successfullyfetched results. The original code bailed immediately on any error, discarding
the partial results:
If the target subscription was fetched successfully but another subscription in
the collection returned an error, the match would never be found.
Fix
Tolerate
CollectionErrorand continue searching through partial results. Onlyfail on other error types:
Note: gofish wraps even a failure on the collection endpoint itself as a
CollectionError, so both "some members failed" and "collection endpointunreachable" fall through to a "not found" result rather than a hard error.
Changes
bmc/redfish.go: TolerateCollectionErrorinfindExistingSubscription()bmc/redfish_test.go: Added 2 tests — one verifying a match is found when asibling subscription fails to fetch, one verifying behaviour when the
collection endpoint itself is unavailable
Summary by CodeRabbit