Skip to content

fix(ci): never claim :latest on a manual docker-publish run#2316

Merged
Flix6x merged 3 commits into
mainfrom
fix/docker-publish-latest-guard
Jul 14, 2026
Merged

fix(ci): never claim :latest on a manual docker-publish run#2316
Flix6x merged 3 commits into
mainfrom
fix/docker-publish-latest-guard

Conversation

@Flix6x

@Flix6x Flix6x commented Jul 14, 2026

Copy link
Copy Markdown
Member

Problem

docker-publish.yml decides whether to also push lfenergy/flexmeasures:latest with:

if [ "${{ github.event.release.prerelease }}" != "true" ]; then

github.event.release.prerelease only exists on the release webhook payload. On workflow_dispatch there is no release payload, so the expression renders as an empty string, [ "" != "true" ] is true, and the run pushes :latest alongside the requested tag — silently overwriting the stable image with whatever was manually built.

That makes the manual-dispatch path documented in release_process.rst unsafe for anything but a stable release.

Fix

  • Gate the latest tag on github.event_name == 'release', so a dispatch never claims it implicitly.
  • Add an opt-in latest boolean input (default false) so the documented "re-run a stable release" path still works.
  • Document both in release_process.rst, including the easy-to-miss detail that workflow_dispatch reads the workflow file from the ref picked in the "Use workflow from" dropdown, while the tag input decides which ref is checked out and built.

Behaviour

event prerelease latest input pushed tags
release false :v0.33.1 + :latest
release true :v0.34.0rc1
workflow_dispatch n/a unticked :v0.34.0rc1
workflow_dispatch n/a ticked :v0.33.1 + :latest

Before this change, row 3 also pushed :latest.

Context

Found while preparing a pre-release image for a downstream plugin, which needs exactly the dispatch path in row 3.

🤖 Generated with Claude Code

Flix6x and others added 2 commits July 14, 2026 17:54
`github.event.release.prerelease` only exists on the `release` webhook
payload. On `workflow_dispatch` it renders as an empty string, which sails
past the bare `!= "true"` check -- so any manual run pushed
`lfenergy/flexmeasures:latest` alongside the requested tag, silently
overwriting the stable image with whatever was built.

Gate the `latest` tag on the event being a `release`, and add an opt-in
`latest` input so the documented "re-run a stable release" path still works.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: F.N. Claessen <felix@seita.nl>
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 flexmeasures | 🛠️ Build #33585564 | 📁 Comparing d7eb1a9 against latest (c35554a)

  🔍 Preview build  

3 files changed
± changelog.html
± api/v3_0.html
± dev/release_process.html

Signed-off-by: Felix Claessen <30658763+Flix6x@users.noreply.github.com>
@Flix6x Flix6x self-assigned this Jul 14, 2026
@Flix6x Flix6x added bug Something isn't working Continuous Integration labels Jul 14, 2026
@Flix6x Flix6x added this to the 1.0.0 milestone Jul 14, 2026
@Flix6x
Flix6x merged commit b74cb05 into main Jul 14, 2026
12 of 13 checks passed
@Flix6x
Flix6x deleted the fix/docker-publish-latest-guard branch July 14, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Continuous Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant