Skip to content

fix: Stop the release build when merging main conflicts - #1371

Closed
BaggioWongHK wants to merge 2 commits into
mainfrom
template-first/a-stop-on-merge-conflict
Closed

BaggioWongHK wants to merge 2 commits into
mainfrom
template-first/a-stop-on-merge-conflict

Conversation

@BaggioWongHK

@BaggioWongHK BaggioWongHK commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Description

The "Open Pull Request" job in build-image.yml runs under bash -l {0}, which does not exit on errors. When git merge main into an existing release branch conflicted, the job carried on, regenerated artifacts from the conflicted template and committed the unfinished merge, conflict markers included. That is how release-4.6.0 got 59b9f07 and why its image build then failed (fixed for 4.6.0 by #1363).

This aborts the merge and fails the job instead. Because nothing is pushed, the release PR would otherwise show no sign of the failure, so the job also comments on the release PR with the conflicting files and the run link. Maintainers then resolve the conflict in a pull request into the release branch, merge it, and use "Re-run failed jobs".

Independent of #1372 and #1373; can merge on its own. Squash on merge.

Type of Change

  • Image update - Bug fix
  • Image update - New feature
  • Image update - Breaking change
  • SMD image build tool update
  • Documentation update

Release Information

  • Yes (Critical bug fix or security update)
  • No (New feature or non-critical change)
  • N/A (Not an image update)

How Has This Been Tested?

This workflow only runs in aws/sagemaker-distribution and needs the CodeBuild secrets, so the step's script was run locally under bash -l against a throwaway repo whose release branch conflicts with main, with gh and the remote calls stubbed. The step exits 1, leaves the working tree clean, sends nothing to the remote, and posts:

Merging `main` into `release-9.9.0` conflicted, so this build stopped and pushed nothing.

Conflicting files:
- f
- g

Resolve the conflict in a pull request into `release-9.9.0`, merge it, then re-run the failed jobs: https://github.com/aws/sagemaker-distribution/actions/runs/123

The workflow parses as YAML. It has not run on GitHub yet.

Checklist:

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Related Issues

#1352, #1363

Baggio Wong added 2 commits October 7, 2026 18:18
The "Open Pull Request" job runs under `bash -l {0}`, which does not
exit on errors. When `git merge main` into an existing release branch
conflicted, the job carried on, regenerated artifacts from the
conflicted template and committed the unfinished merge, conflict
markers included. That is how release-4.6.0 got 59b9f07 and why its
image build then failed.

Abort the merge and fail the job instead, so the conflict is resolved
in a pull request into the release branch before the build reruns.
The failed merge pushes nothing, so the release PR showed no sign of
the failure, and only the person who triggered the run (or last edited
the nightly schedule) got GitHub's failure email. Comment on the
release PR with the conflicting files and the run link instead.
@BaggioWongHK

Copy link
Copy Markdown
Contributor Author

Closing without merging. The team decided this tooling change is too costly to audit and test relative to its benefit. The conflict this guarded against is prevented instead by a release-runbook step: create the next minor's template on main (cp -r template/vX/vX.Y template/vX/vX.(Y+1)) right after X.Y.0 ships, before the next minor's first build. The branch is kept for reference.

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.

1 participant