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

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

I think all the suggestions shared here are excellent, including the similar 
points Mihai raised in the PR comments. To be honest, I haven't come up with a 
perfect solution yet. What I'm trying now is to add an "approve" label — the 
unique commit check would only run when this label is present. I'm thinking we 
could have the approve action automatically trigger adding the label (since the 
approve action itself doesn't seem very flexible to add or remove, whereas 
labels are more manageable). If there are multiple commits, as Mihai suggested, 
we'd consider the title consistency check passed as long as at least one commit 
message matches the PR title. The consistency check would be triggered when the 
PR title is updated, a new commit is pushed, or the PR is reopened. This way, 
CI wouldn't keep failing during the development and review process, though I'm 
not entirely sure if this fully meets everyone's needs.

> 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