-
Notifications
You must be signed in to change notification settings - Fork 30k
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
build: lint commit message in separate Travis job #24254
Conversation
Move the first commit message linting to a separate Travis job. Run the script in bash debug mode to capture any issues communicating with the GitHub API (e.g. network issues, rate limits).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this!
Just noticed that the following message from the script:
is now lost amongst all the debug output. Pushed a fixup! commit to add the guidelines URL to the |
|
I'm open to any suggestions to improve the user experience here. |
node_js: "node" | ||
script: | ||
- if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then | ||
bash -x tools/lint-pr-commit-message.sh ${TRAVIS_PULL_REQUEST}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you split this into install
& script
the install part will fold.
install:
- RET=0
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
bash -x tools/lint-pr-commit-message.sh ${TRAVIS_PULL_REQUEST} > out.txt
RET=$?
fi
export RET
script:
- cat out.txt || true
exit $RET
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redirecting stdout to file will lose coloring (okay not a major issue 😛). But if we do want to allow folding perhaps the thing to do is split the shell script so that the first part works out the first commit (this can be the install
(before_script
?) step) and then script
would directly run npx core-validate-commit ...
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in install
== fetch from GitHub
...
It will be a nicer UX, but will make the script more complex.
Your call.
@@ -5,6 +5,7 @@ os: linux | |||
matrix: | |||
include: | |||
- name: "First commit message adheres to guidelines at https://goo.gl/p2fr5Q" | |||
if: type = pull_request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😮
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work: @jrkong did a great job fixing travis-ci/travis-ci#10028 🏆 |
Apparently html is allowed in the job name, so I can make the https://goo.gl/p2fr5Q bit link directly to the guidelines: |
Landed in 19e5e78 |
Move the first commit message linting to a separate Travis job. Run the script in bash debug mode to capture any issues communicating with the GitHub API (e.g. network issues, rate limits). PR-URL: nodejs#24254 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Move the first commit message linting to a separate Travis job. Run the script in bash debug mode to capture any issues communicating with the GitHub API (e.g. network issues, rate limits). PR-URL: #24254 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Move the first commit message linting to a separate Travis job. Run the script in bash debug mode to capture any issues communicating with the GitHub API (e.g. network issues, rate limits). PR-URL: nodejs#24254 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me>
FTR: true positive https://travis-ci.com/nodejs/node/jobs/159274549 |
FTR: Here's one example where the rate limit is hit: https://travis-ci.com/nodejs/node/jobs/158565896#L447
I suggest we keep an eye out for if this becomes a more common occurrence. Note that the rate limit for unauthenticated GitHub API requests is IP based so it's whatever Travis is running on that IP (so may not be entirely our jobs). Authenticated GitHub API requests on Travis may be tricky to implement without exposing the token publicly. |
Seen in #24498 (comment) |
Move the first commit message linting to a separate Travis job. Run the script in bash debug mode to capture any issues communicating with the GitHub API (e.g. network issues, rate limits). PR-URL: #24254 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Move the first commit message linting to a separate Travis job. Run the script in bash debug mode to capture any issues communicating with the GitHub API (e.g. network issues, rate limits). PR-URL: #24254 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me>
#23739 changed the Travis Linter job so that it never fails if the first
commit message linting step fails. This was done in response to a
false positive which we speculate was perhaps due to hitting the
GitHub API rate limit or a network issue (#23739 (comment)).
This PR:
GitHub API (e.g. network issues, rate limits).
Checklist