ci(release): attach revert-to-immich.sql to every release - #982
Merged
Conversation
Releases shipped only docker-compose.yml and example.env, so the revert-to-immich escape hatch was reachable only by browsing the repo at the right tag — and the file changes every few releases, so grabbing it from main gives you the wrong migrations to undo. Attach scripts/revert-to-immich.sql alongside the existing two assets in both the release and prerelease workflows. Both tag jobs already check out at needs.version.outputs.sha, so the uploaded copy is the script as it stood at that release's commit. Guard it in the version job rather than at upload time: the tag is force-pushed and the images are built long before gh release create runs, so a missing script would otherwise fail an hour in with a tag already published. The check reads the blob at $sha rather than testing the working tree, because the `commit` input can pin an older ancestor than the checked-out ref. The 35 existing releases that contain the script (v4.50.0 onward) were backfilled separately; v4.49.1 and older predate it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Releases shipped only
docker-compose.ymlandexample.env. The revert-to-immich escape hatch was reachable only by browsing the repo at the right tag — and the file changes every few releases (521 lines onmainvs 478 at v5.3.1), so grabbing it frommaingives you the wrong set of migrations to undo.What
Attach
scripts/revert-to-immich.sqlalongside the existing two assets, at all three call sites:gallery-release-server-only.yml—gh release creategallery-prerelease-server.yml—gh release upload --clobber(re-run path)gallery-prerelease-server.yml—gh release create(first-run path)Both tag jobs already check out at
ref: ${{ needs.version.outputs.sha }}, so the uploaded copy is the script as it stood at that release's commit — no git plumbing needed.Plus a preflight in each
versionjob. It lands there rather than at upload time because the git tag is force-pushed and all images are built beforegh release createruns — a missing script would otherwise fail ~an hour in, with a tag already published and no release. The check reads the blob at$sharather thantest -fon the working tree, because thecommit:input can pin an older ancestor than the checked-out ref.Verification
bash -non both editedrun:blocks, and YAML parse on both files.Related
The 35 existing releases that contain the script (v4.50.0 → v5.3.1, prereleases included) were backfilled separately, each with the version from its own tag — verified by downloading each asset back and matching
git hash-objectagainst the tag's blob SHA (35/35). v4.49.1 and older predate the script, so the cut is clean.