Closed
Bug 1432627
Opened 7 years ago
Closed 7 years ago
Add shellcheck to CI
Categories
(Release Engineering :: General, enhancement)
Release Engineering
General
Tracking
(firefox60 fixed)
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox60 | --- | fixed |
People
(Reporter: sfraser, Assigned: sfraser)
References
Details
Attachments
(1 file)
Add an entry to taskcluster/ci/source-test/mozlint.yml for shellcheck.
shellcheck:
description: shellcheck run over gecko codebasecodebase
platform: lint/opt
treeherder:
symbol: #!
run:
mach: lint -l shellcheck -f treeherder
when:
files-changed:
- '**/*.sh'
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → sfraser
Comment hidden (mozreview-request) |
Comment 2•7 years ago
|
||
mozreview-review |
Comment on attachment 8946262 [details]
Bug 1432627 Add shellcheck linter to CI
https://reviewboard.mozilla.org/r/216212/#review222026
Thanks, this patch is good, I had basically created the exact same one. But when I pushed it to try, I noticed that we were hitting that "no JSON to decode" message a bunch. After improving the logging to also print the line, it seems that `-x` is not a valid option, for example:
https://treeherder.mozilla.org/logviewer.html#?job_id=159078722&repo=try&lineNumber=249
Maybe the `shellcheck` binary that is being installed via `apt-get` is an old version that doesn't have `-x` yet? We might need to use `pip` to install it instead.
Attachment #8946262 -
Flags: review?(ahalberstadt) → review-
Assignee | ||
Comment 3•7 years ago
|
||
shellcheck isn't a python module, sadly. It does look like '-x' is relatively new, so we can take that option out and add an exclusion for the errors that it now produces. I'll update the commit and re-submit for review.
Comment hidden (mozreview-request) |
Comment 5•7 years ago
|
||
mozreview-review |
Comment on attachment 8946262 [details]
Bug 1432627 Add shellcheck linter to CI
https://reviewboard.mozilla.org/r/216212/#review222040
Static analysis found 1 defect in this patch.
- 1 defect found by mozlint
You can run this analysis locally with:
- `./mach lint check path/to/file` (Python/Javascript/wpt)
If you see a problem in this automated review, please report it here: http://bit.ly/2y9N9Vx
::: tools/lint/shell/__init__.py:158
(Diff revision 2)
>
> config['root'] = lintargs['root']
>
> files = find_shell_scripts(config, paths)
>
> - base_command = [binary, '-x', '-f', 'json']
> + base_command = [binary,'-f', 'json']
Error: missing whitespace after ',' [flake8: E231]
Assignee | ||
Comment 6•7 years ago
|
||
hooray for the reviewbot!
Comment hidden (mozreview-request) |
Comment 8•7 years ago
|
||
mozreview-review |
Comment on attachment 8946262 [details]
Bug 1432627 Add shellcheck linter to CI
https://reviewboard.mozilla.org/r/216212/#review222044
Thanks, looks good!
Attachment #8946262 -
Flags: review?(ahalberstadt) → review+
Pushed by sfraser@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/85794e045326
Add shellcheck linter to CI r=ahal
Assignee | ||
Comment 10•7 years ago
|
||
It seems the earlier version of shellcheck has other issues, I will fix in the morning
Comment 11•7 years ago
|
||
Backed out changeset 85794e045326 (bug 1432627) for shell lint failure in /builds/worker/checkouts/gecko/taskcluster/docker/firefox-snap/runme.sh:50:95
Push with failure https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=85794e0453268ccd39826fc4118840835c228b39&filter-classifiedState=unclassified&filter-resultStatus=testfailed&filter-resultStatus=busted&filter-resultStatus=exception&filter-resultStatus=runnable&selectedJob=159086890
Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=159086890&repo=autoland&lineNumber=247
Backout: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=440d56e5707486c1ff343008c27cb94faf50bef4&filter-classifiedState=unclassified&filter-resultStatus=testfailed&filter-resultStatus=busted&filter-resultStatus=exception&filter-resultStatus=runnable
Flags: needinfo?(sfraser)
Comment hidden (mozreview-request) |
Assignee | ||
Comment 13•7 years ago
|
||
Apologies for the repeated review requests - I've run this one under debian stretch, and it's come back clean.
Flags: needinfo?(sfraser)
Comment 14•7 years ago
|
||
No worries, mozreview actually carries r+'s forward, so unless you reset the flag in bugzilla, I won't get a new review request. If it's a small fix (like in this case), I think it's fine for authors to re-land without re-review. Though in this case I did glance at your changes and it looks fine :).
One tip I like to use for testing lint tasks is running:
./mach try empty
This will schedule the relevant lint tasks (though nothing else) on try.
Comment hidden (mozreview-request) |
Assignee | ||
Comment 16•7 years ago
|
||
That's good info, thank you!
Comment 17•7 years ago
|
||
We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again.
hg error in cmd: hg rebase -s b45a7cffc880bb6fc0b098337d882e83d0926c0b -d 4a70ce5756cc: rebasing 444632:b45a7cffc880 "Bug 1432627 Add shellcheck linter to CI, adjust shellcheck directives for 0.4.4 r=ahal" (tip)
other [source] changed taskcluster/docker/recipes/centos6-build-system-setup.sh which local [dest] deleted
use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
merging taskcluster/ci/source-test/mozlint.yml
merging taskcluster/docker/image_builder/build-image.sh
merging tools/lint/shell/__init__.py
merging tools/lint/shellcheck.yml
unresolved conflicts (see hg resolve, then hg rebase --continue)
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 20•7 years ago
|
||
Pushed by sfraser@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/74a58d59187b
Add shellcheck linter to CI r=ahal
Comment 21•7 years ago
|
||
bugherder |
You need to log in
before you can comment on or make changes to this bug.
Description
•