Skip to content

refactor(aws): use the shared purchase guard in the OpenSearch purchase path - #597

Merged
cristim merged 1 commit into
mainfrom
refactor/10-purchaseguard-opensearch
Oct 20, 2026
Merged

cristim merged 1 commit into
mainfrom
refactor/10-purchaseguard-opensearch

Conversation

@cristim

@cristim cristim commented Oct 20, 2026

Copy link
Copy Markdown
Member

Summary

  • The OpenSearch purchase path now calls the shared purchaseguard.Guard and purchaseguard.Recover instead of its own copy of the issue #641 guard, mirroring ElastiCache (refactor(aws): share the purchase idempotency guard, starting with ElastiCache #507, providers/aws/services/elasticache/client.go idempotencyGuard and recoverAlreadyExists).
  • The guard still runs before the purchase call. Valid purchases behave as before.
  • New purchase_guard_test.go covers each guard rule at this path with bounded mocks.

Verification

Closes #10 (ElastiCache, RDS and MemoryDB landed in the sibling PRs)

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 3 billable files and costs up to $0.75.

  • 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 43 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 89 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: 4303bc17-f974-4505-b72d-05214c92ec1b
📥 Commits

Reviewing files that changed from the base of the PR and between 00ff5cf and e7e57b8.

📒 Files selected for processing: 3
  • CHANGELOG.md
  • providers/aws/services/opensearch/client.go
  • providers/aws/services/opensearch/purchase_guard_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

…se path

Replace the OpenSearch-local copy of the issue #641 idempotency guard and
AlreadyExists recovery with purchaseguard.Guard and Recover, as ElastiCache
already does (#507). The lookup and fault type stay service-specific.

Add purchase_guard_test.go covering each guard rule at this path: no
lookup without a token, lookup before purchase, fail-loud lookup error, and
AlreadyExists recovery limits (re-lookup error or miss, no token, other
purchase errors). Mocks are bounded with Test(t).

Part of #10

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cristim

cristim commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

Gate note (claude-cc-libs)

Rebased onto main after the overlapping PRs merged. The only conflict was CHANGELOG.md, resolved by keeping both entries. Excluding CHANGELOG.md, git diff origin/main e7e57b81b223be9320130fbde72c3a87e49bf547 is identical to the reviewed 2e46838ffb9bb864c28d922e19a798abe687149a diff apart from hunk line numbers. Re-verified on the combined tree: vet and go test -count=1 pass.

@cristim
cristim force-pushed the refactor/10-purchaseguard-opensearch branch from 2e46838 to e7e57b8 Compare October 20, 2026 16:35
@cristim

cristim commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

Merge gate verdict (claude-cc-libs)

Every gate holds at head e7e57b8:

  • Two independent reviews approve the reviewed head e7e57b8. The branch was then updated from main, and the PR diff is byte-identical to the reviewed diff (compared mechanically).
  • CI is green on e7e57b8, which is the reviewed change on top of current main.
  • 0 unresolved threads; MERGEABLE/CLEAN.

CodeRabbit is waived as a merge gate under the 2026-10-19 decision. Squash-merging.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ARCH-03: AWS RI purchase skeleton (idempotency guard etc.) copy-pasted across 5-6 service clients

1 participant