Closed Bug 1439654 Opened 6 years ago Closed 6 years ago

Return one diff author and prioritize it over the revision author when landing

Categories

(Conduit :: Lando, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: imadueme, Assigned: smacleod)

References

Details

(Keywords: conduit-story, conduit-triaged)

Lando-api currently returns several authors when clients request revision information:

1) The revision author (who actually did arc diff or used the UI to submit the revision).

2) The diff author(s) (the authors of each commit, if commits were used in making the revision).

Lando returns the revision and diff authors but always uses the revision author for landing (https://github.com/mozilla-conduit/lando-api/blob/8836e4efc4e033b5386f3ee976c88bdefb3d1fbe/landoapi/models/patch.py#L70), we should use the first diff author if it exists and if not use the revision author. We should prioritize the diff author since that will most likely have the user's LDAP email address. If we do this we can stop returning a list of authors in the revisions api and instead return just 1 revision and 1 diff author.

This change should also eliminate the need to sort anything which caused the bug found in https://bugzilla.mozilla.org/show_bug.cgi?id=1437686. In fact Phabricator directly publishes the diff commit author outside of local:commits:

"properties": {
		"arc.staging": {
			...
		},
		"local:commits": {
			...
		}
	},
	"authorName": "Mark Cote",
	"authorEmail": "mcote@mozilla.com"
}

In the future if there are multiple commit authors we can let clients choose which one they want to use, but that isn't part of this bug.
Keywords: conduit-story
Assignee: imadueme → nobody
While not strictly required for story Bug 1437601, without it landing will be broken for git users using arcanist. We should probably fix this up ASAP. Thoughts?
Flags: needinfo?(mcote)
We should focus on getting this in front of hg users first, just to actually see it working in production.  This should be fixed shortly after.
Flags: needinfo?(mcote)
I just want to clarify that this bug isn't about the hg/git difference, it's about sending the correct author to transplant (we currently always use the revision author when we could be using the more accurate diff author if present). It just so happens that the proposed fix also fixes the git crash. Because of this, I think this is required for story 3.
Story 4*
Oh, apparently this has become it's own story?
Yes.  Initial dogfooding (or, very limited release) will be hg only; I'd like to concentrate on that and then fix other little things.
Blocks: 1381602
Depends on: 1448122
Assignee: nobody → smacleod
(Also fixed by https://phabricator.services.mozilla.com/D819 )
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Blocks: 1449826
You need to log in before you can comment on or make changes to this bug.