Closed Bug 1487425 Opened 6 years ago Closed 6 years ago

AttributeError: 'dict' object has no attribute 'failed' when pushing / committing / ...

Categories

(Developer Infrastructure :: Lint and Formatting, defect)

defect
Not set
normal

Tracking

(firefox-esr60 unaffected, firefox61 unaffected, firefox62 unaffected, firefox63 fixed)

RESOLVED FIXED
mozilla63
Tracking Status
firefox-esr60 --- unaffected
firefox61 --- unaffected
firefox62 --- unaffected
firefox63 --- fixed

People

(Reporter: Gijs, Assigned: ahal)

References

Details

(Keywords: regression)

Attachments

(1 file)

full output:

$ hg push-to-try -m "Bug 1486824 - try: -b od -t none -p win64,macosx64,linux64,linux -u mochitest-bc --artifact "
Creating temporary commit for remote...
warning: no files linted
Error running mach:

    ['lint', '--quiet', '--workdir=staged']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.

You should consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

AttributeError: 'dict' object has no attribute 'failed'

  File "tools/lint/mach_commands.py", line 44, in lint
    return cli.run(*runargs, **lintargs)
  File "python/mozlint/mozlint/cli.py", line 184, in run
    out = formatter(result).encode(sys.stdout.encoding or 'ascii', 'replace')
  File "python/mozlint/mozlint/formatters/stylish.py", line 55, in __call__
    failed = result.failed


This has been happening for a while now, and successive updates of m-c have somehow not fixed it, so here's a bug report...

Feels like the lack of files to lint means that the result object is empty and the formatter doesn't know how to deal with this.
Oh, and I have:

pretxncommit.lint = python:path/to/m-c/tools/lint/hooks.py:hg


defined in .hg/hgrc on the trees where this happens. But happens on both my Windows and mac machines...
Sorry about that, this is a regression from bug 1460856.
Assignee: nobody → ahal
Blocks: 1460856
Status: NEW → ASSIGNED
Comment on attachment 9005607 [details]
Bug 1487425 - [mozlint] Fix regression where 'roll' returns dict instead of ResultSummary when no files linted, r=gijs

:Gijs (he/him) has approved the revision.
Attachment #9005607 - Flags: review+
Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/56d916d0bfb1
[mozlint] Fix regression where 'roll' returns dict instead of ResultSummary when no files linted, r=Gijs
Somewhat related, we should try to get the `push-to-try` extension to skip the lint check when committing the temporary commit. There will never be a dirty working directory anyway (as |mach try| would have errored out if before this point if there were).
https://hg.mozilla.org/mozilla-central/rev/56d916d0bfb1
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
(In reply to Andrew Halberstadt [:ahal] from comment #6)
> Somewhat related, we should try to get the `push-to-try` extension to skip
> the lint check when committing the temporary commit. There will never be a
> dirty working directory anyway (as |mach try| would have errored out if
> before this point if there were).

I still use `hg push-to-try` directly, also with a dirty working dir (which then gets temp-committed). This is particularly useful for things like sec bugs, where I don't want to publish the original commit or bug number. Instead I `hg up` to a known good other bug, `hg diff -c <sec-bug-rev> | patch`, and then push-to-try .

Really what we need is a confidential copy of tryserver, but that's been on the wishlist for 5 years and has never happened, so I'm not holding my breath. In the meantime, if we could not break this type of usecase, that'd be great...
(In reply to :Gijs (he/him) from comment #8)
> I still use `hg push-to-try` directly, also with a dirty working dir (which
> then gets temp-committed). This is particularly useful for things like sec
> bugs, where I don't want to publish the original commit or bug number.
> Instead I `hg up` to a known good other bug, `hg diff -c <sec-bug-rev> |
> patch`, and then push-to-try .
> 
> Really what we need is a confidential copy of tryserver, but that's been on
> the wishlist for 5 years and has never happened, so I'm not holding my
> breath. In the meantime, if we could not break this type of usecase, that'd
> be great...

Wfm, didn't realize anyone was using `hg push-to-try` directly. If it helps, we could add a --force flag to |mach try| to skip the uncommitted changes check. It's entirely superficial.
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: