Skip to content

tools: apply linting to first commit in PRs - #22452

Closed
Trott wants to merge 1 commit into
nodejs:masterfrom
Trott:travis-updates
Closed

tools: apply linting to first commit in PRs#22452
Trott wants to merge 1 commit into
nodejs:masterfrom
Trott:travis-updates

Conversation

@Trott

Copy link
Copy Markdown
Member

First commit:

tools: only use Travis-CI on master branch
Limit Travis-CI to the master branch. One benefit is that it will
simplify the logic for commit message linting.

Second commit:

tools: apply linting to first commit in PRs
Use Travis-CI to check the formatting of the first commit in a pull
request. This will hopefully reduce formatting errors and nits about
them in pull requests.
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@TrottTrott added the tools Issues and PRs related to the tools directory. label Aug 22, 2018
@Trott

Copy link
Copy Markdown
MemberAuthor

Aw yeah...

screen shot 2018-08-21 at 7 27 05 pm

Trott referenced this pull request Aug 22, 2018
`pad` is now using `toString(10)`, actually we don't need to do this. As for https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString, `toString(N)` is a radix converter, which isn't proper here for time conversion.
PR-URL: #21906
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Ruby <rubys@intertwingly.net>
@Trott

Copy link
Copy Markdown
MemberAuthor

Since this alters .travis.yml and nothing else, the pipeline job and the Travis run should be sufficient rather than a full CI.

@TrottTrott added the fast-track PRs that do not need to wait for 48 hours to land. label Aug 22, 2018
@Trott

This comment has been minimized.

@mscdex

mscdex commented Aug 22, 2018

Copy link
Copy Markdown
Contributor

Why only the first commit?

@Trott

Copy link
Copy Markdown
MemberAuthor

Why only the first commit?

Because subsequent commits are often autosquash commits and I don't want to discourage people from using that. Maybe in the very near future, if we can create a CLI flag for core-validate-commit that skips commits that start with squash! or fixup!, we can lint all the commits. /cc @evanlucas @nodejs/automation

@mscdex

Copy link
Copy Markdown
Contributor

Is there no way to have CI try to auto squash all of the commits first?

@Trott

Copy link
Copy Markdown
MemberAuthor

Is there no way to have CI try to auto squash all of the commits first?

Oooh, I do like that idea! The --autosquash flag is only honored for interactive rebases. There's no doubt some way to make interactive mode not need to be interactive (such as using expect although there are probably even easier ways) but I'm not sure I want to go down that potentially gotcha-ridden rabbit hole before landing this. I'd prefer this land as it is now, and then pursue that as a subsequent enhancement.

@targos

Copy link
Copy Markdown
Member

I would like to avoid the first commit if possible. As someone who works a lot with canary and release branches, having Travis run on them is very useful

@Trott

Trott commented Aug 22, 2018

Copy link
Copy Markdown
MemberAuthor

I would like to avoid the first commit if possible. As someone who works a lot with canary and release branches, having Travis run on them is very useful

OK. I wasn't aware that it was unusually valuable in that context. I'll see if I can figure something out after I sleep and attend the TSC meeting. :-D I'll remove the fast-track label and mark this as in progress. If someone knows how to make it work for everything, by all means, PR into the branch or commit right to it. Thanks.

@TrottTrott added wip Issues and PRs that are still a work in progress. and removed fast-track PRs that do not need to wait for 48 hours to land. labels Aug 22, 2018
@vsemozhetbytvsemozhetbyt added the meta Issues and PRs related to the general management of the project. label Aug 22, 2018
@refack

Copy link
Copy Markdown
Contributor

I would like to avoid the first commit if possible. As someone who works a lot with canary and release branches, having Travis run on them is very useful

This has been enabled only for PR on master, and with --no-validate-metadata, it might actually be useful even for release and canary branches. It's validates only the common sense rules:

f918801e0fd1b89531e9230c985cadea91914a6e
✔ 0:0 skipping fixes-url fixes-url
✔ 0:0 blank line after title line-after-title
✔ 0:0 line-lengths are valid line-length
✔ 0:0 valid subsystems subsystem
✔ 0:0 Title is formatted correctly. title-format
✔ 0:0 Title is <= 50 columns. title-length

Once we teach core-validate-commit to ignore commits that start with squash! or fixup! IMHO it could work for all commits (in PRs on master)

@targos

Copy link
Copy Markdown
Member

@refack my comment wasn't about core-validate-commit. What I care about is that Travis CI runs when commits are pushed to canary-base, v10.x-staging, v10.x, etc

Comment thread.travis.yml Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you add a before_install: stage:

before_install: npm i -g core-validate-commit

instead of the npx call.
I find this more readable (one less magic word in L18)

@refack

Copy link
Copy Markdown
Contributor

@refack my comment wasn't about core-validate-commit. What I care about is that Travis CI runs when commits are pushed to canary-base, v10.x-staging, v10.x, etc

Ahh the first commit of this PR, not the first commit rule 🤦‍♂️

@BridgeAR

Copy link
Copy Markdown
Member

Any progress here?

@Trott

Trott commented Sep 9, 2018

Copy link
Copy Markdown
MemberAuthor

Rebased/force-pushed to eliminate conflict.

Will get back to this soon, I think...

@Trott
Trottforce-pushed the travis-updates branch 3 times, most recently from 7bf5e39 to 0b7466dCompareOctober 5, 2018 13:31
Use Travis-CI to check the formatting of the first commit in a pull
request. This will hopefully reduce formatting errors and nits about
them in pull requests.
jasnell pushed a commit that referenced this pull request Oct 17, 2018
Use Travis-CI to check the formatting of the first commit in a pull
request. This will hopefully reduce formatting errors and nits about
them in pull requests.
PR-URL: #22452
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
refack added a commit to refack/node that referenced this pull request Nov 6, 2018
PR-URL: nodejs#23739Fixes: nodejs#23737
Refs: nodejs#22452
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
targos pushed a commit that referenced this pull request Nov 6, 2018
PR-URL: #23739Fixes: #23737
Refs: #22452
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
kiyomizumia pushed a commit to kiyomizumia/node that referenced this pull request Nov 15, 2018
PR-URL: nodejs#23739Fixes: nodejs#23737
Refs: nodejs#22452
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 26, 2018
Use Travis-CI to check the formatting of the first commit in a pull
request. This will hopefully reduce formatting errors and nits about
them in pull requests.
PR-URL: #22452
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
rvagg pushed a commit that referenced this pull request Nov 28, 2018
Use Travis-CI to check the formatting of the first commit in a pull
request. This will hopefully reduce formatting errors and nits about
them in pull requests.
PR-URL: #22452
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
codebytere pushed a commit that referenced this pull request Nov 29, 2018
PR-URL: #23739Fixes: #23737
Refs: #22452
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 29, 2018
PR-URL: #23739Fixes: #23737
Refs: #22452
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 3, 2018
PR-URL: #23739Fixes: #23737
Refs: #22452
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
@BethGriggsBethGriggs mentioned this pull request Dec 4, 2018
@Trott
Trott deleted the travis-updates branch January 13, 2022 22:50
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.metaIssues and PRs related to the general management of the project.toolsIssues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

15 participants

@Trott@nodejs-github-bot@mscdex@targos@refack@BridgeAR@richardlau@addaleax@styfle@joyeecheung@srl295@starkwang@trivikr@MylesBorins@vsemozhetbyt