fix: differentiate between bucket exists vs owned when creating bucket - #53
Merged
alanshaw merged 3 commits intoSep 4, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A newly added test can be flaky due to RandomDID collisions that can accidentally select the requesting tenant as the “other tenant” owner.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the bucket RPC service to distinguish between “bucket name already exists but is owned by someone else” vs “bucket name already exists and is owned by the requesting tenant” when handling CreateBucket, enabling more accurate downstream S3 error mapping.
Changes:
- In
Service.Create, detect ownership of an existing bucket name and return a new sentinel error when the requesting tenant already owns it. - Add a new bucket-service error (
ErrBucketAlreadyOwned) with a stable serialized Name for failure mapping. - Extend RPC failure mapping + tests to recognize and serialize the new bucket error.
File summaries
| File | Description |
|---|---|
| pkg/rpc/service/bucket/service.go | Checks existing bucket ownership and returns ErrBucketAlreadyOwned vs ErrBucketExists. |
| pkg/rpc/service/bucket/service_test.go | Adds test coverage for already-owned vs other-tenant name collisions (but includes a flakiness risk noted in comments). |
| pkg/rpc/service/bucket/errors.go | Introduces new stable error name + sentinel for already-owned bucket creation attempts. |
| pkg/rpc/failure.go | Adds ErrBucketAlreadyOwned to the set of bucket-service failures that are serialized into receipts. |
| pkg/rpc/failure_test.go | Verifies wrapped ErrBucketAlreadyOwned is recorded with the correct stable Name. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
alanshaw
deleted the
ash/fix/differentiate-create-bucket-exists-vs-owned
branch
September 4, 2026 14:13
fil-forge-bot Bot
added a commit
to fil-forge/infra-central
that referenced
this pull request
Sep 4, 2026
Published from fil-forge/hilt#53 - Digest: `sha256:6c1b36d1ba49e12555b333bc93f064186fe63280b0fc75f1bb1bff0b21446d01` - Commit: fil-forge/hilt@f842aba - Publish run: https://github.com/fil-forge/hilt/actions/runs/33882473409 Merging applies [`terraform/envs/dev/apps`](https://github.com/fil-forge/infra-central/tree/main/terraform/envs/dev/apps) with no further confirmation. Co-authored-by: fil-forge-bot[bot] <318653112+fil-forge-bot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.