Skip to content

chore(ci): prevent duplicate container upgrade PRs#21901

Merged
gnodet merged 2 commits intomainfrom
ci/fix-duplicate-container-prs
Mar 10, 2026
Merged

chore(ci): prevent duplicate container upgrade PRs#21901
gnodet merged 2 commits intomainfrom
ci/fix-duplicate-container-prs

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Mar 10, 2026

Summary

Fix the check-container-versions.yml workflow 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:

  1. The branch name included ${{ github.run_number }}, making each weekly run create a unique branch even for the same upgrade
  2. There was no check for existing open PRs before creating a new one

Fix

Two changes:

  1. 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 push will be a no-op (same content) or fail gracefully.

  2. Check for existing open PRs: Before creating a branch/PR, the workflow now checks:

    • Whether an open PR with the same branch name already exists (exact same upgrade)
    • Whether any open PR with the container-images label 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.

gnodet and others added 2 commits March 10, 2026 10:31
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>
@github-actions
Copy link
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@gnodet gnodet merged commit 581b0b5 into main Mar 10, 2026
2 checks passed
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