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

Utilize GitHub Actions to aid checking of commit message #2429

Merged
merged 15 commits into from
Feb 24, 2024

Conversation

KevinEyo1
Copy link
Contributor

@KevinEyo1 KevinEyo1 commented Feb 18, 2024

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • DevOps
  • Improve developer experience
  • Others, please explain:

Overview of changes:
#2140
Added a job in a new workflow pr-message-reminder.yml for checking PR description for having a proposed commit message.
Added a script process_message.py to aid in processing of PR description body.

Anything you'd like to highlight/discuss:
Created a separate workflow instead of adding new job in ci.yml so as to avoid running all jobs anytime PR description body is edited, since only the new job needs to be run. Can keep within same workflow but would be more messy with many if statements.

Testing instructions:

Proposed commit message: (wrap lines at 72 characters)
GitHub Actions: add checking of proposed commit message

There is no checking of proposed commit message presence.

PR authors may forget to include proposed commit message.

Adding a check using GitHub Actions will help remind and ensure
that authors don't miss out on filling in the commit message.

Let's add a job to the a new workflow, pr-message-reminder.yml
file to help automate checking and reminding of filling in the
proposed commit message for each PR.

This approach automates the process, without having to have
other users check and remind PR authors themselves. Adding the
new job to a new workflow will allow greater control of job triggers
while maintaining clean code.


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

Reviewer checklist:

Indicate the SEMVER impact of the PR:

  • Major (when you make incompatible API changes)
  • Minor (when you add functionality in a backward compatible manner)
  • Patch (when you make backward compatible bug fixes)

At the end of the review, please label the PR with the appropriate label: r.Major, r.Minor, r.Patch.

Breaking change release note preparation (if applicable):

  • To be included in the release note for any feature that is made obsolete/breaking

Give a brief explanation note about:

  • what was the old feature that was made obsolete
  • any replacement feature (if any), and
  • how the author should modify his website to migrate from the old feature to the replacement feature (if possible).

Copy link

codecov bot commented Feb 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (31d00dc) 48.87% compared to head (cfaf41f) 48.87%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2429   +/-   ##
=======================================
  Coverage   48.87%   48.87%           
=======================================
  Files         124      124           
  Lines        5238     5238           
  Branches     1109     1109           
=======================================
  Hits         2560     2560           
  Misses       2371     2371           
  Partials      307      307           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yucheng11122017
Copy link
Contributor

Hi @KevinEyo1 why is the ci check passing when the commit message is empty?

@KevinEyo1
Copy link
Contributor Author

@yucheng11122017 It's a new bug that I'm working on right now, so will take abit more before the PR is ready.

@KevinEyo1 KevinEyo1 marked this pull request as ready for review February 22, 2024 15:54
@KevinEyo1
Copy link
Contributor Author

Fixed all bugs and functionally tested on GitHub. Currently only runs on pull_request trigger. Should it be run on push trigger as well?

Copy link
Contributor

@kaixin-hc kaixin-hc left a comment

Choose a reason for hiding this comment

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

Glad to see that you were able to fix the bug caused by the script trying to interpolate the punctuation marks!

I think it makes sense to merge this PR first. Running it to check if there is a PR message when we merge the PR in can be a separate PR (tiny PRs are easier to review!)

Copy link
Contributor

@yucheng11122017 yucheng11122017 left a comment

Choose a reason for hiding this comment

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

LGTM!

I think one thing we will have to be careful about is from now on that currently this script relies on
**Proposed commit message: (wrap lines at 72 characters)**
and **Checklist:** :ballot_box_with_check: within the PR template to get the commit message.
If we change the PR template, or if accidentally edits the PR template when making a PR, this check will fail.
So if we change the PR template, we will have to update this script accordingly

This PR can definitely be expanded in the future for example,

  • checking if the commit message is wrapped at 72 characters
  • checking for other empty fields
  • checking if checkboxes are ticked

@yucheng11122017 yucheng11122017 added the r.Minor Version resolver: increment by 0.1.0 label Feb 24, 2024
@yucheng11122017 yucheng11122017 merged commit 8bac97a into MarkBind:master Feb 24, 2024
14 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
r.Minor Version resolver: increment by 0.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants