Skip to content

Conversation

@GROwen
Copy link
Contributor

@GROwen GROwen commented Nov 24, 2025

Motivation

Branch sync (6.x -> 7.x) workflows were failing silently which was blocking updates (such as bumping base image versions) to the 7.x branch.

This approach inverts the previous process and relies on the internal machinations of GitHub's PR creation process to determine the status of the PR.

Switching the processing of the diff of the merge to GitHub and the github-cli tool offloads the logic for handling of the diff output to GitHub in an attempt to improve consistency and time to remediation.

Changes

  • Removes the third-party create-pr action in favour of the GitHub CLI tool
  • Offloads logic to determine PR status to GitHub

This simplifies the generation of the diffs with the same result as initially intended. The previous change to the cherry-pick/merge strategy resulted in changes being lost.

Testing

GHA job https://github.com/dpc-sdp/bay/actions/runs/19446890092
Resulting PR #391

@GROwen GROwen self-assigned this Nov 24, 2025
git fetch origin
set +e
output=$(gh pr create --base 7.x --title "Automated PR - merge 6.x into 7.x" --body "This pull request syncs relevant changes from the 6.x branch into the 7.x branch. This PR was automatically generated by the CI workflow." --label "sync" --label "automated" 2>&1)
COMMAND_STATUS=$?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Capture the command status to exclude the response pull request create failed: GraphQL: No commits between 7.x and 6.x (createPullRequest) from failing the job.

if: env.PR_NUMBER
run: |
gh pr merge temp-sync-branch --auto --merge
conflicts=$(gh pr view ${{ env.PR_NUMBER }} --json mergeStateStatus --jq 'if .mergeStateStatus == "DIRTY" then true else false end')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This command returns the latest PR for the currently checked out branch, 6.x in this case.

@GROwen GROwen added the NEEDS REVIEW Good for newcomers label Nov 24, 2025
@GROwen GROwen marked this pull request as ready for review November 24, 2025 01:20
@GROwen GROwen changed the title Feature/sd 1247 fix branch sync [SD-1247] Fix branch sync Nov 24, 2025
@GROwen
Copy link
Contributor Author

GROwen commented Nov 24, 2025

@nicksantamaria bump

@GROwen GROwen merged commit 1a3a455 into 6.x Nov 24, 2025
1 check passed
@GROwen GROwen deleted the feature/SD-1247--fix-branch-sync branch November 24, 2025 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NEEDS REVIEW Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants