Closed Bug 1646831 Opened 5 years ago Closed 5 years ago

Failed landing due to incorrect diff for empty files/lines.

Categories

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

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Sylvestre, Assigned: zalun)

References

Details

Attachments

(2 files)

when I tried to land: https://lando.services.mozilla.com/D80029/
As suggested on chat.m.o, pushing with "moz-phab submit --arc" with my issue!

As far as I can tell this is due to moz-phab setting null metadata on binary file add/removes.
moz-phab gives the following to a file add

        "metadata": {
          "old:binary-phid": null,
          "old:file:size": 0,
          "old:file:mime-type": "",
          "new:binary-phid": "PHID-FILE-tqeyupg2ofmkpsrprekv",
          "new:file:size": 112,
          "new:file:mime-type": "image/png"
        }

Whereas arcanist will only set the new: ones for adds, and vice-versa for file removes, like

        "metadata": {
          "new:file:size": 112,
          "new:file:mime-type": "image/png",
          "new:binary-phid": "PHID-FILE-wb3sdj7rvy5vgujjhoq2"
        }

https://phabricator.services.mozilla.com/D80026?vs=298461&id=298777#toc
This one shows a difference between the plain moz-phab and --arc diffs.
Seems like file ending. I'll investigate further tomorrow.

(In reply to Piotr Zalewa [:zalun] from comment #3)

https://phabricator.services.mozilla.com/D80026?vs=298461&id=298777#toc
This one shows a difference between the plain moz-phab and --arc diffs.
Seems like file ending. I'll investigate further tomorrow.

Can confirm the issue is indeed the empty files. moz-phab is giving them a hunk object, whereas arcanist doesn't.
Manual test with a duff hunk: https://phabricator-dev.allizom.org/D2122

From https://phabricator.services.mozilla.com/D80026
moz-phab (Diff 298461):

      {
        "id": "2687976",
        "metadata": {
          "hash.effect": "qVzKuHbdOl_L"
        },
        "oldPath": null,
        "currentPath": "third_party/python/pyflakes/pyflakes/scripts/__init__.py",
        "awayPaths": [],
        "oldProperties": [],
        "newProperties": {
          "unix:filemode": "100644"
        },
        "type": "1",
        "fileType": "1",
        "commitHash": null,
        "addLines": "0",
        "delLines": "0",
        "hunks": [
          {
            "oldOffset": "0",
            "newOffset": "1",
            "oldLength": "0",
            "newLength": "0",
            "addLines": null,
            "delLines": null,
            "isMissingOldNewline": null,
            "isMissingNewNewline": null,
            "corpus": ""
          }
        ]
      }

arcanist (Diff 298777):

      {
        "id": "2689840",
        "metadata": [],
        "oldPath": "third_party/python/pyflakes/pyflakes/scripts/__init__.py",
        "currentPath": "third_party/python/pyflakes/pyflakes/scripts/__init__.py",
        "awayPaths": [],
        "oldProperties": [],
        "newProperties": {
          "unix:filemode": "100644"
        },
        "type": "1",
        "fileType": "1",
        "commitHash": null,
        "addLines": "0",
        "delLines": "0",
        "hunks": []
      }
Assignee: nobody → pzalewa
Priority: -- → P1
Summary: lando: unexpected error was received from Phabricator" → Failed landing due to incorrect diff for empty files/lines.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
See Also: → 1648915

I am sorry but I didn't have them :/

Flags: needinfo?(sledru)
See Also: → 1650150
See Also: → 1680836
See Also: → 1766011
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: