Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 25, 2025

The signoff check was blocking merge commits even though merge commits typically don't require signoff trailers. This caused issues when using commit-check as a PR prerequisite, as GitHub merge commits would fail the signoff check and prevent PR merging.

Problem

When doing merges on GitHub, the signoff trailer is missing from merge commits. If commit-check is configured as a PR check, the signoff requirement blocks legitimate merges:

checks:
  - check: commit_signoff
    regex: Signed-off-by:.*[A-Za-z0-9]\s+<.+@.+>
    error: Signed-off-by not found in latest commit
    suggest: run command `git commit -m "conventional commit message" --signoff`

Before this fix:

  • Merge pull request #123 from user/feature → ❌ FAIL (blocked merge)
  • feat: add new feature → ❌ FAIL (correctly requires signoff)

Solution

Added merge commit detection logic to check_commit_signoff() that mirrors the existing logic in check_imperative(). The function now extracts the subject line and skips signoff validation if it starts with "Merge".

After this fix:

  • Merge pull request #123 from user/feature → ✅ PASS (merge skipped)
  • feat: add new feature → ❌ FAIL (still requires signoff)
  • feat: add new feature\n\nSigned-off-by: User <user@example.com> → ✅ PASS (has signoff)

Changes

  1. Modified check_commit_signoff() to skip merge commits by checking if subject starts with "Merge"
  2. Fixed CLI interface to properly pass the commit message file parameter to check_commit_signoff()
  3. Added comprehensive tests for merge commit scenarios and edge cases

The fix is minimal (5 lines changed) and maintains backward compatibility while resolving the merge commit blocking issue.

Fixes #265.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Contributor Author

Copilot AI commented Aug 25, 2025

@shenxianpeng 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot AI and others added 2 commits August 25, 2025 14:59
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
Copy link

@Copilot Copilot AI changed the title [WIP] Signoff check blocks merge commits Fix signoff check to skip merge commits like imperative check does Aug 25, 2025
@Copilot Copilot AI requested a review from shenxianpeng August 25, 2025 15:03
Copilot finished work on behalf of shenxianpeng August 25, 2025 15:03
Copy link
Contributor

coderabbitai bot commented Aug 25, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Join our Discord community for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the bug Something isn't working label Aug 25, 2025
Copy link

Copy link

codecov bot commented Aug 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.14%. Comparing base (1b8ff4e) to head (71e920a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #266   +/-   ##
=======================================
  Coverage   99.13%   99.14%           
=======================================
  Files           8        8           
  Lines         347      350    +3     
=======================================
+ Hits          344      347    +3     
  Misses          3        3           

☔ View full report in Codecov by Sentry.
📢 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.

@shenxianpeng shenxianpeng changed the title Fix signoff check to skip merge commits like imperative check does fix: skip signoff check merge commits Aug 25, 2025
Copy link

codspeed-hq bot commented Aug 25, 2025

CodSpeed Performance Report

Merging #266 will not alter performance

Comparing copilot/fix-265 (71e920a) with main (1b8ff4e)

Summary

✅ 104 untouched benchmarks
🆕 3 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 test_check_commit_signoff_skip_merge_commit N/A 1 ms N/A
🆕 test_check_commit_signoff_skip_merge_pr_commit N/A 1 ms N/A
🆕 test_check_commit_signoff_still_fails_non_merge_without_signoff N/A 2.9 ms N/A

@shenxianpeng shenxianpeng marked this pull request as ready for review August 25, 2025 22:17
@shenxianpeng shenxianpeng requested a review from a team as a code owner August 25, 2025 22:17
@shenxianpeng shenxianpeng merged commit 3537653 into main Aug 25, 2025
29 checks passed
@shenxianpeng shenxianpeng deleted the copilot/fix-265 branch August 25, 2025 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Signoff check blocks merge commits
2 participants