Skip to content

Map unrecoverable Postgres branches as degraded - #565

Merged
rbjornstad merged 2 commits into
mainfrom
fix/postgres-branch-recovery-failed-state
Oct 19, 2026
Merged

rbjornstad merged 2 commits into
mainfrom
fix/postgres-branch-recovery-failed-state

Conversation

@rbjornstad

Copy link
Copy Markdown
Contributor

Summary

  • Map RecoveryFailed=True with reason Unrecoverable to DEGRADED, even when reconcilePhase is Failed.
  • Add a Kubernetes fixture for the failed branch and Lua GraphQL coverage for branch state and state facets.
  • Add unit coverage for terminal and non-terminal recovery failures.

Validation

  • go test ./internal/persistence/postgres (pass)
  • go test ./internal/kubernetes/fake (pass)
  • Lua integration test was attempted but could not start because sandbox access to /var/run/docker.sock was denied.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rbjornstad
rbjornstad requested a review from a team as a code owner October 19, 2026 12:52
@rbjornstad
rbjornstad requested a balanced review from Copilot October 19, 2026 12:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused mapping change has no identified blocking issues and includes regression coverage, though integration execution remains unverified.

No open issues 🎉

What changed in this PR

Corrects Postgres branch state reporting so unrecoverable recovery failures appear as DEGRADED, even when reconciliation has failed.

Changes:

  • Prioritizes terminal recovery failures in state mapping.
  • Adds unit coverage and a failed-branch fixture.
  • Extends GraphQL coverage for branch states and state facets.
File Description
internal/​persistence/​postgres/​models.go Maps unrecoverable recovery failures to DEGRADED.
internal/​persistence/​postgres/​models_test.go Covers terminal and non-terminal failure conditions.
integration_tests/​postgres_branches.lua Checks degraded branch state and facet counts.
integration_tests/​k8s_resources/​postgres_branches/​dev/​someteamname/​postgres_foobar_failed.yaml Adds an unrecoverable branch fixture.

Review effort: Balanced

@rbjornstad
rbjornstad merged commit b8c4493 into main Oct 19, 2026
10 checks passed
@rbjornstad
rbjornstad deleted the fix/postgres-branch-recovery-failed-state branch October 19, 2026 13:08
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.

2 participants