Skip to content

fix(runtime): make confirmed controller policy recovery durable - #189

Merged
RentnerKev merged 2 commits into
mainfrom
fix/controller-recovery-durability
Oct 6, 2026
Merged

RentnerKev merged 2 commits into
mainfrom
fix/controller-recovery-durability

Conversation

@RentnerKev

@RentnerKev RentnerKev commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Controller policy activation now persists recovery state before changing traffic and commits it only after Caddy confirms the revision. An unfinished activation selects the closed baseline after restart; failed activation restores the previous verified configuration. A later configuration retry repairs pending recovery state before certificate rotation proceeds.

Related issue

Refs #72. This PR handles one item from the security review; the overall review remains open.

Type of change

  • Bug fix

Testing

  • 47 focused runtime tests passed on Windows, including 12 new storage-failure, restart, retry, and certificate-rotation cases.
  • cargo fmt --all --check, locked offline Clippy with warnings denied, and git diff --check passed.
  • Linux CI additionally exercises the Unix filesystem tests.
  • Reviewed the backup and restore paths: the pending activation marker is preserved with the complete controller state.

Checklist

  • I tested the relevant functionality.
  • Existing relevant local tests pass.
  • I added or updated tests where appropriate.
  • This PR does not include secrets, credentials, production data, or private certificates/keys.
  • I linked the relevant review item.

Breaking changes

None. The existing v7 policy snapshot format is retained. Snapshot preparation and pre-commit errors fail the activation. After the confirmed policy is durably stored and the marker is unlinked, a directory-sync error preserves that confirmed policy and records a warning; a subsequent restart may select the closed baseline if the unsynced marker reappears.

Screenshots

None.

@RentnerKev RentnerKev added this to the v1.0.0-beta.1 milestone Oct 6, 2026
@RentnerKev RentnerKev added security Public security hardening or remediation; disclose vulnerabilities privately. area: runtime Caddy and privileged controller runtime behavior. labels Oct 6, 2026
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 33 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: RentnerKev/RentnerProxy/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4f75388e-e46d-487e-83a9-64c7f8e06ac7
📥 Commits

Reviewing files that changed from the base of the PR and between b2c15bb and 128d388.

📒 Files selected for processing (6)
  • core/src/runtime/apply.rs
  • core/src/runtime/configuration.rs
  • core/src/runtime/mod.rs
  • core/src/runtime/state.rs
  • core/tests/private/runtime.rs
  • core/tests/private/runtime/recovery.rs
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@RentnerKev
RentnerKev force-pushed the fix/controller-recovery-durability branch from fc0940d to 128d388 Compare October 6, 2026 20:57
@RentnerKev
RentnerKev merged commit 168d7a2 into main Oct 6, 2026
27 checks passed
@RentnerKev
RentnerKev deleted the fix/controller-recovery-durability branch October 6, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Caddy and privileged controller runtime behavior. security Public security hardening or remediation; disclose vulnerabilities privately.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant