Repository navigation
feat(ci): gate releases on a fresh install and an upgrade - #13692
levivannoort wants to merge 2 commits into
Conversation
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.
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.
|
| } | ||
|
|
||
| public function __construct() | ||
| { |
There was a problem hiding this comment.
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.There was a problem hiding this comment.
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.
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
- 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.
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.ymlnow do it:docker-compose.ymlwith no dev override — the artifact self-hosters actually pull, which the e2e matrix never exercises because it always runs withdocker-compose.override.ymlmounted over the image — and drives the console and project APIs a self-hoster starts with..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.shis 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.Ztag below the branch'sAPP_VERSION_STABLE, read from git rather than the registry's recent-tag listing.The release task
docker compose exec appwrite release 2.0.2writesAPP_VERSION_STABLE, both README install snippets and theMigration::$versionsentry 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 theCheck release metadatastep fails CI when those files disagree.Note for review
The gate jobs are skipped on PRs into
mainby design (base_ref != 'main'), so they will not run here. They need aworkflow_dispatchrun on this branch to be exercised before merge — I have not spent that yet.