build: lint commit message in separate Travis job#24254
build: lint commit message in separate Travis job#24254richardlau wants to merge 4 commits intonodejs:masterfrom
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).
|
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.
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 $RETThere was a problem hiding this comment.
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.
As in install == fetch from GitHub...
It will be a nicer UX, but will make the script more complex.
Your call.
| 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.
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 <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Matheus Marchini <[email protected]>
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 <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Matheus Marchini <[email protected]>
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 <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Matheus Marchini <[email protected]>
|
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 <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Matheus Marchini <[email protected]>
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 <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Matheus Marchini <[email protected]>




#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