Repository navigation
fix(publish): find the personal drive's bucket in the region its distribution names - #24866
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix works at the mechanism level, and the one unfixed sibling (the AWS Control drive) is deferred in the description by name. Notes
What this change shipsInventory (3 items) — 2 justifiedIntent: let a second install in the same AWS account publish to the account's one personal drive when its profile region differs from the region the drive was built in. FIX.
[FIRST-PRINCIPLES-REVIEWED] 3da7df8 Description read[DESCRIPTION-READ] 877e75d17ed73fb92ec1b5899086e215ecc17d5d8da332a82958599f3d92b19e That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: the origin only says which region to search, the drive tag still decides which bucket is trusted, and the change is purely additive with a clean revert. Notes
[DESIGN-REVIEWED] 3da7df8 Description read[DESCRIPTION-READ] 9f8d17e122281575fe1865d140ce83a58583cff00587cc40119b2675e04633ab That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
8edcf8b to
1898b7f
Compare
1898b7f to
3da7df8
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (3 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: finds the personal drive's bucket in the region its CloudFront origin names, still requiring the drive tag and naming scheme; with tests.
Problem / Motivation
Goal: A second Kiro Crew install in the same AWS account can publish to the account's one personal drive, even when its deploy profile points at a different region.
Install A (profile region
us-east-1) publishes once and builds the drive. Install B in the same account (profile regionus-west-2) then tries to publish. B finds the drive's CloudFront distribution, because that is global. B does not find the drive's bucket, because the bucket lookup asks the tagging API in B's region only. B then refuses with "the storage bucket is missing", and can never publish.Why it matters
The drive is one per account by design, so every install in the account must find the same drive. Today any install whose profile region differs from the drive's is locked out of Publish, and the error tells the user a bucket is missing when it is not. Workshop stands hit this: their bootstrap pre-creates the drive and swallows the failure, so Publish is silently broken.
Not a goal
src/kiro_crew/apps/builtins/aws_control/backend/storage_drive.py. It has the same single-region bucket lookup and is left for a separate issue.What changed (motivation → approach → change)
Root cause: discovery asked for the bucket in the profile's region only, while the distribution is found from any region. A bucket in another region read as "missing".
Fix (
src/kiro_crew/publish/personal_drive.py): when the bucket is not found in the profile's region but the drive's distribution is, read the distribution's S3 origin (<bucket>.s3.<region>.amazonaws.com). That names the bucket's region. Discovery then runs the same tag query in that region. It uses the bucket only if that query reports the same drive-scheme bucket. So the origin says where to look, and the drive tag still decides what is trusted.This needs no new permission:
cloudfront:GetDistributionis already used by the drive's status check. A real half-present drive (no tagged bucket anywhere the origin points) still raises the same refusal.Backwards compatibility
Compatible: discovery only gains a second place to look when the first one missed; every drive found today is found the same way.
Removes nothing: no key, record, path or check is removed; the half-present refusal is kept.
Tests
test_a_drive_built_in_another_region_is_shared_not_refused: bucket inus-east-1, profile inus-west-2. Publish reuses the drive and builds nothing.test_an_untagged_bucket_at_the_origin_is_still_a_half_present_drive: the origin names a region whose tag query does not report the bucket. Publish still refuses and builds nothing.bucket_regionoption and answerscloudfront get-distributionwith the drive's origin.Proof: not provable -- other: prove.py's throwaway tree errored at collection on every hunk on this host, so I ran two hand mutants instead. Removing the origin fallback turns the first test red; skipping the tag check at the origin turns the second test red.
Scoped runs:
test/test_publish_personal_drive.py(95 passed) and the provisioning, read-back and registration drive files (59 passed); flake8, isort, black and mypy clean on the changed files.Self-review (the local GPT and Opus reviewers were not run: the host's subagent gate stayed paused on memory, so CI's review lanes judge this head):
get-distributionerror propagates as an error and is never read as "no drive", so nothing gets rebuilt.Manual verification
N/A — unit coverage sufficient: discovery is driven entirely through the stubbed AWS CLI surface, and the two cases above are the whole behaviour change. Not run against a real two-region account.
Related Issues
Closes #24820
Sibling sweep
Swept: git grep -n '"resourcegroupstaggingapi"' -- src
Sibling: src/kiro_crew/apps/builtins/aws_control/backend/storage_drive.py -- not affected -- no global distribution to pair with, so there is no half-present refusal
Sibling: src/kiro_crew/deploy/engine.py -- not affected -- deploy sites are looked up in the region the site was deployed to
Sibling: src/kiro_crew/cloud/ec2.py -- not affected -- EC2 resources are regional by nature
Pattern harvest
Rule candidate: review-prompt
Pattern: an account-scoped resource discovered through a region-scoped API (resourcegroupstaggingapi) without saying which region the resource lives in.
Checklist