Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW: Add check for PR titles prefixes in CI #1934

Merged
merged 1 commit into from
May 24, 2024

Conversation

jfreire-unity
Copy link
Collaborator

Description

This PR adds a check for PR titles prefixes in our repo. It tries to enforce our strict PR title prefixes to make sure we have a consistent commit history when we squash-merge.

Changes made

Added a GitHub Action, instead of Yamato, because we don't need any Unity infrastructure for this.

Runs a script to validate the PR title once it is created and edited.

Impact:

If the PR has the wrong prefix, checks will fail. ❌
To fix it, just edit the PR title and the CI check will run again automatically. ✅

Notes

This can always be bypassed when we squash the commits and create the title for the new squashed commit in GitHubs UI.

No Jira link.
I did this on my own time since I wanted to have automated checks of things that usually are done during a PR review and now don't need to. We have one less thing to review :)

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • FogBugz ticket attached, example ([case %number%](https://issuetracker.unity3d.com/issues/...)).
    • FogBugz is marked as "Resolved" with next release version correctly set.
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

@jfreire-unity jfreire-unity changed the title NEW: Add check for PR titles prefixes in CI NEWS: Add check for PR titles prefixes in CI May 24, 2024
@jfreire-unity jfreire-unity changed the title NEWS: Add check for PR titles prefixes in CI NEW: Add check for PR titles prefixes in CI May 24, 2024
Copy link
Collaborator

@ekcoh ekcoh left a comment

Choose a reason for hiding this comment

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

Good help with slap on the fingers when done inconsistently, does this guard in any way for editing again as part of merge stage though? Or is the possible to guard/check there as well? I believe that would be even better since it then could be corrected without Ci rerun. I often rewrite both title and commit message as part of the squash as one example.

@jfreire-unity jfreire-unity force-pushed the validate-pr-titles-github-actions branch from 411156e to e05d2a2 Compare May 24, 2024 12:02
@jfreire-unity
Copy link
Collaborator Author

Good help with slap on the fingers when done inconsistently, does this guard in any way for editing again as part of merge stage though? Or is the possible to guard/check there as well? I believe that would be even better since it then could be corrected without Ci rerun. I often rewrite both title and commit message as part of the squash as one example.

I didn't find a easy way to do that, unfortunately. It might be a Github UX limitation. But something to consider as an improvement for this.

The way that seems to allow that requires us to use Github Merge Queue. I tried using them in the past, but it will increase our merge to develop time.
Using GH Merge Queues would create an intermediate "merged with develop" branch where all the CI checks would run again. So unless we want to have that, this extra "squash title prefix check" can't exist.

@jfreire-unity jfreire-unity merged commit 3adb0e1 into develop May 24, 2024
77 of 79 checks passed
@jfreire-unity jfreire-unity deleted the validate-pr-titles-github-actions branch May 24, 2024 14:20
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.

3 participants