Skip to content

Promote develop to main: Gate Prose on the Merge Commit's Own Base - #2532

Merged
ptr727 merged 1 commit into
mainfrom
develop
Oct 8, 2026
Merged

ptr727 merged 1 commit into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Summary

Promotes one change from develop:

  • Gate Prose on the Merge Commit's Own Base, Not the Event's base.sha #2529: the prose gate in validate-task.yml diffs against the base the pull request's checkout was built on. The checkout is GitHub's merge commit, and the event's base.sha can be older than its first parent, as after a close and reopen, which made the gate scan commits landed on the base branch since as the pull request's own. A new Resolve prose base step uses the merge commit's first parent, and keeps the event's base.sha for a checkout that is no merge commit. A promotion still diffs against the default branch's tip.

Fixes #2490

Verification

  • TestTheGateDiffsAgainstTheMergeCommitsOwnBase runs the workflow step's own script and the composite action's own script against a constructed repository whose base moved after the event, and shows the event's base reporting a landed commit's comment while the resolved base does not. Reverting the guard, and reverting the gate's input to base.sha, each failed the suite.
  • On Gate Prose on the Merge Commit's Own Base, Not the Event's base.sha #2529's own CI run the step logged its resolved base, and the gate's scope was the pull request's 2 files.
  • Gate Prose on the Merge Commit's Own Base, Not the Event's base.sha #2529 took two recorded local strict-review passes, the first finding fixed before the push, and a Copilot and a CodeRabbit round on its head with no findings.

🤖 Generated with Claude Code

…2529)

## Summary

The prose gate in `validate-task.yml` diffed against
`github.event.pull_request.base.sha` while the lint job checks out
GitHub's merge commit for the pull request. The merge commit is built on
the base branch's current tip, and the event's `base.sha` can be older
than that, as after a close and reopen. The diff then scanned every
commit landed on the base branch in between as the pull request's own,
and failed a pull request that added nothing the gate reports.

A new `Resolve prose base step` resolves the base as the checkout's
first parent where HEAD is a merge commit, which is by construction the
base the checkout was built on, and keeps the event's `base.sha` for a
checkout that is no merge commit. The gate step reads that output. A
promotion still diffs against the default branch's tip, since that is
the merge commit's first parent there.

## Tests

`TestTheGateDiffsAgainstTheMergeCommitsOwnBase` in
`tests/test_prose_lint.py` runs the workflow step's own script and the
composite action's own script against a constructed repository, where a
commit carrying a comment lands on the base after the event's base and
before the merge:

- the step resolves the merge commit's first parent, and the gate passes
on it
- the event's base, fed to the gate, reports the landed commit's
comment, which is the defect itself
- a checkout that is no merge commit keeps the event's base, with
`HEAD^1` held apart from it so an unguarded first parent fails
- the gate step consumes the resolved output

Each of the guard and the wiring was reverted in turn, and the suite
failed each time. The step-script extraction is shared with the existing
label-step helper.

Closes on promotion: #2490

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Improved pull request prose checks so they compare changes against the
appropriate baseline in both merge and non-merge checkouts.
* **Tests**
* Added coverage for baseline selection and verification that prose
checks use the resolved baseline.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 8, 2026 14:04
@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 42dc98d2-6d47-43a8-9364-497f8b40467a
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot stopped reviewing on behalf of ptr727 due to an error October 8, 2026 14:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note

Copilot was unable to run its full agentic suite in this review.

Copilot review overview

2 open findings
What changed in this PR

Updates the prose gate workflow to diff PRs against the correct base when GitHub checks out a merge commit, preventing unrelated landed commits from being attributed to the PR.

Changes:

  • Add a workflow step to resolve the correct prose diff base (merge commit’s first parent vs. event base SHA).
  • Update the prose gate invocation to use the resolved base output.
  • Refactor tests to extract workflow step scripts generically and add coverage for the merge-commit base-resolution behavior.
File Description
tests/​test_prose_lint.py Adds a reusable helper to extract workflow step scripts and introduces tests covering base-resolution for merge commits.
.github/​workflows/​validate-task.yml Adds “Resolve prose base step” and wires its output into the prose gate action input.

🧠 Review effort: Lite


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread .github/workflows/validate-task.yml
Comment thread tests/test_prose_lint.py
@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.40%. Comparing base (5c5d890) to head (afc77cb).
⚠️ Report is 328 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2532   +/-   ##
=======================================
  Coverage   58.40%   58.40%           
=======================================
  Files          16       16           
  Lines        8090     8090           
=======================================
  Hits         4725     4725           
  Misses       3365     3365           
Flag Coverage Δ
python-3.13 58.40% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Gate Prose on the Merge Commit's Own Base, Not the Event's base.sha

2 participants