Skip to content

Fix scheduled CI upgrade failing when its PR already exists - #69018

Merged
potiuk merged 1 commit into
apache:mainfrom
shahar1:fix-ci-upgrade-pr-detection
Jun 26, 2026
Merged

Fix scheduled CI upgrade failing when its PR already exists#69018
potiuk merged 1 commit into
apache:mainfrom
shahar1:fix-ci-upgrade-pr-detection

Conversation

@shahar1

Copy link
Copy Markdown
Contributor

The scheduled breeze ci upgrade job (.github/workflows/... → "Scheduled CI upgrade check") force-pushes a stable branch ci-upgrade-<branch> and then looks for an existing PR before creating one. The lookup passed the owner:branch head label (e.g. apache:ci-upgrade-main) to gh pr list --head, but that flag filters by the bare branch name only and explicitly does not support <owner>:<branch> syntax. So the existing PR was never found, the code fell through to gh pr create, and GitHub rejected the duplicate — failing the run:

pull request create failed: GraphQL: A pull request already exists for apache:ci-upgrade-main.

(see run 28223885557)

Fix:

  • Use the bare branch name for the gh pr list and gh pr ready lookups. Only gh pr create --head needs the cross-fork owner:branch label.
  • Treat an already exists creation error as success (the branch has already been force-pushed, so the existing PR is up to date) — guards against a list/create race.

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8)

Generated-by: Claude Code (Opus 4.8) following the guidelines

The scheduled "breeze ci upgrade" job force-pushes a stable branch
(ci-upgrade-<branch>) and then looks for an existing PR before creating
one. The lookup passed the "owner:branch" head label to "gh pr list
--head", but that flag filters by the bare branch name only and does not
support the "owner:branch" syntax, so the existing PR was never found and
the job fell through to "gh pr create" — which rejected the duplicate and
failed the run.
Use the bare branch name for the "gh pr list" and "gh pr ready" lookups
(only "gh pr create --head" needs the cross-fork "owner:branch" label),
and treat an "already exists" creation error as success since the branch
has already been force-pushed.
@potiuk
potiuk merged commit 419ac06 into apache:mainJun 26, 2026
145 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-3-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

StatusBranchResult
v3-3-testPR Link

github-actionsBot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Jun 26, 2026
…ts (apache#69018)
The scheduled "breeze ci upgrade" job force-pushes a stable branch
(ci-upgrade-<branch>) and then looks for an existing PR before creating
one. The lookup passed the "owner:branch" head label to "gh pr list
--head", but that flag filters by the bare branch name only and does not
support the "owner:branch" syntax, so the existing PR was never found and
the job fell through to "gh pr create" — which rejected the duplicate and
failed the run.
Use the bare branch name for the "gh pr list" and "gh pr ready" lookups
(only "gh pr create --head" needs the cross-fork "owner:branch" label),
and treat an "already exists" creation error as success since the branch
has already been force-pushed.
(cherry picked from commit 419ac06)
Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com>
potiuk pushed a commit that referenced this pull request Jun 26, 2026
…ts (#69018) (#69055)
The scheduled "breeze ci upgrade" job force-pushes a stable branch
(ci-upgrade-<branch>) and then looks for an existing PR before creating
one. The lookup passed the "owner:branch" head label to "gh pr list
--head", but that flag filters by the bare branch name only and does not
support the "owner:branch" syntax, so the existing PR was never found and
the job fell through to "gh pr create" — which rejected the duplicate and
failed the run.
Use the bare branch name for the "gh pr list" and "gh pr ready" lookups
(only "gh pr create --head" needs the cross-fork "owner:branch" label),
and treat an "already exists" creation error as success since the branch
has already been force-pushed.
(cherry picked from commit 419ac06)
Co-authored-by: Shahar Epstein <60007259+shahar1@users.noreply.github.com>
karenbraganz pushed a commit to karenbraganz/airflow that referenced this pull request Jun 30, 2026
…9018)
The scheduled "breeze ci upgrade" job force-pushes a stable branch
(ci-upgrade-<branch>) and then looks for an existing PR before creating
one. The lookup passed the "owner:branch" head label to "gh pr list
--head", but that flag filters by the bare branch name only and does not
support the "owner:branch" syntax, so the existing PR was never found and
the job fell through to "gh pr create" — which rejected the duplicate and
failed the run.
Use the bare branch name for the "gh pr list" and "gh pr ready" lookups
(only "gh pr create --head" needs the cross-fork "owner:branch" label),
and treat an "already exists" creation error as success since the branch
has already been force-pushed.
Sign up for freeto 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.

2 participants

@shahar1@potiuk