Skip to content

feat(ci): gate releases on a fresh install and an upgrade - #13692

Open
levivannoort wants to merge 2 commits into
mainfrom
feat/release-gates
Open

levivannoort wants to merge 2 commits into
mainfrom
feat/release-gates

Conversation

@levivannoort

Copy link
Copy Markdown
Member

Split out of #13659, which is now just the nightly channel. This half is the release process: the two gates a release is blocked on, and the task that writes the version metadata.

The gates

AGENTS.md has long said a release is not ready until a fresh install and an upgrade from the previous stable both work with realistic data. Someone did that by hand before every patch. Two jobs in ci.yml now do it:

  • Fresh install starts the production image from docker-compose.yml with no dev override — the artifact self-hosters actually pull, which the e2e matrix never exercises because it always runs with docker-compose.override.yml mounted over the image — and drives the console and project APIs a self-hoster starts with.
  • Upgrade installs the previous published stable from its own compose file and .env, seeds through the public API, keeps the volumes, switches to the candidate, migrates, and asserts the seeded data came back unchanged. Then migrates again, because a migration that is not idempotent breaks every resumed upgrade, and re-verifies with writes.

.github/scripts/upgrade.sh is the payload for both, over the public HTTP API only. It seeds the shapes a migration is most likely to mangle: empty strings, a 4000-character value, unicode, a relationship, and row permissions that differ from the table's — then diffs a projection of them before and after.

The baseline is the highest released X.Y.Z tag below the branch's APP_VERSION_STABLE, read from git rather than the registry's recent-tag listing.

The release task

docker compose exec appwrite release 2.0.2 writes APP_VERSION_STABLE, both README install snippets and the Migration::$versions entry from one version number, optionally repinning the console image. It refuses a patch that does not reuse the previous version's migration class — the rule that makes a rollback safe — and the Check release metadata step fails CI when those files disagree.

Note for review

The gate jobs are skipped on PRs into main by design (base_ref != 'main'), so they will not run here. They need a workflow_dispatch run on this branch to be exercised before merge — I have not spent that yet.

A release is not ready until a fresh install and an upgrade from the previous
stable both work with realistic data. AGENTS.md has said so for a while, and
someone did it by hand before every patch.

The install job starts the production image from docker-compose.yml with no
dev override and drives the console and project APIs a self-hoster starts
with. The upgrade job installs the previous published stable from its own
compose file and env, seeds through the public API, keeps the volumes,
switches to the candidate, migrates, and asserts the seeded data came back
unchanged -- then migrates again, because a migration that is not idempotent
breaks every resumed upgrade.

upgrade.sh is the payload for both, seeding the shapes a migration is most
likely to mangle: empty strings, a 4000 character value, unicode, a
relationship, and row permissions that differ from the table's.

Also adds the release task, which writes APP_VERSION_STABLE, both README
install snippets and the Migration::$versions entry from one version number,
and refuses a patch that does not reuse the previous version's migration
class. The Check release metadata step fails CI when those files disagree.
@levivannoort levivannoort self-assigned this Sep 15, 2026
levivannoort added a commit that referenced this pull request Sep 15, 2026
The install and upgrade gates, upgrade.sh and the release task are release
process, not the nightly channel: nothing here imports them, and they were
80% of a diff meant to answer "should we publish nightly builds?".

They are unchanged in #13692. What stays is the channel itself -- nightly.yml,
--channel on install and upgrade, and the docs that describe them -- plus the
*.x push trigger, which nightly needs so there are green CI runs on release
branches to resolve.
@greptile-apps

greptile-apps Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with the previously reported failures fully addressed and no new actionable defects identified.

Fix All in Claude CodeFindings

  1. P1 Container lacks release files ▶
Fix with agent prompt
### Issue 1
src/Appwrite/Platform/Tasks/Release.php:undefined-33
The documented `docker compose exec appwrite release X.Y.Z` command cannot update the checkout. The task resolves its root to `/usr/src/code`, but the Compose service does not mount the full repository there and the image does not copy `README.md` or `README-CN.md` into that directory. Because `readmePins()` requires both files, the command fails before writing the release metadata in both the production Compose setup and the default development override.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The PR adds release gates for fresh installations and upgrades, plus a release task that updates version metadata consistently.

  • Exercises realistic data through public APIs before and after migration.
  • Repeats migration to validate idempotency and verifies post-upgrade writes.
  • Adds CI schema/lint checks for release metadata consistency.
  • Mounts both README files so the documented release command can update the checkout.
  • Fixes earlier error propagation and file-content verification concerns.

Reviews (2) · Last reviewed commit: "fix(releases): address the review on the..."

}

public function __construct()
{

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.

P1 Container lacks release files

The documented docker compose exec appwrite release X.Y.Z command cannot update the checkout. The task resolves its root to /usr/src/code, but the Compose service does not mount the full repository there and the image does not copy README.md or README-CN.md into that directory. Because readmePins() requires both files, the command fails before writing the release metadata in both the production Compose setup and the default development override.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/Appwrite/Platform/Tasks/Release.php
Line: 33

Comment:
**Container lacks release files**

The documented `docker compose exec appwrite release X.Y.Z` command cannot update the checkout. The task resolves its root to `/usr/src/code`, but the Compose service does not mount the full repository there and the image does not copy `README.md` or `README-CN.md` into that directory. Because `readmePins()` requires both files, the command fails before writing the release metadata in both the production Compose setup and the default development override.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Codex

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Real — fixed in the latest push.

Confirmed the premise: the production image copies app, public, src, bin, dev and docs into /usr/src/code (Dockerfile:35-48, 128-129) and no README, and the dev override mounts docker-compose.yml, .env, phpunit.xml, tests, app, docs, public, src, dev — again no README. So readmePins() threw before a single file was written, and the command AGENTS.md documents could never have worked.

The override now mounts both READMEs, which is the right half to fix: the production image has no checkout to edit at all, while the dev stack is what compose loads by default and what a maintainer cutting a release is already running. Everything else the task touches was mounted already — app/init/constants.php and src/Appwrite/Migration/Migration.php under the app and src mounts, and docker-compose.yml directly.

Comment thread src/Appwrite/Platform/Tasks/Release.php Resolved
Comment thread .github/scripts/upgrade.sh Resolved
@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → feat/release-gates (after).

Metric Before After Change
🚀 Requests/sec 241.87 236.27 ⚪ -2.3%
⏱️ Latency P50 72.51 ms 74.15 ms ⚪ +2.3%
⏱️ Latency P95 165.75 ms 170.02 ms ⚪ +2.6%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 74.15 170.02 14,820 236.27 +4.27
Account 144.26 258.59 780 12.97 +19.14
TablesDB 71 130.74 8,060 130.61 +9.13
Storage 68.63 144.94 3,900 65.16 +0.01
Functions 108.73 216.16 2,080 35.45 +18.34

Top API waits (after)

API request Max wait (ms)
account.name.update 421.46
functions.delete 419.01
functions.create 414.81
account.prefs.update 372.05
storage.buckets.create 332.73

- release failures now exit non-zero. Every rejection logged an error and
  returned, so a wrapper reading the exit status saw a refused release as a
  successful one, and an unwritable file left the metadata half applied.
- the dev stack mounts both READMEs. `docker compose exec appwrite release`
  is the documented way to run the task, but the image carries no README and
  the override did not mount one, so it failed before writing anything.
- the upgrade gate digests the seeded file. It compared id and byte length,
  which a same-length corruption would have walked straight through.
- the migration mapping check moves from a unit test to the release metadata
  step in CI. Comparing Migration::$versions against APP_VERSION_STABLE is a
  consistency lint, not library behaviour, and tests/unit is for src
  libraries. CI now fails when the stable version has no mapping at all,
  which is the case that strands an upgrade.

This branch has not been deployed

No deployments
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