Skip to content

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

Merged
ptr727 merged 2 commits into
developfrom
feature/auto-2490
Oct 8, 2026
Merged

ptr727 merged 2 commits into
developfrom
feature/auto-2490

Conversation

@ptr727

@ptr727 ptr727 commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

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

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.

ptr727 and others added 2 commits October 8, 2026 06:39
A pull request's checkout is GitHub's merge commit, built on the base
branch's tip, while the event's base.sha can predate commits landed since,
as after a close and reopen. Diffing against it scanned those commits as
the pull request's own. Resolve the base as the merge commit's first parent,
keeping the event's base.sha for a checkout that is no merge commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 8, 2026 13:55
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c868bc5c-4614-47e9-b51d-97a1cd183211
📥 Commits

Reviewing files that changed from the base of the PR and between 5c5d890 and 30e6ed2.

📒 Files selected for processing (2)
  • .github/workflows/validate-task.yml
  • tests/test_prose_lint.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The pull-request workflow now selects a base for the prose gate, using HEAD^1 when HEAD^2 resolves as a commit and otherwise using the event base. Tests cover base selection and gate input.

Changes

Prose-gate base selection

Layer / File(s) Summary
Resolve and pass the prose-gate base
.github/workflows/validate-task.yml
The workflow selects HEAD^1 when HEAD^2 resolves as a commit. Otherwise, it uses the event’s base.sha. The prose gate receives the selected base.
Test base selection and gate input
tests/test_prose_lint.py
A helper extracts a named workflow run block. Tests verify base selection and prose-gate behavior for merge and non-merge checkouts.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Merge Risk: ⚪ Minimal · up to 30e6e

No identified issue blocks merging after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 58.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 1 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: the prose gate uses the merge commit's own base instead of the event's base.sha.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 58.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 1 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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 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.

🟢 Approval recommended

All reviewed changes are covered by regression tests with no unresolved blocking issues.

0 open findings

What changed in this PR

Updates the prose gate to compare against the merge commit’s actual base, avoiding unrelated base-branch changes.

Changes:

  • Resolve the merge commit’s first parent as the prose base.
  • Fall back to the event base for non-merge checkouts.
  • Add regression tests for base resolution and wiring.
File Summary
tests/​test_prose_lint.py Adds regression coverage for base resolution and gate wiring.
.github/​workflows/​validate-task.yml Resolves and passes the correct prose diff base.

🧠 Review effort: Lite


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

@codecov

codecov Bot commented Oct 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@d4671bb). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #2529   +/-   ##
==========================================
  Coverage           ?   58.40%           
==========================================
  Files              ?       16           
  Lines              ?     8090           
  Branches           ?        0           
==========================================
  Hits               ?     4725           
  Misses             ?     3365           
  Partials           ?        0           
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.

@ptr727

ptr727 commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727
ptr727 merged commit afc77cb into develop Oct 8, 2026
12 of 13 checks passed
@ptr727
ptr727 deleted the feature/auto-2490 branch October 8, 2026 14:04
ptr727 added a commit that referenced this pull request Oct 8, 2026
…2532)

## Summary

Promotes one change from `develop`:

- #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 #2529's own CI run the step logged its resolved base, and the
gate's scope was the pull request's 2 files.
- #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](https://claude.com/claude-code)
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.

2 participants