Skip to content

contrib: change release procedure, to avoid reusing tags#10747

Draft
SomberNight wants to merge 3 commits into
spesmilo:masterfrom
SomberNight:202607_immutable_git_tags
Draft

contrib: change release procedure, to avoid reusing tags#10747
SomberNight wants to merge 3 commits into
spesmilo:masterfrom
SomberNight:202607_immutable_git_tags

Conversation

@SomberNight

@SomberNight SomberNight commented Jul 10, 2026

Copy link
Copy Markdown
Member

Towards making git tags immutable...
Let's avoid reusing tags and ambiguous binary names.


  • primary goal: immutable git tags
    • don't delete tag (e.g. "4.8.0") and then create another with the same name
  • secondary goal: immutable distributable names
    • don't make a signed "Electrum-4.8.0-arm64-v8a-release.apk" file publicly downloadable, and then later delete it, and release another identically named file

Problem: it happened several times during releases that we had to "cancel" a release
at the last minute, after there already was a git tag, after we already built binaries,
and sometimes even after those binaries were publicly available on download.electrum.org,
but always before running release_www.sh (so before the main webserver linked to them
or before qt gui update notifications were triggered).
At almost any point during making a release we might notice that we cannot reproduce
some distributables, meaning we have to cancel the release. In our current workflow,
very early in the process we create a git tag, e.g. "4.8.0". If we have to cancel
the release and apply some fixes, we will need a new git tag, and in that case historically
we have deleted and reused git tags (so the second attempt would also be from a git tag named "4.8.0" but now pointing to a new commit). This is bad practice. We should aim
to have immutable git tags.

The idea here is:

  • construct binary name from:
    version.py::ELECTRUM_VERSION + git commit hash
    (independent of the tag)

  • when we build, only create an "-rc1" git tag, e.g. "4.8.0-rc1"

  • after we are satisfied to finalise the release, near the very end,
    create another git tag, e.g. "4.8.0", pointing to the same commit

  • so in the typical happy path, we will have two git tags:

    • "4.8.0-rc1" == commit1
    • "4.8.0" == commit1
  • if something goes wrong and we have to retry, we will have:

    • "4.8.0-rc1" == commit1
    • "4.8.0-rc2" == commit2
    • "4.8.0" == commit2

the download page template has not been using them for 5 years, since:
spesmilo/electrum-web@3f2e8d3
to have access to name of distributable, not just as part of full URL
Towards making git tags immutable...
Let's avoid reusing tags and ambiguous binary names.

Problem: it happened several times during releases that we had to "cancel" a release
at the last minute, after there already was a git tag, after we already built binaries,
and sometimes even after those binaries were publicly available on download.electrum.org,
but always before running release_www.sh (so before the main webserver linked to them
or before qt gui update notifications were triggered).
At almost any point during making a release we might notice that we cannot reproduce
some distributables, meaning we have to cancel the release. In our current workflow,
very early in the process we create a git tag, e.g. "4.8.0". If we have to cancel
the release and apply some fixes, we will need a new git tag, and in that case historically
we have deleted and reused git tags (so the second attempt would also be from a git tag named "4.8.0" but now pointing to a new commit). This is bad practice. We should aim
to have immutable git tags.

The idea here is:
- construct binary name from:
    version.py::ELECTRUM_VERSION + git commit hash
    (independent of the tag)
- when we build, only create an "-rc1" git tag, e.g. "4.8.0-rc1"
- after we are satisfied to finalise the release, near the very end,
  create another git tag, e.g. "4.8.0", pointing to the same commit

- so in the typical happy path, we will have two git tags:
    - "4.8.0-rc1" == commit1
    - "4.8.0" == commit1
- if something goes wrong and we have to retry, we will have:
    - "4.8.0-rc1" == commit1
    - "4.8.0-rc2" == commit2
    - "4.8.0" == commit2
Comment thread contrib/release_www.sh
Comment on lines 53 to 61
cat <<EOF > "$WWW_DIR"/version
{
"version": "$VERSION",
"version": "$VERSIONB",
"signatures": {"$ELECTRUM_SIGNING_ADDRESS": "$sig"},
"extradata": {
"android_versioncode_nullarch": $ANDROID_VERSIONCODE_NULLARCH
}
}
EOF

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.

perhaps we should also put VERSIONC in the version announcement file, e.g. in extradata

Comment thread contrib/upload.sh
Comment on lines 32 to +36
sftp -oBatchMode=no -b - "$SSHUSER@uploadserver" << !
cd electrum-downloads-airlock
-mkdir "$VERSION"
-chmod 777 "$VERSION"
cd "$VERSION"
-mkdir "$VERSIONB"
-chmod 777 "$VERSIONB"
cd "$VERSIONB"

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.

Perhaps we should also name the folder VERSIONC.
That would help f-droid, which is programmatically constructing download URLs, with a limited API.

ref https://gitlab.com/fdroid/fdroiddata/-/blob/85be50faee4b2f78a3641a0af41d62e4d4551766/metadata/org.electrum.electrum.yml#L1480

ref https://f-droid.org/docs/Build_Metadata_Reference/#build_binary

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

note: with the current PR, nothing seems to clean up the airlock. If we need to change the commit for a given version number, the old file with the old commit name will remain in the airlock forever.

@SomberNight SomberNight added this to the 4.9.0 milestone Jul 10, 2026
@SomberNight
SomberNight marked this pull request as draft July 10, 2026 23:02
@SomberNight

Copy link
Copy Markdown
Member Author

(edited the OP to clarify the goal is not only "immutable git tags" but also "immutable distributable names")

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.

2 participants