Skip to content

fix(upgrade): serialize migrations and verify Alpha 1 recovery - #48

Merged
RentnerKev merged 4 commits into
feat/admin-audit-logfrom
fix/alpha2-upgrades
Sep 12, 2026
Merged

RentnerKev merged 4 commits into
feat/admin-audit-logfrom
fix/alpha2-upgrades

Conversation

@RentnerKev

@RentnerKev RentnerKev commented Sep 12, 2026 •

Copy link
Copy Markdown
Member

Database startup now serializes migrations and authorization synchronization on one reserved PostgreSQL connection. Restoring an Alpha 1 backup into a newer appliance also replaces newer application-schema objects: restore SQL is fully prepared first, then the application-schema reset and dump execute in one transaction. SQL failures roll back the database and staged key rather than leaving partial data replacement.

The appliance smoke boots the digest-pinned published Alpha 1 image with its actual schema, upgrades the same volumes, repeats startup, and restores its backup into a fresh candidate appliance. It verifies users, roles, settings, hosts, certificates, CAs, migrations, runtime revision, HTTP, verified HTTPS and redirects. A valid archive with an intentionally invalid CHECK-dependent row exercises SQL restore failure; a table created after the dump must survive, and the existing appliance must recover its original traffic.

Closes #34.

Backup/recovery instructions live in docs/upgrades.md with one README link. Startup errors identify the failed phase without printing credentials or SQL. Controller-state replacement follows the committed database restore; a later failure still requires complete recovery, as documented.

Stacked on #47; retarget to main after that prerequisite merges. Do not merge into the feature base.

Validation on 091e6b7: full local check passed (599 TypeScript tests, 119 Rust tests; 107 environment-dependent tests skipped). GitHub CI including PostgreSQL integration, CodeQL and all Production Smokes are green. The production appliance passed 29 checks, including actual Alpha 1 startup, in-place upgrade, repeated startup, fresh backup restore and the exact CHECK-violation rollback case. A separate PostgreSQL 18 reproduction verified the dump/render/transaction path. Temporary file ownership is handed to PostgreSQL only after root writes complete, preserving compatibility with Linux protected_regular. Failed restore diagnostics expose only fixed phases and recognized SQLSTATE codes.

@coderabbitai

coderabbitai Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 5d5907cf-532d-44c8-bf24-8b2175a349e5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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 merged commit 15be7b9 into feat/admin-audit-log Sep 12, 2026
15 checks passed
@RentnerKev
RentnerKev deleted the fix/alpha2-upgrades branch September 12, 2026 06:32
RentnerKev added a commit that referenced this pull request Sep 12, 2026
* fix(upgrade): serialize migrations and verify Alpha 1 recovery

* test(upgrade): avoid search-path-dependent relation output

* fix(backup): restore older schemas atomically

* fix(restore): preserve temporary file ownership while writing
RentnerKev added a commit that referenced this pull request Sep 12, 2026
* fix(upgrade): serialize migrations and verify Alpha 1 recovery

* test(upgrade): avoid search-path-dependent relation output

* fix(backup): restore older schemas atomically

* fix(restore): preserve temporary file ownership while writing
RentnerKev added a commit that referenced this pull request Sep 12, 2026
* fix(upgrade): serialize migrations and verify Alpha 1 recovery

* test(upgrade): avoid search-path-dependent relation output

* fix(backup): restore older schemas atomically

* fix(restore): preserve temporary file ownership while writing
RentnerKev added a commit that referenced this pull request Sep 12, 2026
* feat(admin): add bounded administrative audit log

* fix(ci): bound release validation subprocesses

* fix(upgrade): serialize migrations and verify Alpha 1 recovery (#48)

* fix(upgrade): serialize migrations and verify Alpha 1 recovery

* test(upgrade): avoid search-path-dependent relation output

* fix(backup): restore older schemas atomically

* fix(restore): preserve temporary file ownership while writing
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