Skip to content

ci(deploy): refuse to deploy public source maps - #708

Merged
harlan-zw merged 1 commit into
mainfrom
ci/refuse-public-source-maps
Nov 18, 2026
Merged

harlan-zw merged 1 commit into
mainfrom
ci/refuse-public-source-maps

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

Follow-up to the logged findings on #705. No GitHub issue.

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

#705 stopped production from serving source maps, but only while Sentry's delete step runs and works. Sentry deletes maps only after it uploads them, and skew storage restores earlier releases' maps into .output/public. A build without SENTRY_AUTH_TOKEN deletes nothing, and the plugin swallows rm errors, so either case would publish every map again without a warning.

The deploy job now checks .output/public right after Build. If any .map file remains, it prints the count and the first five paths, then stops before migrations or any production change.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

Sentry deletes source maps only after it uploads them, and skew storage
restores earlier releases' maps into .output/public. A build without the
Sentry token, or a silent delete failure, would serve every map again.
The deploy now stops after Build, before migrations or any production
change, when .output/public holds a map.
@harlan-zw

Copy link
Copy Markdown
Collaborator Author

Agent check (Harlan Agent Kit), run by hand because the step runs only in a production deploy:

  • I extracted the step's run block from the workflow file and ran it with Actions' shell flags (bash --noprofile --norc -eo pipefail) against three fake .output/public trees:
    • No maps: exit 0, no output.
    • One map: exit 1, with the error line and the path.
    • 3,000 maps: exit 1, with the count and the first five paths. pipefail did not cut the message.
  • actionlint passes on the workflow.
  • Production check after fix(sentry): delete built source maps after upload #705: every sampled client map returns 404, so the next deploy should pass this step.

@harlan-zw

Copy link
Copy Markdown
Collaborator Author

🤖 Harlan Agent Kit Agent assessment of head a492c50.

The Service Review was stopped for this head because the Service reported ReserveReached and the review engine is down. An independent read-only subagent reviewed the diff. This is not a Service READY.

No blocker found (confidence 90/100). Today's deploy would pass the step. Skew storage restores old assets during nitro:build:public-assets, and Sentry deletes .output/**/*.map later, in the Nuxt close hook. Run 44243671789 restored 3,210 assets, yet wrangler read only 1,889 files from .output/public. The step runs before D1 migrations, so a failure leaves production unchanged.

Logged follow-ups, none above 80:

  • Impact 20: .github/workflows/deploy-cloudflare.yml is in HARNESS_PATHS (scripts/lib/harness-deploy.ts:8), so merging redeploys the Harness Worker and restarts its containers. Merge while no Skillgen job runs.
  • Impact 15, not caused by this PR: wrangler upload_source_maps finds no maps, because 'hidden' maps carry no sourceMappingURL.
  • Impact 10: the step comment says Sentry deletes maps after upload; deletion depends on SENTRY_AUTH_TOKEN, not on upload success.
  • Impact 5: my earlier check comment named -eo pipefail; this step runs as bash -e. The script passes under both.

@harlan-zw
harlan-zw merged commit 8bcd669 into main Nov 18, 2026
7 checks passed
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