You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(config): rollback writes a revision row but never restores the live config #18478
Config rollback records that a rollback happened but never restores the config. rollback_to_revision inserts a new ConfigRevision row with source="rollback" and returns. Nothing writes after_config back to the live settings store or the agent config. The UI's rollback button reports success while the running config is unchanged.
Requirement for the restore this issue adds, found in code review on PR #19648 (#19337): stored revisions are redacted before they are written (config_revision_service.redact_secrets). So target.after_config holds placeholders, not secrets: ********** (REDACTED_PLACEHOLDER) from #19337 on, and ***REDACTED*** in older rows (LEGACY_PLACEHOLDERS in autobot_shared/secret_redaction.py). A restore that applies the snapshot as-is would write a placeholder over the live secret. When restoring, any value equal to REDACTED_PLACEHOLDER or in LEGACY_PLACEHOLDERS must keep the current live value, and that needs a test. Today the hazard is latent, because the rollback endpoint applies nothing (which is this issue).
Delivered by: PR #21741 (head ed0718758d), landed on main via train T144 (#21743), merge commit ea542589c6. Verified against origin/main. Chain:services/config_revision_service.pyConfigRevisionService.rollback_to_revision → services/config_rollback.pyrollback_locked → apply_snapshot, applied before_record_applied_rollback writes the row.
Acceptance criteria (quoted verbatim):
"Rolling back a settings revision changes the value returned by the live settings read" — ✅ apply_snapshot writes through ConfigService.save_full_config / update_backend_settings. Tests autobot-backend/services/config_rollback_18478_test.py::test_settings_rollback_changes_the_live_read, ::test_backend_rollback_changes_the_live_read.
"Rolling back an agent-config revision changes the live agent config" — ✅ agent target writes agents.<id>.* through config_manager.set_nested + save_settings. Tests ::test_agent_rollback_changes_the_live_agent_config, ::test_agent_write_failure_restores_prior_values.
"A failed apply leaves no source=\"rollback\" row" — ✅ apply runs first and raises before any row. Test ::test_failed_apply_records_no_rollback_row (asserts create_revision never called); unknown targets raise UnsupportedRollbackTarget (::test_unknown_target_is_rejected).
"Regression test asserts the live store, not the revision table" — ✅ the live fixture patches ConfigService.get_full_config/save_full_config/get_backend_settings/update_backend_settings with _LiveStore, and the tests above assert live.get_full_config() / live.get_backend_settings().
Scope note: the tests exercise the service against a stand-in live store (unit level); no host-level evidence is claimed here.
Activity
mrveiss commentedon Oct 26, 2026
Requirement for the restore this issue adds, found in code review on PR #19648 (#19337): stored revisions are redacted before they are written (
config_revision_service.redact_secrets). Sotarget.after_configholds placeholders, not secrets:**********(REDACTED_PLACEHOLDER) from #19337 on, and***REDACTED***in older rows (LEGACY_PLACEHOLDERSinautobot_shared/secret_redaction.py). A restore that applies the snapshot as-is would write a placeholder over the live secret. When restoring, any value equal toREDACTED_PLACEHOLDERor inLEGACY_PLACEHOLDERSmust keep the current live value, and that needs a test. Today the hazard is latent, because the rollback endpoint applies nothing (which is this issue).github-actions commentedon Nov 3, 2026
needs-structurecleared: goal milestone, matching phase label and native parent (or sub-issues) are all present (#19522).fix(config,plugins): rollback merges only the revision delta, applies…
fix(config): rollback reads before/after under the one config lock (#…
fix(config): rollback locks every config writer and applies a leaf-le…
docs(config): state the deletion semantics of the rollback leaf delta (…
fix(types): regenerate api.ts for the rollback docstring change (#18478)
fix(tests): the rollback row test's create_revision fake returns the …
fix(train): reach floors return to mid-window on the merged tree (#18478
github-actions commentedon Nov 18, 2026
Landed via the merge train (#21743, merge
ea542589c6) via #21741fix(config,plugins): rollback applies the snapshot live; plugin disab…
mrveiss commentedon Nov 18, 2026
✅ Verified closed with proof of implementation
Delivered by: PR #21741 (head
ed0718758d), landed onmainvia train T144 (#21743), merge commitea542589c6. Verified againstorigin/main.Chain:
services/config_revision_service.pyConfigRevisionService.rollback_to_revision→services/config_rollback.pyrollback_locked→apply_snapshot, applied before_record_applied_rollbackwrites the row.Acceptance criteria (quoted verbatim):
apply_snapshotwrites throughConfigService.save_full_config/update_backend_settings. Testsautobot-backend/services/config_rollback_18478_test.py::test_settings_rollback_changes_the_live_read,::test_backend_rollback_changes_the_live_read.agents.<id>.*throughconfig_manager.set_nested+save_settings. Tests::test_agent_rollback_changes_the_live_agent_config,::test_agent_write_failure_restores_prior_values.source=\"rollback\"row" — ✅ apply runs first and raises before any row. Test::test_failed_apply_records_no_rollback_row(assertscreate_revisionnever called); unknown targets raiseUnsupportedRollbackTarget(::test_unknown_target_is_rejected).livefixture patchesConfigService.get_full_config/save_full_config/get_backend_settings/update_backend_settingswith_LiveStore, and the tests above assertlive.get_full_config()/live.get_backend_settings().Scope note: the tests exercise the service against a stand-in live store (unit level); no host-level evidence is claimed here.