Skip to content

fix(azure): propagate reservation pager construction errors - #161

Merged
cristim merged 2 commits into
mainfrom
fix/azure-reservation-pager-errors
Sep 29, 2026
Merged

cristim merged 2 commits into
mainfrom
fix/azure-reservation-pager-errors

Conversation

@cristim

@cristim cristim commented Sep 29, 2026

Copy link
Copy Markdown
Member

Cache, Cosmos DB, database and search clients now return a wrapped error when Azure reservation pager construction fails. Previously they returned an empty inventory with no error, so callers could mistake failed inventory collection for no existing reservations.

The regression uses the real pinned Azure SDK with an invalid local cloud configuration. It failed for all four clients before the fix and passes afterward. This construction path does not acquire credentials or contact Azure; permission failures occur during page fetch and retain their existing handling.

Validation: full Azure module race suite, build, vet, golangci-lint 2.10.1, and all installed commit hooks passed on Go 1.26.6. Independent gpt-6-astra review completed two clean implementation passes and independently verified the failing baseline and passing fix.

Closes #79

Return wrapped errors from cache, Cosmos DB, database and search inventory
clients so SDK construction failures cannot appear as empty inventory.

Closes #79
@cristim cristim added triaged Item has been triaged urgency/this-sprint Within the current sprint priority/p1 Next up; this sprint severity/high Significant harm impact/many Affects most users effort/xs Trivial / one-liner type/bug Defect labels Sep 29, 2026
@cristim

cristim commented Sep 29, 2026

Copy link
Copy Markdown
Member Author

Independent implementation review: go79

Reviewer: gpt-6-astra. Date: 2026-09-30.
Reviewed staged patch SHA256: 77bfc3d08d5210bf0249ac8abf658e0b1c1b9c31de59230deba0b9a5f5e698a0.

Pass 1

No actionable findings across completeness, correctness, security, bugs, duplication and over-engineering. Four error branches now return nil commitments and contextual %w errors, matching Synapse. Database's unused log import is removed; no unrelated production changes. Callers receive a failure rather than an apparently empty inventory. Existing collector behavior is untouched.

Pass 2

No actionable findings across all six dimensions. Regression uses public constructors, a real SDK configuration failure and assertions on nil result, context and unwrapped cause. It replaces the whole cloud configuration, restores via cleanup, and has no parallel test calls. The single comment explains required sequencing. No artificial factory or new dependency is introduced. Reviewed source and the five-file staged diff again; diff-check passes.

Independent clone review-go79: installed only the new test over unchanged base, then ran focused race regression. All four cases failed because the error was nil, proving the baseline defect. Installed the four reviewed production files and reran regression plus provider service-constructor control: exit 0, 1.515s. Logs reviewer-go79-red.log and reviewer-go79-green.log. Author's full Azure race suite completed successfully; independent focused runtime verifies the changed path. Evidence uses local SDK construction, not Azure cloud execution.

Verdict: implementation approved for normal commit. Final committed-SHA gate pending.

Final committed-SHA gate

Fetched and checked out a9f1e2b in independent review-go79 clone. Prior review modifications preserved in a stash; checkout clean. Re-read the complete five-file committed diff. Its SHA256 is identical to the reviewed staged patch above. Fresh focused race regression and all-service constructor control passed on this exact SHA, 1.936s (reviewer-go79-final-sha.log). No actionable findings. Approved for publication under root's normal CI gates. Any later integration SHA requires review of the changed artifacts and fresh focused evidence before merge.

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 5 billable files and costs up to $1.25.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 40 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 68 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: LeanerCloud/cloud-commitments-go/.coderabbit.yaml

Review profile: CHILL

Plan: Essentials

Run ID: a71d0bae-4175-4e83-b6d6-feac85c55e0d

📥 Commits

Reviewing files that changed from the base of the PR and between 7e2ad63 and fa3d2ce.

📒 Files selected for processing (5)
  • providers/azure/provider_test.go
  • providers/azure/services/cache/client.go
  • providers/azure/services/cosmosdb/client.go
  • providers/azure/services/database/client.go
  • providers/azure/services/search/client.go

Comment @coderabbitai help to get the list of available commands.

Integrate the reviewed AWS usage-history fix from main without rewriting
the published Azure fix commit.
@cristim

cristim commented Sep 29, 2026

Copy link
Copy Markdown
Member Author

Independent implementation review: go79

Reviewer: gpt-6-astra. Date: 2026-09-30.
Reviewed staged patch SHA256: 77bfc3d08d5210bf0249ac8abf658e0b1c1b9c31de59230deba0b9a5f5e698a0.

Pass 1

No actionable findings across completeness, correctness, security, bugs, duplication and over-engineering. Four error branches now return nil commitments and contextual %w errors, matching Synapse. Database's unused log import is removed; no unrelated production changes. Callers receive a failure rather than an apparently empty inventory. Existing collector behavior is untouched.

Pass 2

No actionable findings across all six dimensions. Regression uses public constructors, a real SDK configuration failure and assertions on nil result, context and unwrapped cause. It replaces the whole cloud configuration, restores via cleanup, and has no parallel test calls. The single comment explains required sequencing. No artificial factory or new dependency is introduced. Reviewed source and the five-file staged diff again; diff-check passes.

Independent clone review-go79: installed only the new test over unchanged base, then ran focused race regression. All four cases failed because the error was nil, proving the baseline defect. Installed the four reviewed production files and reran regression plus provider service-constructor control: exit 0, 1.515s. Logs reviewer-go79-red.log and reviewer-go79-green.log. Author's full Azure race suite completed successfully; independent focused runtime verifies the changed path. Evidence uses local SDK construction, not Azure cloud execution.

Verdict: implementation approved for normal commit. Final committed-SHA gate pending.

Final committed-SHA gate

Fetched and checked out a9f1e2b in independent review-go79 clone. Prior review modifications preserved in a stash; checkout clean. Re-read the complete five-file committed diff. Its SHA256 is identical to the reviewed staged patch above. Fresh focused race regression and all-service constructor control passed on this exact SHA, 1.936s (reviewer-go79-final-sha.log). No actionable findings. Approved for publication under root's normal CI gates. Any later integration SHA requires review of the changed artifacts and fresh focused evidence before merge.

Integration with main 7e2ad63: precommit passes

Pass 1: no actionable findings across all six dimensions. Re-read the complete incoming AWS production/test diff and Azure diff against main. Incoming source is the previously independently verified go68 request/response correction; the Azure error handling and test remain intact.

Pass 2: no actionable findings across all six dimensions or integration scope. Index comparison proves AWS exactly matches origin/main, Azure exactly matches prior HEAD, and no pkg/go.work changes exist. The Azure global SDK configuration mutation is confined to its separate test binary; AWS parallel HTTP fixtures do not share that global or module process. No overlapping production helpers, imports or dependency changes. Diff-check clean. Approved normal merge commit; final integrated-SHA runtime gate remains pending.

Final integrated-SHA gate

Independently fetched and checked out fa3d2ce, parents a9f1e2b and 7e2ad63. Clean checkout. Re-read complete seven-file final delta from base. Committed Azure files exactly equal prior approved Azure HEAD; AWS files exactly equal merged main. Fresh GOWORK=off Go1.26.6 focused race tests passed on this exact merge SHA: Azure regression plus constructor control 2.061s; AWS daily-history regression and controls 1.548s. Logs reviewer-go79-integrated-azure.log and reviewer-go79-integrated-aws.log. No actionable findings. Exact merged SHA approved for normal publication and root's CI-gated merge process; no cloud execution claimed.

@cristim
cristim merged commit e879f6a into main Sep 29, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/xs Trivial / one-liner impact/many Affects most users priority/p1 Next up; this sprint severity/high Significant harm triaged Item has been triaged type/bug Defect urgency/this-sprint Within the current sprint

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(azure): four clients report "no existing commitments" when the pager cannot be built

1 participant