Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
11277: ci: block non-linear merges r=AaronFriel a=AaronFriel This ensures commit history is linear, enabling customer-owned forks of the pulumi CLI to more easily maintain their fork. Reverse merges into PR branches result in a more complex process for them and for us. To test this PR, I based my PR branch off an older commit from the target branch and added a merge commit. That resulted in the check failing: https://github.com/pulumi/pulumi/actions/runs/3416559764/jobs/5686840393 > Checking merge commit efb7be0 for non-linear history > Main branch parent is: 83c9dfc Merge #11262 > PR branch parents are d9460b9 > Checking: d9460b9 Merge remote-tracking branch 'origin/master' into friel/block-reverse-merge > Error: Non-linear history, PR contains a merge d9460b9. Remove this by rebasing on the target. > Error: Detected non-linear history. > Error: Process completed with exit code 1. Fixes #10903 The script used by this lint contains several "tests" and useful diagnostics. Example outputs: ```shell $ ./scripts/git-linear-history-check.sh f033d9d Checking merge commit f033d9d for non-linear history Main branch parent is: 0797f29 Merge #10817 PR branch parents are 110dd76 ffbb03c cdf8f20 396650a Checking: 110dd76 ci: Pin yarn lockfile for security & dependency scanning Checking: ffbb03c ci: Build binary with .exe extension on Windows Checking: cdf8f20 ci: Remove several test skips, check if unnecessary Checking: 396650a ci: Re-enable Windows tests with temp dir ✅ Commit history is linear. ``` ```shell $ ./scripts/git-linear-history-check.sh 0f3e536 Checking merge commit 0f3e536 for non-linear history Main branch parent is: bc704af Merge #10703 #10717 PR branch parents are 9065d7c 22f2989 9f5ec4a Checking: 9065d7c refactored defaultServiceLoop into its own method ::error::Non-linear history, PR contains a merge fa09da6. Remove this by rebasing on the target. ::error::Non-linear history, PR contains a merge 536f3d6. Remove this by rebasing on the target. Checking: 22f2989 ci: Fix package parallelism assignment Checking: 9f5ec4a Add missing `ProgramTestOptions` overrides in `With` ::error::Detected non-linear history. ``` The `::error::` messages should appear in GitHub Actions logs at the top level (the workflow level) as well as in the detailed output of the action. Co-authored-by: Aaron Friel <mayreply@aaronfriel.com>
- Loading branch information