chore(ci): prevent duplicate container upgrade PRs#21901
Merged
Conversation
The check-container-versions workflow was creating duplicate PRs for the same container upgrade because: 1. The branch name included the workflow run number, making each run unique 2. There was no check for existing open PRs before creating a new one Fix by: - Removing the run number from branch names so the same upgrade always maps to the same branch - Checking for existing open PRs (by branch name and by property name) before creating a new one Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of skipping when an open PR exists for the same property, close the stale PR (with a comment) and create a new one for the newer version. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
oscerd
approved these changes
Mar 10, 2026
Contributor
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
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.
Summary
Fix the
check-container-versions.ymlworkflow to avoid creating duplicate PRs for the same container version upgrade.Problem
The workflow was creating duplicate PRs (e.g., #21822 and #21895 both upgrade ollama to 0.17.7) because:
${{ github.run_number }}, making each weekly run create a unique branch even for the same upgradeFix
Two changes:
Deterministic branch names: Remove the run number suffix. Branch names are now
automated/upgrade-<property>-<version>(e.g.,automated/upgrade-ollama-container-0.17.7). If a PR for the same property+version already exists,git pushwill be a no-op (same content) or fail gracefully.Check for existing open PRs: Before creating a branch/PR, the workflow now checks:
container-imageslabel already exists for the same property name (different version of the same container)In either case, the upgrade is skipped with a log message.
Example
Before: Running the workflow twice in a week with ollama outdated would create:
automated/upgrade-ollama-container-0.17.7-16(run 16)automated/upgrade-ollama-container-0.17.7-17(run 17) — duplicate!After: The second run detects the existing PR and skips it.