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

tools: avoid fetch extra commits when validating commit messages #39128

Merged
merged 2 commits into from
Oct 30, 2021

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Jun 23, 2021

We only need the number of commits in the PR, plus one for the merge commit.
I couldn't figure out a way to compute the + 1 operation without an extra step, if someone knows a cleaner way please chime in.

@aduh95 aduh95 requested a review from mmarchini June 23, 2021 14:59
@github-actions github-actions bot added the meta Issues and PRs related to the general management of the project. label Jun 23, 2021
Copy link
Contributor

@mmarchini mmarchini left a comment

Choose a reason for hiding this comment

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

lgtm (if something goes wrong we can always revert)

@mmarchini
Copy link
Contributor

Actually, can you force two commits here to demonstrate that it works?

@aduh95 aduh95 force-pushed the commit-msg-linter branch from e661bcb to fc2dd1c Compare October 3, 2021 23:16
@Mesteery
Copy link
Contributor

Mesteery commented Oct 4, 2021

plus one for the merge commit.

Which merge commit?

@aduh95
Copy link
Contributor Author

aduh95 commented Oct 4, 2021

plus one for the merge commit.

Which merge commit?

The commit the merges the PR branch into the target branch. I tried to find reference for that in GH Actions docs but couldn't find it.

@targos
Copy link
Member

targos commented Oct 4, 2021

The commit the merges the PR branch into the target branch. I tried to find reference for that in GH Actions docs but couldn't find it.

What kind of message does that commit have? Do we skip its validation?

@Mesteery
Copy link
Contributor

Mesteery commented Oct 4, 2021

Btw, I don't understand how it can work on a push. pull_request.commits is only available on a pull request.

@targos
Copy link
Member

targos commented Oct 4, 2021

Btw, I don't understand how it can work on a push. pull_request.commits is only available on a pull request.

This workflow only runs on the pull_request event.

@Mesteery
Copy link
Contributor

Mesteery commented Oct 4, 2021

Okay, sorry, the beginning of the file was hidden. In this case I wonder if the plus one is necessary. Because if there is a merge commit, it would not be in the pull request

@aduh95
Copy link
Contributor Author

aduh95 commented Oct 4, 2021

Okay, sorry, the beginning of the file was hidden. In this case I wonder if the plus one is necessary. Because if there is a merge commit, it would not be in the pull request

It is necessary otherwise we dont validate the commit message of the first commit.

What kind of message does that commit have? Do we skip its validation?

Mary explains it better than me: #39121 (comment)

@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 30, 2021
@github-actions github-actions bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Oct 30, 2021
@github-actions
Copy link
Contributor

Commit Queue failed
- Loading data for nodejs/node/pull/39128
✔  Done loading data for nodejs/node/pull/39128
----------------------------------- PR info ------------------------------------
Title      tools: avoid fetch extra commits when validating commit messages (#39128)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     aduh95:commit-msg-linter -> nodejs:master
Labels     meta
Commits    2
 - tools: avoid fetch extra commits when validating commit messages
 - fixup! tools: avoid fetch extra commits when validating commit messages
Committers 1
 - Antoine du Hamel 
PR-URL: https://github.com/nodejs/node/pull/39128
Reviewed-By: Mary Marchini 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/39128
Reviewed-By: Mary Marchini 
--------------------------------------------------------------------------------
   ⚠  Commits were pushed since the last review:
   ⚠  - tools: avoid fetch extra commits when validating commit messages
   ⚠  - fixup! tools: avoid fetch extra commits when validating commit messages
   ℹ  This PR was created on Wed, 23 Jun 2021 14:59:58 GMT
   ✔  Approvals: 1
   ✔  - Mary Marchini (@mmarchini) (TSC): https://github.com/nodejs/node/pull/39128#pullrequestreview-769672595
   ✔  Last GitHub Actions successful
   ℹ  Green GitHub Actions CI is sufficient
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/1402622863

@aduh95 aduh95 merged commit b5aa08d into nodejs:master Oct 30, 2021
@aduh95 aduh95 deleted the commit-msg-linter branch October 30, 2021 15:45
@aduh95
Copy link
Contributor Author

aduh95 commented Oct 30, 2021

Landed in b5aa08d

aduh95 added a commit to nodejs/node-auto-test that referenced this pull request Oct 30, 2021
PR-URL: nodejs/node#39128
Reviewed-By: Mary Marchini <oss@mmarchini.me>
targos pushed a commit that referenced this pull request Nov 6, 2021
PR-URL: #39128
Reviewed-By: Mary Marchini <oss@mmarchini.me>
@targos targos mentioned this pull request Nov 8, 2021
BethGriggs pushed a commit that referenced this pull request Nov 25, 2021
PR-URL: #39128
Reviewed-By: Mary Marchini <oss@mmarchini.me>
@BethGriggs BethGriggs mentioned this pull request Nov 26, 2021
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commit-queue-failed An error occurred while landing this pull request using GitHub Actions. meta Issues and PRs related to the general management of the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants