Skip to content

Bump production OpenFGA to v1.18.2 - #28

Merged
JohnRDOrazio merged 3 commits into
mainfrom
chore/openfga-1.18.2
Aug 5, 2026
Merged

Bump production OpenFGA to v1.18.2#28
JohnRDOrazio merged 3 commits into
mainfrom
chore/openfga-1.18.2

Conversation

@JohnRDOrazio

@JohnRDOrazio JohnRDOrazio commented Aug 5, 2026

Copy link
Copy Markdown
Member

What this is

Image pin bump only: openfga/openfga:v1.15.1v1.18.2 in auth/docker-compose.prod.yml (both the openfga service and the one-shot migrate service), plus the matching rows in the docs/SYSADMIN.md component inventory. Nothing else in the compose file changes — ghcr.io/zitadel/zitadel:v4.15.0 and ghcr.io/zitadel/zitadel-login:v4.15.0 are untouched (verified with grep -n "zitadel:v\|zitadel-login:v" before and after).

Migration-free on Postgres

Task 1 of this upgrade plan verified this empirically against the real v1.18.2 image, not by reading release notes: running v1.18.2's migrate against a v1.15.1-migrated Postgres database is a no-op. This was confirmed by inspecting goose_db_version directly (unchanged before/after), not by reading migrate's log output. Assets 001-006 are identical between v1.15.1 and v1.18.2. The v1.18.0 operational warning about migration 008 applies only to MySQL; this deployment is Postgres, so it does not apply. Preshared-key auth is unchanged, and /usr/local/bin/grpc_health_probe is still present in the v1.18.2 image, so the existing healthcheck needs no changes.

Rollback

If anything looks wrong after restart, rollback is just reverting this pin back to v1.15.1 and restarting. There is no schema migration to undo either direction.

What merging does — and does not — do

Merging this PR only lets sync-to-vps.yml fast-forward the new compose file onto the VPS at /opt/cdcf-auth. It does not restart anything. The containers keep running on 1.15.1 until an operator deliberately brings the stack down and back up (docker compose -f auth/docker-compose.prod.yml up -d) — that restart, and the checks below, are Task 5 of the plan and are intentionally not part of this PR.

Post-restart checks (Task 5, for the record)

Once an operator restarts the stack, Task 5 calls for:

  • Health endpoints for OpenFGA (and the migrate one-shot completing/exiting cleanly) responding as expected.
  • Both stores' (LitCal and Martyrology) latest authorization model IDs unchanged from before the restart.
  • A real Check call against OpenFGA succeeding (not just a health probe) to confirm the API is actually serving authorization decisions correctly post-upgrade.

Scope of this PR

  • auth/docker-compose.prod.yml — two image: pins bumped, nothing else.
  • docs/SYSADMIN.md — the two OpenFGA rows in the component inventory table.

No SSH, no .env.production reads, and no provisioning commands were run as part of this PR — this is a file edit describing production, not a touch of production itself.

Summary by CodeRabbit

  • Maintenance
    • Updated the OpenFGA migration and runtime services to version 1.18.2.
    • Confirmed compatibility with existing authentication, Playground behavior, health checks, and database migration behavior.
  • Documentation
    • Updated the system administration component inventory to reflect OpenFGA version 1.18.2.
    • Recorded upgrade verification results and noted that no additional PostgreSQL migrations are required.

Migration-free on Postgres: assets 001-006 are identical at v1.15.1 and
v1.18.2, confirmed empirically by running v1.18.2 migrate against a
v1.15.1-migrated database (no-op, verified via goose_db_version directly).
The v1.18.0 operational warning covers MySQL schema migration 008 only;
this deployment is Postgres. Rollback is a pin revert with no schema to
undo. Zitadel and zitadel-login pins are untouched.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@JohnRDOrazio, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 5 minutes

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

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b9d08722-747f-48f5-879f-76b7ac17f95f

📥 Commits

Reviewing files that changed from the base of the PR and between 40e38db and 6db5ec5.

📒 Files selected for processing (1)
  • docs/superpowers/plans/2026-08-04-openfga-1182-upgrade.md
📝 Walkthrough

Walkthrough

OpenFGA runtime and migration services were upgraded from v1.15.1 to v1.18.2. System administration documentation and the upgrade plan now record the updated versions and verification findings.

Changes

OpenFGA upgrade

Layer / File(s) Summary
Upgrade service images
auth/docker-compose.prod.yml, docs/SYSADMIN.md
The runtime and migration images now use OpenFGA v1.18.2. The system administration inventory reflects the same version.
Record verification findings
docs/superpowers/plans/2026-08-04-openfga-1182-upgrade.md
The plan records completed image, healthcheck, authentication, Playground, cleanup, and PostgreSQL migration checks. It notes that MySQL was not tested.

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

Possibly related PRs

🚥 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 and concisely describes the production OpenFGA upgrade to v1.18.2.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 chore/openfga-1.18.2

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/superpowers/plans/2026-08-04-openfga-1182-upgrade.md (1)

95-105: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Make the migration check fail closed.

This Step 5 block only starts Postgres and sleeps before running the migrations, then records Step 5 as complete if later scripts continue. Use a ready probe that targets the openfga role/database and add fail-fast behavior so a failed openfga/openfga:v1.15.1 migrate or openfga/openfga:v1.18.2 migrate cannot be recorded as confirmed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/plans/2026-08-04-openfga-1182-upgrade.md` around lines 95 -
105, Update Step 5 to enable fail-fast shell behavior so either OpenFGA migrate
command failure stops the check. Replace the fixed sleep with a readiness probe
against the Postgres instance using the openfga role and database, and only run
the migrations after readiness succeeds; preserve both version checks and ensure
failures cannot leave the step marked complete.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@docs/superpowers/plans/2026-08-04-openfga-1182-upgrade.md`:
- Around line 95-105: Update Step 5 to enable fail-fast shell behavior so either
OpenFGA migrate command failure stops the check. Replace the fixed sleep with a
readiness probe against the Postgres instance using the openfga role and
database, and only run the migrations after readiness succeeds; preserve both
version checks and ensure failures cannot leave the step marked complete.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 17345a71-8f28-4b72-a182-cacebe0a8ad6

📥 Commits

Reviewing files that changed from the base of the PR and between 5d5158c and 40e38db.

📒 Files selected for processing (3)
  • auth/docker-compose.prod.yml
  • docs/SYSADMIN.md
  • docs/superpowers/plans/2026-08-04-openfga-1182-upgrade.md

…ppet

CodeRabbit flagged Task 1 Step 5: a fixed sleep instead of a Postgres
readiness probe, and no fail-fast between the two migrate runs, meant a
failed v1.15.1 migrate could go unnoticed because the v1.18.2 migrate
would then "succeed" by migrating the untouched database from scratch,
disproving the very claim the step exists to verify.

Add set -euo pipefail so any failing command aborts the block, and
replace the sleep with a bounded pg_isready poll against the openfga
role/database before either migrate runs.

Re-ran the snippet end to end: happy path applies goose versions 0-6
via v1.15.1 and nothing via v1.18.2; a forced first-migrate failure
(nonexistent database) now aborts before the second migrate runs.
@JohnRDOrazio

Copy link
Copy Markdown
Member Author

Addressed the CodeRabbit finding on Task 1 Step 5 of docs/superpowers/plans/2026-08-04-openfga-1182-upgrade.md (posted as an outside-diff-range review comment, not an inline thread) in 6db5ec5.

The reported issue: the block started Postgres, sleep 8, then ran the v1.15.1 migrate followed by the v1.18.2 migrate, with no fail-fast between them. On a slow machine the fixed sleep isn't long enough for Postgres to accept connections, so the v1.15.1 migrate fails against a database that isn't ready yet — but because the shell had no set -e, the script kept going and ran the v1.18.2 migrate anyway. Against that still-unmigrated database, v1.18.2 migrates it from scratch and reports success. The step then reads as green while it has actually disproven the "no Postgres migration between 1.15.1 and 1.18.2" claim the rest of the plan rests on — a false pass caused by the exact failure it was supposed to catch.

Fix: added set -euo pipefail to the block so any failing command aborts it immediately, and replaced the fixed sleep 8 with a bounded loop (30 attempts, 1s apart) polling pg_isready -U openfga -d openfga inside the fga-pg-db container, failing loudly if Postgres never becomes ready. Both migrate commands and Step 6's cleanup are otherwise unchanged.

Validated by actually running the rewritten snippet in local throwaway containers (network fga-upgrade-test, container fga-pg-db, no collision with any running stack):

  • Happy path: readiness polling printed no response then accepting connections; v1.15.1 migrate applied goose versions 0-6 (confirmed via goose_db_version timestamps); v1.18.2 migrate ran afterward and added no rows.
  • Fail-fast: pointed the first migrate at a nonexistent database to force a failure — the script exited with status 1 immediately after that error, and the second (v1.18.2) migrate never ran.

All test containers and the network were removed afterward; confirmed clean via docker ps / docker network ls.

@JohnRDOrazio
JohnRDOrazio merged commit 7b42069 into main Aug 5, 2026
1 check passed
@JohnRDOrazio
JohnRDOrazio deleted the chore/openfga-1.18.2 branch August 5, 2026 13:19
JohnRDOrazio added a commit that referenced this pull request Aug 5, 2026
Production OpenFGA has been running v1.18.2 since 2026-08-04 10:53Z. The
operator pulled the image in the Plesk Docker interface and recreated the
container; Plesk does not write back to git, so auth/docker-compose.prod.yml
still said v1.15.1 for a day afterwards.

The upgrade plan was written from that stale pin and therefore described an
upgrade that had already happened. PR #28 was a correction of the compose
file, not a version bump, despite its title.

- SYSADMIN 5.4 now records the running version, when it changed, how it was
  changed, and that it was verified from the container's own startup log
  (build.version v1.18.2, commit 560d5d3d) rather than from a file.
- SYSADMIN 10.3 gains the general lesson: docker-compose.prod.yml is not
  authoritative for what is running, because the Plesk Docker extension can
  recreate a container from its UI without touching git. Check
  .Config.Image and the service's own build.version before trusting a pin.
- The plan's Task 5 is marked superseded with the evidence, and kept as the
  runbook for the next version change — noting that its premise will need
  re-checking first.

Task 1's verification is unaffected and still load-bearing: it proved
empirically that 1.15.1 -> 1.18.2 applies no Postgres migration, which is
what makes the already-performed upgrade safe rather than lucky.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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