[ 
https://issues.apache.org/jira/browse/CALCITE-7871?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18129146#comment-18129146
 ] 

Zhen Chen commented on CALCITE-7871:
------------------------------------

Thanks for your suggestion; I’d love for more people to join the discussion on 
this idea. I’ve been engaging with the SGLang community recently, and I came 
across this concept in their CI pipeline—it struck me that we might benefit 
from something similar. In a sense, you’re quite right. Let me add some 
context: the goal of this CI check is to lighten the load for reviewers who 
have merge permissions. Our standard practice is for each pull request (PR) to 
contain exactly one commit—though sometimes there are more, I believe breaking 
them down into individual commits is a better approach. We also require the PR 
title, the Jira ticket title, and the commit message to be consistent. I’ve 
noticed that some recent PRs have included two commits (even when they weren't 
addressing two separate Jira tickets); I’ve even made this mistake myself when 
merging PRs from other contributors. My thought is that we should implement an 
automated check to avoid the time-consuming manual effort of fixing these 
issues. To keep the CI pipeline from becoming overly complex, I propose that we 
allow this check to fail during the PR review phase, but it must pass before 
the PR can be merged. We would still maintain the practice of submitting one 
commit per review round, so this won't disrupt our established review process.

> Validate pull request titles and require a single matching commit
> -----------------------------------------------------------------
>
>                 Key: CALCITE-7871
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7871
>             Project: Calcite
>          Issue Type: Wish
>    Affects Versions: 1.42.0
>            Reporter: Zhen Chen
>            Assignee: Zhen Chen
>            Priority: Minor
>              Labels: pull-request-available
>
> Calcite’s pull request template outlines contribution guidelines, but these 
> rules currently rely on manual review. Given the significant volume of 
> AI-generated contributions, manual oversight is prone to oversights; 
> therefore, we should implement automated PR checks to enforce consistent 
> titling and single-commit requirements.
> Expected behavior:
>  - Require exactly one commit per PR. Its subject must exactly match the full 
> PR title; an additional commit message body is allowed.
>  - Require the PR title, excluding the CALCITE-XXXX prefix, to exactly match 
> the Jira issue title. PR and Jira descriptions are not checked.
>  - Allow [TEST] Description for test additions and [MINOR] Description for 
> other minor changes. These prefixes skip Jira validation but retain the 
> commit requirements.
>  - Automatically run when a PR is opened, edited, synchronized, reopened, or 
> marked ready for review. Merging into main must not trigger this check.
>  - Report actionable errors for invalid titles, mismatches, multiple commits, 
> or unavailable Jira issues.
>  - Update the PR template to explain the rules and exceptions.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to