-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Build
-
None
-
Fully Compatible
-
Build OnDeck
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Anything in this description will be included in the commit message. Replace or delete this text before merging. Add links to testing in the comments of the PR.
Description
Problem
Squash merge collapses a pull request into one commit, so the existing validate_commit_message task validates the squashed headline (title + description) and gets full coverage with a single check. If the repo moves to rebase-and-merge, each PR commit lands verbatim, which loses coverage:
- intermediate commit messages were never validated (they don't land under squash)
- the PR title/description no longer travels inside any commit message, so banned-string and linked-CVE scanning over commit messages misses it
- a ticket's commits can no longer be reverted as a unit
What this PR adds
- buildscripts/validate_rebase_merge.py:
- validates every commit that would land via is_valid_commit (same rules as the squashed commit today)
- requires every commit description to contain a feature branch ticket: SERVER-XXXX line, and all commits to name the same ticket, so the series stays identifiable/revertable as a unit
- fetches the PR title/description and checks them for banned strings, and folds them into the linked-CVE scan (restoring the coverage squash provides implicitly)
- validate_rebase_merge Evergreen task in etc/evergreen_yml_components/tasks/misc_tasks.yml, allowed requesters github_merge_queue and github_pr
- rebase-check build variant in etc/evergreen_yml_components/variants/misc/misc.yml with patch_only: true so it never runs on the waterfall — it only runs on PR and merge-queue patch builds, whether the eventual merge is squash or rebase
- unit tests in buildscripts/tests/test_validate_rebase_merge.py
Notes for reviewers
- Making this a required merge-queue check is a follow-up in Evergreen project settings / GitHub branch protection once the variant is validated on patches.
- Team tag assigned_to_jira_team_devprod_test_infrastructure matches validate_commit_message's ownership.