Closed Bug 1676540 Opened 4 years ago Closed 3 years ago

submit is broken when no commit in diffphid - IndexError: list index out of range

Categories

(Conduit :: moz-phab, defect, P2)

Production

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: florent, Assigned: florent)

References

(Regression)

Details

(Keywords: conduit-triaged)

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0

Steps to reproduce:

  • I created a commit to fix an issue.
  • Then, I used "moz-phab submit", it was successful and created the following phabricator entry:
    "https://phabricator.services.mozilla.com/D96210"
  • As there was lint errors, I tried to modify the diff directly from fabricator by using the "update diff" button.
  • The reviewer told me to resubmit with moz-phab as it looks like that there was no commit info with my diff.
  • So I did a:
    "hg commit --amend"
    "moz-phab submit"

Actual results:

The command failed with the following error "IndexError: list index out of range"

ERROR 2020-11-10 20:58:05,591 Traceback (most recent call last):
File "/home/florent/.virtualenvs/firefoxpy3/lib/python3.8/site-packages/mozphab/mozphab.py", line 83, in main
args.func(repo, args)
File "/home/florent/.virtualenvs/firefoxpy3/lib/python3.8/site-packages/mozphab/commands/submit.py", line 442, in submit
show_commit_stack(commits, wip=args.wip, validate=True, ignore_reviewers=args.wip)
File "/home/florent/.virtualenvs/firefoxpy3/lib/python3.8/site-packages/mozphab/commands/submit.py", line 198, in show_commit_stack
!= diffs[revision["fields"]["diffPHID"]]["attachments"][
IndexError: list index out of range

Expected results:

The command should have worked

Even if for different root cause, this issue is related to the following one:
https://bugzilla.mozilla.org/show_bug.cgi?id=1674310

In both cases the code fails at the same place for the same reason.

In my case, the "diff" created on phabricator will not create any "commit" associated with the new diff.
And so, when moz-phab look at the previous diff commit to see if the diff sha1 has changed, it crashes.

I have created a patch for this issue that I will push.

Assignee: nobody → florent.viard
Status: NEW → ASSIGNED
Blocks: remove-arc
See Also: → 1674310
Regressed by: 1481543
Keywords: conduit-triaged
Priority: -- → P2
Version: Development/Staging → Production

Fixed in 1.0.0rc1, see bug 1718540.

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
See Also: → 1718540
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: