Skip to content

fix: keep staged PSQL branches reconciling - #31

Merged
patrickleet merged 2 commits into
mainfrom
fix/psql-branch-staged-readiness
Sep 8, 2026
Merged

fix: keep staged PSQL branches reconciling#31
patrickleet merged 2 commits into
mainfrom
fix/psql-branch-staged-readiness

Conversation

@patrickleet

@patrickleet patrickleet commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • explicitly propagate computed PSQLBranch readiness into the function pipeline
  • prevent function-auto-ready from marking an incomplete staged branch Ready
  • add the live cross-namespace snapshot stage as a regression fixture and assertion

Failure observed

Harmony API preview PR 600 reached status.ready=false while the standard Ready condition became True after only the source observation resources were ready. Crossplane then stopped advancing the composition before the branch snapshot, CNPG Cluster, and generated credentials existed.

Verification

  • focused staged render: status.ready=false and Ready=False while branch snapshot resources are emitted
  • focused steady-state render: status.ready=true and Ready=True after the recovered cluster and Usage locks are ready
  • make render: all examples pass using Dory
  • project/functions build successfully in Dory
  • local up test parsing, schemas, dependencies, and build pass; assertion execution hits the existing local runner timeout cycle, so hosted CI is authoritative
  • local crossplane beta validate is unavailable in the installed CLI; hosted validation is authoritative

Live consumer: https://github.com/gitkb/harmony-api/pull/600
Task: harmony-1394

Summary by CodeRabbit

  • Bug Fixes

    • Composite resources now accurately report their readiness status through the Crossplane readiness annotation.
    • Resources remain marked as not ready while staged cross-namespace restore resources are still unavailable.
  • Improvements

    • Cross-namespace restore workflows now better reflect the readiness of PostgreSQL clusters, volume snapshots, and snapshot content resources during reconciliation.

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 56 minutes.

Check out review usage here.

View limit details

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

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

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 7c3bd3ee-769e-4eb9-bc97-507cedb0c589

📥 Commits

Reviewing files that changed from the base of the PR and between e2eb5e0 and 8b65157.

📒 Files selected for processing (1)
  • tests/test-branch/main.k

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 2b695919-63be-4ba6-9be6-54f56ec372b7

📥 Commits

Reviewing files that changed from the base of the PR and between 6ea7ffc and e2eb5e0.

📒 Files selected for processing (3)
  • functions/branch/999-status.yaml.gotmpl
  • tests/test-branch/main.k
  • tests/test-branch/observed/cross-namespace-staged.yaml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The branch status template now sets the Crossplane readiness annotation from $state.status.ready. Cross-namespace staging tests add observed source resources and verify that the composite remains unready during the handoff.

Changes

Branch readiness staging

Layer / File(s) Summary
Render composite readiness
functions/branch/999-status.yaml.gotmpl
The template sets gotemplating.fn.crossplane.io/ready to "True" or "False" from $state.status.ready.
Validate staged restore state
tests/test-branch/observed/cross-namespace-staged.yaml, tests/test-branch/main.k
The staged fixture adds observed cluster, snapshot, and snapshot-content resources. The test asserts that the PSQLBranch composite remains unready with a Ready=False condition.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to e2eb5

Staged PSQL branches now remain unready until their required restore resources exist, preventing reconciliation from stopping early. The staged cross-namespace behavior is covered by an assertion, with no remaining merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: keeping staged PSQL branches reconciling through readiness and snapshot-stage fixes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/psql-branch-staged-readiness

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.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Published Crossplane Package

The following Crossplane package was published as part of this PR:

Package: ghcr.io/hops-ops/psql-stack:pr-31-9644eed7fc541a5d42b5784cff11d8f86a13fe15

View Package

@patrickleet
patrickleet merged commit 0b6010f into main Sep 8, 2026
11 checks passed
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