Skip to content

Commit

Permalink
enforce yarn.lock deduplication via linter
Browse files Browse the repository at this point in the history
refs DE-397

When upgrading packages through yarn, the yarn.lock file tends to become bloated with multiple versions of the same packages, even if the latest version is compatible with all of them. Enforcing the yarn deduplicator allows us to keep the file as tidy as possible.

Test Plan:
1. Ensure that the linter passes when the file is properly deduped.
2. Ensure that the linter fails when the file needs to be deduped.

Change-Id: Ib606f7ab2c40dcb29bec7ba1c8cb7af2c8611f97
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/256675
Tested-by: Service Cloud Jenkins <[email protected]>
Reviewed-by: Ahmad Amireh <[email protected]>
QA-Review: Aaron Ogata <[email protected]>
Product-Review: Aaron Ogata <[email protected]>
  • Loading branch information
aogata-inst committed Jan 13, 2021
1 parent 149f477 commit a20e69e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build/new-jenkins/linters/run-gergich.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ if ! git diff --exit-code yarn.lock; then
gergich comment "{\"path\":\"yarn.lock\",\"position\":1,\"severity\":\"error\",\"message\":\"\$message\"}"
fi
./build/new-jenkins/linters/run-and-collect-output.sh "yarn dedupe-yarn"
if ! git diff --exit-code yarn.lock; then
message="yarn.lock changes need to be de-duplicated. Make sure you run 'yarn dedupe-yarn'."
gergich comment "{\"path\":\"yarn.lock\",\"position\":1,\"severity\":\"error\",\"message\":\"\$message\"}"
fi
gergich status
echo "YARN_LOCK OK!"
EOF
Expand Down

0 comments on commit a20e69e

Please sign in to comment.