fix(tiles): automated R2 bucket CORS deployment workflow and S3 method compliance #123
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/r2-cors-automation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Executed playbook:
skill://poteto-mode/playbooks/bug-fix.mdPrinciples applied
Impact
indonesia.pmtiles) byte-range requests succeed without browser CORS blocking errors on production domains.Summary
Automates Cloudflare R2 bucket CORS configuration via a dedicated Forgejo Actions workflow and fixes S3 API method compliance by removing unsupported OPTIONS from AllowedMethods.
Verification
vp check: Clean formatting and 0 lint warnings across 295 files.pnpm test: All 271 unit tests passing across 36 test suites (includingset-r2-cors.test.ts).next build: Standalone Next.js production build succeeded cleanly.Closes #38
Code Review & Ponytail Audit Summary: Automated R2 Bucket CORS Deployment Workflow and S3 Method Compliance
1. Mechanical Verification Gate (
scripts/verify-pr.mjs)fix(tiles): automated R2 bucket CORS deployment workflow and S3 method compliance), mandatory principles citations, impact framing, and anti-overengineering file path filters.2. Ponytail Audit (Zero Bespoke Bloat)
OPTIONSmethod fromAllowedMethodsinR2_CORS_RULES. S3 PutBucketCors rejectsOPTIONSwithInvalidRequestbecause CORS preflight OPTIONS requests are evaluated server-side againstAllowedMethods: ["GET", "HEAD"]..forgejo/workflows/apply-r2-cors.yml) and integrated CORS configuration step into.forgejo/workflows/sync-tiles-r2.yml.scripts/__tests__/set-r2-cors.test.tsverifying wildcard origin, methods compliance, range header exposure, and endpoint builder functions.Lean already. Ship.3. Subsystem Boundary & Discipline
scripts/set-r2-cors.mjs,scripts/__tests__/set-r2-cors.test.ts,.forgejo/workflows/apply-r2-cors.yml,.forgejo/workflows/sync-tiles-r2.yml). Zero frontend UI leakage.4. Verification & Test Proofs
vp check: Passed 100% (295 files formatted, 0 warnings/lint errors in 130 files).pnpm test: All 271 tests passed across 36 test suites.next build: Next.js Turbopack production build succeeded cleanly.CI / Verify Quality & Build (pull_request)passed in 1m56s.5. Acceptance Criteria
Decision: APPROVED for squash merge into
main.Undone. Fixed by setting CORS policy on the Cloudflare R2 settings.