Skip to content

fix: restore by one rule for every error type, and never overwrite a backup - #10

Merged
debabsah merged 1 commit into
mainfrom
fix/rollback-reliability
Oct 3, 2026
Merged

debabsah merged 1 commit into
mainfrom
fix/rollback-reliability

Conversation

@debabsah

@debabsah debabsah commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Item A from the 0.2.0 triage: rollback after a failed build.

The rule, now applied the same way to every error type: a failure in the prepare or import step, in-place chart updates included, puts the backup back automatically; a failure after that (linkage, filter scopes, chart queries) leaves the new version live, with the backup path in the report for chartwright restore.

What was wrong

  1. A chart update that Superset rejected (HTTP error) after the import left the dashboard half-updated, while a connection drop at the same step restored it.
  2. An error that wasn't a Superset error (a bug in Chartwright) skipped the restore and surfaced as a traceback, losing the backup path.
  3. Backup names had one-second resolution, so two applies in one second overwrote the first backup.

What changed

  • apply.py: restore on a failed in-place chart update; a catch-all that follows the same rule and returns the normal report; write_backup() names backups to the microsecond (20261003T141502.123456.zip) with exclusive create.
  • tests/test_apply_rollback.py: four offline cases, each of which fails on main.
  • tools/faultline.py: three new live scenarios (an import-time bug, a rejected in-place chart update, a dropped in-place chart update), each required to auto-restore and leave plan clean against the pre-apply spec. CI runs them on Superset 4.1.4, 5.0.0 and 6.1.0.
  • VERIFICATION.md (fault-injection section, test count) and CHANGELOG.md.

The guides in #9 that describe a failed chart update as leaving the new version live will be updated there.

Offline suite: 347 passed.

…backup

- A chart update Superset rejected after the import left the dashboard
  half-updated, while a connection drop at the same step restored it. Both
  now restore the backup.
- A non-Superset error (a bug) mid-build skipped the restore and surfaced
  as a traceback without the backup path. It now follows the same rule and
  returns the normal report.
- Failures after the chart updates (linkage, scopes, queries) still leave
  the new version live, unchanged.
- Backup names go to the microsecond and use exclusive create, so two
  applies in one second no longer overwrite the first backup.

Tests: four offline cases (each fails on main), and three new live fault
scenarios in tools/faultline.py (import-time bug, rejected and dropped
in-place chart update) run on 4.1.4, 5.0.0 and 6.1.0 in CI.
@debabsah
debabsah merged commit b014596 into main Oct 3, 2026
7 checks passed
@debabsah
debabsah deleted the fix/rollback-reliability branch October 3, 2026 21:07
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