Closed Bug 1809946 Opened 2 years ago Closed 2 years ago

make `moz-phab reorg` use `stackGraph` instead of calls to `edge.search`

Categories

(Conduit :: moz-phab, enhancement)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sheehan, Assigned: sheehan)

References

Details

Attachments

(6 files)

moz-phab reorg queries the edge.search endpoint multiple times to determine the state of the stack graph on Phabricator.

Since bug 1787517 we have had this information available in the differential.revision.search response. We should parse that information to reduce the number of API calls to Phabricator during moz-phab reorg.

Phabricator now includes a stackGraph field in its responses
to differential.revision.search Conduit API calls. Update
moz-phab reorg to use this data instead of calling edge.search
many times in succession.

Add a validate_stackgraph_linear function that converts the
data from the Phabricator format into a linear linked list
representing the graph. Update tests to mock this new function
and add tests for the new function. Remove get_stack from
conduit.py as it is unused after this change.

Depends on D166716

Remove an unnecessary if statement that only executes a no-op
assignment when the condition is true. Also rename variables to
more useful names.

Depends on D166717

Create proper variable names for lists being looped over.
Also re-use one loop as its value is never modified and
the same loop is created twice unnecessarily.

Depends on D166718

Attachment #9312045 - Attachment description: reorg: add some variable names for all these lists we're looping over (Bug 1809946) r?grammar,zeid → reorg: add some variable names for lists in various loops (Bug 1809946) r?grammar,zeid
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
See Also: → 1925717
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: