Skip to content

[GLUTEN-13541][CI] Retry fork CI on an older main when main's workflow changes block the push - #13768

Open
malinjawi wants to merge 1 commit into
apache:mainfrom
malinjawi:ci/merge-upstream-workflow-changes
Open

malinjawi wants to merge 1 commit into
apache:mainfrom
malinjawi:ci/merge-upstream-workflow-changes

Conversation

@malinjawi

@malinjawi malinjawi commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

merge-upstream pushes the squash-merged commit to the fork with the workflow token, which may not add workflow files. When main changed .github/workflows/ after a branch was cut, the push is rejected and the whole fork run fails until the branch is rebased (70 fork runs from Nov 17 to 24). Now, only when the push is rejected for that reason, it merges onto the last main commit before that change, pushes, and warns that a rebase tests against the latest main.

How was this patch tested?

Ran the action's steps against a local bare repo with a hook that rejects workflow-file pushes like GitHub does: a stale branch falls back and pushes; an up-to-date branch, a fork that already has the workflow changes, other push errors and conflicts behave as before. In the fork, merge-upstream passed on x86, ARM and Kafka.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code (claude-opus-5-5)

Related issue: #13541

…w changes block the push

The merge-upstream job squash-merges the pushed commit onto apache/gluten
main and pushes the result to the fork with the workflow's token. The
fork rejects that push when main changed files under .github/workflows/
after the branch was cut and the fork doesn't have those changes yet, so
the whole run fails until the branch is rebased. Between Nov 17 and 24
this failed 70 runs in contributors' forks.

When the push is rejected for that reason, merge onto the last main
commit before the first such workflow change, push that, and warn that a
rebase tests against the latest main. Runs whose push succeeds are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the INFRA label Nov 24, 2026
@malinjawi
malinjawi force-pushed the ci/merge-upstream-workflow-changes branch from 1304e54 to ceaf9d2 Compare November 24, 2026 18:02
@malinjawi malinjawi changed the title [GLUTEN-13541][CI] Fix two merge-upstream problems in fork CI runs [GLUTEN-13541][CI] Retry fork CI on an older main when main's workflow changes block the push Nov 24, 2026
@felipepessoto

Copy link
Copy Markdown
Contributor

What do you think about using GitHub’s refs/pull/<n>/merge as a follow-up for fork branches that already have an open PR? If its parents match the main SHA we just fetched and the fork SHA that triggered CI, downstream jobs could check out that exact merge commit from apache/gluten. That would test against current main without pushing anything back to the fork.

I’d keep the retry in this PR for pushes that happen before a PR is open, or when the merge ref is missing or stale. I don’t see this as a blocker for the fix.

@felipepessoto

Copy link
Copy Markdown
Contributor

The retry handles the reported workflow-permission rejection, and unrelated push failures still fail the job. I wouldn't block this fix, but I found two edge cases:

  1. Fallback base selection: In a local reproduction, main changed and reverted workflow A, then changed workflow B. The squash onto current main merged cleanly, and the push was rejected for B. The retry went back before A and hit a source conflict, even though the parent of the B change merged and pushed cleanly. It would be worth covering this case with a regression test and choosing a compatible, more recent base before asking the contributor to rebase.
  2. Path filtering: relevant still describes the first merge. When main moved a file from docs/ to cpp/, the published fallback changed only docs/ but still reported relevant=true for cpp/. Rechecking paths against the fallback base would avoid unnecessary native builds.

Separate follow-up: the Kafka checkout mismatch is pre-existing, not introduced by this PR. spark35 depends directly only on build-native, so it can't read needs.merge-upstream.outputs.revision. spark35-stress doesn't set a checkout ref. Both can test JVM code from the fork head against native binaries built from the squash commit. I'd track that separately rather than ask this patch to fix it.

This branch has not been deployed

No deployments
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.

2 participants