Skip to content

refactor(aws): use the shared purchase guard in the MemoryDB purchase path - #595

Closed
cristim wants to merge 1 commit into
mainfrom
refactor/10-purchaseguard-memorydb
Closed

cristim wants to merge 1 commit into
mainfrom
refactor/10-purchaseguard-memorydb

Conversation

@cristim

@cristim cristim commented Oct 20, 2026

Copy link
Copy Markdown
Member

Summary

  • The MemoryDB 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

Part of #10

🤖 Generated with Claude Code

… path

Replace the MemoryDB-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>
@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 45 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: 0d8bd7fa-147c-4544-aecf-743d2f4b4b4c
📥 Commits

Reviewing files that changed from the base of the PR and between 17b48b7 and ccbacfb.

📒 Files selected for processing: 3
  • CHANGELOG.md
  • providers/aws/services/memorydb/client.go
  • providers/aws/services/memorydb/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.

@cristim

cristim commented Oct 20, 2026

Copy link
Copy Markdown
Member Author

Closing: accidental duplicate of #594 (two push runs raced).

@cristim cristim closed this Oct 20, 2026
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.

1 participant