Skip to content

fix: differentiate between bucket exists vs owned when creating bucket - #53

Merged
alanshaw merged 3 commits into
mainfrom
ash/fix/differentiate-create-bucket-exists-vs-owned
Sep 4, 2026
Merged

fix: differentiate between bucket exists vs owned when creating bucket#53
alanshaw merged 3 commits into
mainfrom
ash/fix/differentiate-create-bucket-exists-vs-owned

Conversation

@alanshaw

@alanshaw alanshaw commented Sep 4, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI lite review requested due to automatic review settings September 4, 2026 13:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Comment thread pkg/rpc/service/bucket/service_test.go
@alanshaw
alanshaw merged commit f842aba into main Sep 4, 2026
8 checks passed
@alanshaw
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>
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.

2 participants