abort: REST error on PUT to https://bugzilla.mozilla.org/rest/bug/1121247: Not a HASH reference at /data/www/bugzilla.mozilla.org/Bugzilla/Bug.pm line 2466

RESOLVED FIXED

Status

Developer Services
Mercurial: bzexport
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: gps, Assigned: gps)

Tracking

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Assignee)

Description

3 years ago
The bzexport rewrite work in bug 1033394 regressed behavior when updating the assignee of a bug.

We have some tests for setting the assignee. But code coverage reveals the error we see is occurring on a line we don't have test coverage for. This should be relatively easy to tease out.

$ hg bzexport -e --traceback
saved edited form in ../../.hg/last_bzexport.txt
Requesting review from sphink@gmail.com
. uploaded as https://bugzilla.mozilla.org/attachment.cgi?id=8548520&action=edit
Traceback (most recent call last):
  File "/Users/gps/lib/python2.7/site-packages/mercurial/dispatch.py", line 140, in _runcatch
    return _dispatch(req)
  File "/Users/gps/lib/python2.7/site-packages/mercurial/dispatch.py", line 850, in _dispatch
    cmdpats, cmdoptions)
  File "/Users/gps/lib/python2.7/site-packages/mercurial/dispatch.py", line 611, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/Users/gps/lib/python2.7/site-packages/mercurial/extensions.py", line 196, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/Users/gps/lib/python2.7/site-packages/hgext/pager.py", line 158, in pagecmd
    return orig(ui, options, cmd, cmdfunc)
  File "/Users/gps/lib/python2.7/site-packages/mercurial/extensions.py", line 196, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/Users/gps/lib/python2.7/site-packages/hgext/color.py", line 491, in colorcmd
    return orig(ui_, opts, cmd, cmdfunc)
  File "/Users/gps/lib/python2.7/site-packages/mercurial/dispatch.py", line 941, in _runcommand
    return checkargs()
  File "/Users/gps/lib/python2.7/site-packages/mercurial/dispatch.py", line 912, in checkargs
    return cmdfunc()
  File "/Users/gps/lib/python2.7/site-packages/mercurial/dispatch.py", line 847, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/Users/gps/lib/python2.7/site-packages/mercurial/util.py", line 702, in check
    return func(*args, **kwargs)
  File "/Users/gps/lib/python2.7/site-packages/mercurial/extensions.py", line 151, in wrap
    util.checksignature(origfn), *args, **kwargs)
  File "/Users/gps/lib/python2.7/site-packages/mercurial/util.py", line 702, in check
    return func(*args, **kwargs)
  File "/Users/gps/lib/python2.7/site-packages/hgext/mq.py", line 3483, in mqcommand
    return orig(ui, repo, *args, **kwargs)
  File "/Users/gps/lib/python2.7/site-packages/mercurial/util.py", line 702, in check
    return func(*args, **kwargs)
  File "/Users/gps/src/hgcustom/version-control-tools/hgext/bzexport/__init__.py", line 1091, in bzexport
    raise util.Abort(e.message)
Abort: REST error on PUT to https://bugzilla.mozilla.org/rest/bug/1121247: Not a HASH reference at /data/www/bugzilla.mozilla.org/Bugzilla/Bug.pm line 2466.

abort: REST error on PUT to https://bugzilla.mozilla.org/rest/bug/1121247: Not a HASH reference at /data/www/bugzilla.mozilla.org/Bugzilla/Bug.pm line 2466.
(Assignee)

Comment 1

3 years ago
Created attachment 8548534 [details] [diff] [review]
bzexport: test reassigning a bug

This added test demonstrates a bug when reassigning a bug to a new user.
Attachment #8548534 - Flags: review?(sphink)
(Assignee)

Comment 2

3 years ago
Created attachment 8548535 [details] [diff] [review]
bzexport: send proper parameters when updating bugs

We were previously attempting to send the full bug data structure when
updating a bug as part of reassigning it. Bugzilla didn't like this.
We change our approach to only define the fields that we explicitly wish
to update.
Attachment #8548535 - Flags: review?(sphink)
(Assignee)

Updated

3 years ago
Assignee: nobody → gps
Status: NEW → ASSIGNED
(Assignee)

Comment 3

3 years ago
The cool part about this bug is that I doubly verified the fix as part of uploading the attachment that fixed it :)
Attachment #8548535 - Flags: review?(sphink) → review+
Comment on attachment 8548534 [details] [diff] [review]
bzexport: test reassigning a bug

Review of attachment 8548534 [details] [diff] [review]:
-----------------------------------------------------------------

Good other than the hardcoded IP. Thanks!
Attachment #8548534 - Flags: review?(sphink) → review+
(Assignee)

Comment 5

3 years ago
Created attachment 8548540 [details] [diff] [review]
bzexport: test reassigning a bug

This added test demonstrates a bug when reassigning a bug to a new user.
Attachment #8548540 - Flags: review?(sphink)
(Assignee)

Updated

3 years ago
Attachment #8548534 - Attachment is obsolete: true
(Assignee)

Comment 6

3 years ago
https://hg.mozilla.org/hgcustom/version-control-tools/rev/fcc5bb1b97a1
https://hg.mozilla.org/hgcustom/version-control-tools/rev/711ac7644396
(Assignee)

Comment 7

3 years ago
Comment on attachment 8548540 [details] [diff] [review]
bzexport: test reassigning a bug

I uploaded the new patch when sfink was reviewing the old one. Boo, race conditions.
Attachment #8548540 - Flags: review?(sphink) → review+
(Assignee)

Comment 8

3 years ago
Thanks for the quick review!
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.