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: only validate first commit message of a PR #40740

Merged
merged 2 commits into from
Nov 12, 2021

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Nov 6, 2021

The commit-lint job was introduced to encourage contributors to generate PRs that would be landable using the CQ IIRC.
Now that #40577 has introduced commit-queue-squash mechanism, having the commint-lint job lint all commit message defeats its purpose as it won't let the CQ land a PR if any of its commit do not conform to our guidelines – even though in the case of a squash, only the first commit message matters.

I'm suggesting validating only the first commit message, and discarding follow up commits in the validation.

I have thought about making the job label-aware, and if the PR has a commit-queue-rebase label validate all the commits: that might be more effort than what's worth, the CQ will refuse to land a PR if the commit message do not pass the validation anyway.

@aduh95 aduh95 requested a review from mmarchini November 6, 2021 09:23
@nodejs-github-bot nodejs-github-bot added the meta Issues and PRs related to the general management of the project. label Nov 6, 2021
.github/workflows/commit-lint.yml Outdated Show resolved Hide resolved
Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 9, 2021
@nodejs-github-bot nodejs-github-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 Nov 12, 2021
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/40740
✔  Done loading data for nodejs/node/pull/40740
----------------------------------- PR info ------------------------------------
Title      tools: only validate first commit message of a PR (#40740)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     aduh95:lint-only-first-commit-message -> nodejs:master
Labels     meta
Commits    2
 - tools: only validate first commit message of a PR
 - Update .github/workflows/commit-lint.yml
Committers 2
 - Antoine du Hamel 
 - GitHub 
PR-URL: https://github.com/nodejs/node/pull/40740
Reviewed-By: Michaël Zasso 
Reviewed-By: Luigi Pinca 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/40740
Reviewed-By: Michaël Zasso 
Reviewed-By: Luigi Pinca 
--------------------------------------------------------------------------------
   ⚠  Commits were pushed since the last review:
   ⚠  - Update .github/workflows/commit-lint.yml
   ℹ  This PR was created on Sat, 06 Nov 2021 09:23:07 GMT
   ✔  Approvals: 2
   ✔  - Michaël Zasso (@targos) (TSC): https://github.com/nodejs/node/pull/40740#pullrequestreview-799430947
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/40740#pullrequestreview-799469206
   ✔  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/1436426233

@aduh95 aduh95 added commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Nov 12, 2021
@nodejs-github-bot nodejs-github-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 Nov 12, 2021
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/40740
✔  Done loading data for nodejs/node/pull/40740
----------------------------------- PR info ------------------------------------
Title      tools: only validate first commit message of a PR (#40740)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     aduh95:lint-only-first-commit-message -> nodejs:master
Labels     meta, commit-queue-squash
Commits    2
 - tools: only validate first commit message of a PR
 - Update .github/workflows/commit-lint.yml
Committers 2
 - Antoine du Hamel 
 - GitHub 
PR-URL: https://github.com/nodejs/node/pull/40740
Reviewed-By: Michaël Zasso 
Reviewed-By: Luigi Pinca 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/40740
Reviewed-By: Michaël Zasso 
Reviewed-By: Luigi Pinca 
--------------------------------------------------------------------------------
   ⚠  Commits were pushed since the last review:
   ⚠  - Update .github/workflows/commit-lint.yml
   ℹ  This PR was created on Sat, 06 Nov 2021 09:23:07 GMT
   ✔  Approvals: 2
   ✔  - Michaël Zasso (@targos) (TSC): https://github.com/nodejs/node/pull/40740#pullrequestreview-799430947
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/40740#pullrequestreview-799469206
   ✔  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/1454898010

@aduh95 aduh95 merged commit 9cd3089 into nodejs:master Nov 12, 2021
@aduh95
Copy link
Contributor Author

aduh95 commented Nov 12, 2021

Landed in 9cd3089

@aduh95 aduh95 deleted the lint-only-first-commit-message branch November 12, 2021 22:35
targos pushed a commit that referenced this pull request Nov 21, 2021
PR-URL: #40740
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
danielleadams pushed a commit that referenced this pull request Jan 30, 2022
PR-URL: #40740
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
danielleadams pushed a commit that referenced this pull request Feb 1, 2022
PR-URL: #40740
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@danielleadams danielleadams mentioned this pull request Feb 1, 2022
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. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. 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