Skip to content

fix(ci): only update Docker versions when runner has newer version#2061

Merged
gounthar merged 242 commits intojenkins-docs:mainfrom
gounthar:fix/docker-version-only-upgrade
Feb 25, 2026
Merged

fix(ci): only update Docker versions when runner has newer version#2061
gounthar merged 242 commits intojenkins-docs:mainfrom
gounthar:fix/docker-version-only-upgrade

Conversation

@gounthar
Copy link
Collaborator

Summary

  • Prevent back-and-forth Docker version update PRs caused by different GitHub Actions runners having different Docker/Compose versions
  • Both the workflow and updatecli scripts now compare versions using sort -V and only update when the new version is strictly newer
  • Preserves the original docker-versions.txt line (including build hash) when not upgrading

Pre-PR Review

Reviewers: Copilot/GPT-4.1 (automated pre-review), CodeRabbit (pending)

Addressed

  • "build unknown" hardcoded (Medium): Fixed in follow-up commit — now preserves the original line from docker-versions.txt when not upgrading
  • Version parsing fragility (High): The parsing logic matches the existing format used throughout the repo; changing Docker CLI output format would break many tools and is unlikely without major version bumps
  • Missing error handling for files (High): The workflow already runs in a checked-out repo where docker-versions.txt exists; if it doesn't, grep returns empty and comparison falls through to using the runner's version (safe default)

Acknowledged

  • Pre-release/non-standard versions (Medium): sort -V handles pre-release tags correctly; Docker uses standard semver
  • No test coverage (Low): Shell scripts in CI workflows — validated by integration testing via the workflow itself

Test plan

  • Trigger workflow on a runner with an older Docker version → docker-versions.txt should remain unchanged
  • Trigger workflow on a runner with a newer Docker version → docker-versions.txt should update
  • Run updatecli with docker-versions.txt containing an older version than README.md → README.md should not change
  • Run updatecli with docker-versions.txt containing a newer version than README.md → README.md should update

dependabot bot and others added 30 commits January 15, 2024 12:10
Bumps debian from bookworm-20231218 to bookworm-20240110.

---
updated-dependencies:
- dependency-name: debian
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
…dekick/debian-bookworm-20240110

chore(deps): bump debian from bookworm-20231218 to bookworm-20240110 in /dockerfiles/sidekick
Bumps [updatecli/updatecli-action](https://github.com/updatecli/updatecli-action) from 2.52.0 to 2.53.0.
- [Release notes](https://github.com/updatecli/updatecli-action/releases)
- [Commits](updatecli/updatecli-action@v2.52.0...v2.53.0)

---
updated-dependencies:
- dependency-name: updatecli/updatecli-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [anchore/scan-action](https://github.com/anchore/scan-action) from 3.5.0 to 3.6.0.
- [Release notes](https://github.com/anchore/scan-action/releases)
- [Changelog](https://github.com/anchore/scan-action/blob/main/CHANGELOG.md)
- [Commits](anchore/scan-action@1d59d90...0550541)

---
updated-dependencies:
- dependency-name: anchore/scan-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…cli/updatecli-action-2.53.0

chore(deps): bump updatecli/updatecli-action from 2.52.0 to 2.53.0
…e/scan-action-3.6.0

chore(deps): bump anchore/scan-action from 3.5.0 to 3.6.0
Bumps [updatecli/updatecli-action](https://github.com/updatecli/updatecli-action) from 2.53.0 to 2.54.0.
- [Release notes](https://github.com/updatecli/updatecli-action/releases)
- [Commits](updatecli/updatecli-action@v2.53.0...v2.54.0)

---
updated-dependencies:
- dependency-name: updatecli/updatecli-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps debian from bookworm-20240110 to bookworm-20240130.

---
updated-dependencies:
- dependency-name: debian
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps jenkins/ssh-agent from 5.22.0 to 5.24.0.

---
updated-dependencies:
- dependency-name: jenkins/ssh-agent
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps jenkins/ssh-agent from 5.22.0 to 5.24.0.

---
updated-dependencies:
- dependency-name: jenkins/ssh-agent
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps jenkins/ssh-agent from 5.22.0 to 5.24.0.

---
updated-dependencies:
- dependency-name: jenkins/ssh-agent
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5 to 6.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](release-drafter/release-drafter@v5...v6)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [anchore/scan-action](https://github.com/anchore/scan-action) from 3.6.0 to 3.6.4.
- [Release notes](https://github.com/anchore/scan-action/releases)
- [Changelog](https://github.com/anchore/scan-action/blob/main/CHANGELOG.md)
- [Commits](anchore/scan-action@0550541...3343887)

---
updated-dependencies:
- dependency-name: anchore/scan-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps jenkins/ssh-agent from 5.22.0 to 5.24.0.

---
updated-dependencies:
- dependency-name: jenkins/ssh-agent
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps jenkins/ssh-agent from 5.22.0 to 5.24.0.

---
updated-dependencies:
- dependency-name: jenkins/ssh-agent
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [codacy/codacy-analysis-cli-action](https://github.com/codacy/codacy-analysis-cli-action) from 4.3.0 to 4.4.0.
- [Release notes](https://github.com/codacy/codacy-analysis-cli-action/releases)
- [Commits](codacy/codacy-analysis-cli-action@5cc54a7...33d4559)

---
updated-dependencies:
- dependency-name: codacy/codacy-analysis-cli-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…cli/updatecli-action-2.54.0

chore(deps): bump updatecli/updatecli-action from 2.53.0 to 2.54.0
…dekick/debian-bookworm-20240130

chore(deps): bump debian from bookworm-20240110 to bookworm-20240130 in /dockerfiles/sidekick
…thon/jenkins/ssh-agent-5.24.0

chore(deps): bump jenkins/ssh-agent from 5.22.0 to 5.24.0 in /dockerfiles/python
…ven/jenkins/ssh-agent-5.24.0

chore(deps): bump jenkins/ssh-agent from 5.22.0 to 5.24.0 in /dockerfiles/maven
…e-drafter/release-drafter-6

chore(deps): bump release-drafter/release-drafter from 5 to 6
…e/scan-action-3.6.4

chore(deps): bump anchore/scan-action from 3.6.0 to 3.6.4
…lti/jenkins/ssh-agent-5.24.0

chore(deps): bump jenkins/ssh-agent from 5.22.0 to 5.24.0 in /dockerfiles/multi
gounthar and others added 22 commits March 13, 2025 19:32
Bumps [updatecli/updatecli-action](https://github.com/updatecli/updatecli-action) from 2.92.0 to 2.93.0.
- [Release notes](https://github.com/updatecli/updatecli-action/releases)
- [Commits](updatecli/updatecli-action@v2.92.0...v2.93.0)

---
updated-dependencies:
- dependency-name: updatecli/updatecli-action
  dependency-version: 2.93.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
…ecli/updatecli-action-2.93.0

chore(deps): bump updatecli/updatecli-action from 2.92.0 to 2.93.0
Prevent back-and-forth version update PRs caused by different GitHub
Actions runners having different Docker/Compose versions installed.
Both the workflow and updatecli scripts now compare versions using
sort -V and only update when the new version is strictly newer.
Keep the full original line (including build hash) from
docker-versions.txt when the runner's version is not newer,
instead of writing a hardcoded "build unknown" string.
@github-actions github-actions bot added the repo label Feb 25, 2026
@gounthar gounthar requested a review from Copilot February 25, 2026 09:54
The docker-compose-version guard echoed $docker_compose_version (from
docker-versions.txt) instead of the README value when current >= new,
making the downgrade prevention a no-op.

Also add head -n1 to grep in both scripts to handle README files with
multiple version mentions.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the CI + Updatecli version-detection logic to avoid “ping-pong” PRs caused by GitHub Actions runners having different Docker / Docker Compose versions, by only updating when the detected version is strictly newer.

Changes:

  • Update Updatecli source scripts to compare docker-versions.txt vs README.md and only output a newer version (using sort -V).
  • Update the Docker registry push workflow to preserve existing docker-versions.txt lines unless the runner’s version is strictly newer.
  • Preserve the original docker-versions.txt line (including build hash) when not upgrading.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
updatecli/scripts/docker-version.sh Compares Docker version from docker-versions.txt to README and avoids outputting downgrades.
updatecli/scripts/docker-compose-version.sh Adds similar comparison logic for Docker Compose (but currently has a downgrade-prevention bug).
.github/workflows/github-docker-registry-push.yml Only rewrites docker-versions.txt when runner versions are strictly newer; otherwise preserves existing lines.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gounthar gounthar merged commit 0a895d3 into jenkins-docs:main Feb 25, 2026
8 checks passed
@gounthar gounthar deleted the fix/docker-version-only-upgrade branch February 25, 2026 10:02
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