Closed Bug 1434430 Opened 7 years ago Closed 7 years ago

[flake8] Reviewbot uses different version of flake8 than the one pinned in-tree

Categories

(Developer Infrastructure :: Lint and Formatting, enhancement, P1)

3 Branch
enhancement

Tracking

(firefox60 fixed)

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: ahal, Assigned: ahal)

References

Details

Attachments

(3 files)

I'm filing a bug rather than a reviewbot issue because we should make however this happens impossible from the in-tree side. In https://bugzilla.mozilla.org/show_bug.cgi?id=1429457#c5 I discovered it was possible for |mach lint| to use a different version of flake8 than the one we pin in flake8_requirements.txt: https://searchfox.org/mozilla-central/source/tools/lint/python/flake8_requirements.txt I didn't think this was possible, as we activate the build system virtualenv, but I guess it's not guaranteed. We should figure out how the reviewbot sets things up and prevent it and others from using a newer version of flake8. As a short term fix, it's probably best to upgrade the in-tree flake8 to v3.5 to match reviewbot.
Oh, looks like if reviewbot has the FLAKE8 binary set, it could use a different version: https://searchfox.org/mozilla-central/source/tools/lint/python/flake8.py#98 We should definitely remove that either way.
See Also: → 1429457
Assignee: nobody → ahalberstadt
Status: NEW → ASSIGNED
Attachment #8947213 - Flags: review?(rwood)
Attachment #8947214 - Flags: review?(rwood)
Attachment #8947215 - Flags: review?(rwood)
Comment on attachment 8947213 [details] Bug 1434430 - [flake8] Drop support for the FLAKE8 environment variable https://reviewboard.mozilla.org/r/216970/#review223392
Attachment #8947213 - Flags: review?(rwood) → review+
Attachment #8947214 - Flags: review?(rwood) → review+
Comment on attachment 8947215 [details] Bug 1434430 - [flake8] Upgrade version of flake8 used by |mach lint| to 3.5.0 https://reviewboard.mozilla.org/r/216974/#review223406
Attachment #8947215 - Flags: review?(rwood) → review+
hg error in cmd: hg push -r tip ssh://hg.mozilla.org/integration/autoland: pushing to ssh://hg.mozilla.org/integration/autoland searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 3 changesets with 65 changes to 65 files remote: remote: remote: ************************** ERROR **************************** remote: Rev 9ba97262df76 uses try syntax. (Did you mean to push to Try instead?) remote: Andrew Halberstadt <ahalberstadt@mozilla.com> remote: Bug 1434430 - [flake8] Fix blank 'except' statements r=rwood remote: remote: This is a new issue that gets linted with flake8 3.5.0. Basically you should remote: never use: remote: remote: try: remote: ... stuff ... remote: except: remote: ... stuff ... remote: remote: This will catch all exceptions, including KeyboardInterrupt and SystemExit remote: (which is likely not intended). If a catch all is needed, use remote: `except: Exception`. If you *really* mean to also catch KeyboardInterrupt et remote: al, use `except: BaseException`. remote: remote: Of course, being specific is often better than a catch all. remote: remote: MozReview-Commit-ID: FKx80MLO4RN remote: ************************************************************* remote: remote: remote: transaction abort! remote: rollback completed remote: pretxnchangegroup.c_commitmessage hook failed abort: push failed on remote
Oh, lol. The push hook thought that the try: from my python code example was supposed to be try syntax.
Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6bd62fcb07d3 [flake8] Drop support for the FLAKE8 environment variable r=rwood https://hg.mozilla.org/integration/autoland/rev/2d0766c3e7c9 [flake8] Fix blank 'except' statements r=rwood https://hg.mozilla.org/integration/autoland/rev/0adf57868338 [flake8] Upgrade version of flake8 used by |mach lint| to 3.5.0 r=rwood
Priority: -- → P1
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
Product: Testing → Firefox Build System
Version: Version 3 → 3 Branch
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: