Skip to content

fix: make D1 post-apply audit compatible with Wrangler - #4210

Merged
azumag merged 2 commits into
mainfrom
fix/3476-d1-audit-no-json
Oct 2, 2026
Merged

azumag merged 2 commits into
mainfrom
fix/3476-d1-audit-no-json

Conversation

@azumag

@azumag azumag commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace the unsupported wrangler d1 migrations list --json post-apply audit path with the supported text-output path
  • fail closed unless the successful no-pending sentinel (No migrations to apply!) is present
  • preserve failure propagation from the list command itself
  • extend the focused workflow regression test to prohibit --json / || true and keep the audit after apply

Production evidence

Post-merge D1 Migrate run #11 (36901437326) reached production with:

  • List pending migrations: success, No migrations to apply!
  • Apply migrations: success, No migrations to apply!
  • Confirm no migrations remain pending (audit log): failure because Wrangler 4.144.0 rejects --json

A direct read-only D1 check after the run still shows 46 applied migrations through 0051_add_tt_phase_round_reported_results.sql, matching the 46 top-level migration SQL files on main; pending remains 0.

Safety boundary

This PR changes .github/workflows/d1-migrate.yml, so merging it to main will trigger another production D1 migration workflow run. Keep this PR draft until that second production run is explicitly intended.

No migration SQL, dependency/lockfile, Cloudflare credential/environment, D1 target, or application behavior changes.

Refs #3476

@azumag
azumag marked this pull request as ready for review October 2, 2026 06:03
@azumag
azumag merged commit fdc7996 into main Oct 2, 2026
7 checks passed
@azumag
azumag deleted the fix/3476-d1-audit-no-json branch October 2, 2026 06:03
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