Fail fast and hard on changelog violations on Travis

Open Beginner friendly
#484 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
ci-cd

Research direction

Start with the Travis configuration and inspect the existing script block, changelog-lint command, and npm test command. Move changelog validation earlier in the Travis lifecycle for Node versions 4 and newer, then verify that invalid changelogs fail before the test suite while other builds still run as expected.

Written by the indexing model from the issue text.

Description

component: code quality

Ref: https://github.com/mozilla/web-ext/pull/483#issuecomment-246828045


Since we fail PRs on invalid commit messages, we may want to see if we can do that near the top of the script block so we fail fast and hard. I think my builds took 2.5 and 6 minutes before failing, since they had to run all the tests and other stuff first.

Not sure if it's as easy as reversing the order, or if we want to use the before_script hook, per https://docs.travis-ci.com/user/customizing-the-build#The-Build-Lifecycle

before_script:
# Run changelog-lint but only on newer versions of Node (because of syntax errors)
- if [[ ${TRAVIS_NODE_VERSION:0:1} -ge "4" ]]; then
    npm run changelog-lint;
  fi

script:
- COVERAGE=y npm test
Dominant language
JavaScript
Stars
3.1k
Forks
386
Avg merge
8h
Merged PRs (30d)
19

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mozilla/web-ext

All issues in mozilla/web-ext

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.