Skip to content

Add next Docker tag that tracks the latest full release or RC - #20596

Open
MadLittleMods wants to merge 7 commits into
developfrom
madlittlemods/next-docker-tag
Open

MadLittleMods wants to merge 7 commits into
developfrom
madlittlemods/next-docker-tag

Conversation

@MadLittleMods

@MadLittleMods MadLittleMods commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Add next Docker (container image) tag that tracks the latest full release or RC

As suggested by @wrjlewis in this weeks backend meeting. We're not aware of anyone else asking for this but even it’s just @wrjlewis who likes using it for his own homeserver deployment, it's useful for giving more effort to testing the RC and better protect from regressions 💪 And other people will probably end up using now that it's available.

Dev notes

https://packaging.pypa.io/en/stable/version.html#packaging.version.Version.public

Last time I dealt with Python packaging.Version: https://github.com/element-hq/synapse-private/pull/223

Pull Request Checklist

type=raw,value=develop,enable=${{ github.ref == 'refs/heads/develop' }}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=raw,value=next,enable=${{ steps.next-tag.outputs.is_next == 'true' }}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Opinions on the next tag name?

@devonh devonh Dec 3, 2026 •

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.

I could see it being confusing for some.
Is the latest newer or older than next? It's not immediately obvious, that latest is actually older than next if there is a newer RC available.

Something like staging makes it clear that it shouldn't be considered a stable release.
But also happy to go a different route.

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.

Tricky. I don't mind which.

prerelease is another idea, which we use for Debian packages (docs) to get RCs, and if you follow the docs you get either the latest main or RC release through apt, i.e. when you have both main and prerelease in your sources.list line.

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.

prerelease isn't bad. A bit long... 😆 But why should that matter

# We only need the tag names: skip trees and blobs.
filter: tree:0
sparse-checkout: .github
# - `versionsort.suffix=rc` makes git sort `v1.2.0rc1` before `v1.2.0`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Docs: https://git-scm.com/docs/git-config#Documentation/git-config.txt-versionsortsuffix

By specifying a single suffix in this variable, any tagname containing that suffix will appear before the corresponding main release. E.g. if the variable is set to "-rc", then all "1.0-rcX" tags will appear before "1.0".

filter: tree:0
sparse-checkout: .github
# - `versionsort.suffix=rc` makes git sort `v1.2.0rc1` before `v1.2.0`.
# - `--sort=-v:refname` to get "tag names are treated as versions"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Docs: https://git-scm.com/docs/git-tag/2.12.5#Documentation/git-tag.txt---sortkey

Sort based on the key given. Prefix - to sort in descending order of the value. You may use the --sort= option multiple times, in which case the last key becomes the primary key. Also supports "version:refname" or "v:refname" (tag names are treated as versions). The "version:refname" sort order can also be affected by the "versionsort.suffix" configuration variable.

Comment thread docker/README.md
Comment on lines +18 to +21
* `next`: the most recent release, whether a release candidate (RC) or a full release.
Use this to help test release candidates before they become a full release. It never
moves backwards, e.g. a patch release for an older version does not replace a newer
release candidate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can't tell whether this detail matters here 🤔

Suggested change
* `next`: the most recent release, whether a release candidate (RC) or a full release.
Use this to help test release candidates before they become a full release. It never
moves backwards, e.g. a patch release for an older version does not replace a newer
release candidate.
* `next`: the most recent release, whether a release candidate (RC) or a full release.
Use this to help test release candidates before they become a full release.

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.

It probably shouldn't be here. It's more of an internal note to make sure we don't accidentally let it happen.
For the docs, I wouldn't even question that this was the case.

Plus it's already noted in the dockerfile so we don't lose it altogether.

--format='%(refname:lstrip=2)' --count=1)
echo "Newest release: $NEWEST; this build: $GITHUB_REF_NAME"
echo "is_next=$([ "$NEWEST" = "$GITHUB_REF_NAME" ] && echo true || echo false)" >> "$GITHUB_OUTPUT"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Instead of using git for-each-ref, we could also use git ls-remote but it doesn't have any formatting option so we need extra shell garbage to slice and dice things 🤷

if: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
NEWEST=$(git -c versionsort.suffix=rc for-each-ref 'refs/tags/v*' --sort=-v:refname \
--exclude='refs/tags/*[!v0-9.rc]*' \

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This glob exclude pattern isn't fool-proof but should be good enough.

There are a few old tags like v0.6.1c that will slip through currently but we're way past that version nowadays so it doesn't come into play.

@MadLittleMods
MadLittleMods marked this pull request as ready for review December 3, 2026 00:41
@MadLittleMods
MadLittleMods requested a review from a team as a code owner December 3, 2026 00:41
@MadLittleMods
MadLittleMods requested review from devonh and removed request for a team December 3, 2026 00:41

@devonh devonh left a comment

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.

Overall everything looks good, it's just a question of the name of the tag now.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants