Open Bug 1924899 Opened 1 year ago Updated 1 year ago

move functionality that inspects commits into the `Commit` object

Categories

(Conduit :: moz-phab, task, P3)

Tracking

(Not tracked)

People

(Reporter: sheehan, Assigned: sheehan)

Details

Attachments

(1 file)

Since we introduced the Commit object in moz-phab to replace tracking commits by dict, we have quite a few functions which take no parameters but a commit: Commit and return some value based on inspecting the object. We should move some of these functions into the Commit object directly.

In moz-phab submit we have some code which builds template variables
and passes them to arc_message to build a commit message for the
given commit. Since each of the fields used to build the commit message
are in the Commit object, we move this functionality into a
build_commit_message function on the Commit object.

build_commit_message requires revision_title_from_commit, but
since that function is also built entirely from Commit, we also
move it into the Commit object.

Since revision_title requires the WIP_RE regex object we move
it into commits.py, and since the only other consumer of that
regex is wip_in_commit_title, which is also entirely built from
attributes of a Commit, we also move wip_in_commit_title into
Commit. wip_in_commit_title is previously tested with raw strings,
so we update the test to build a Commit first instead.

I landed D225735, but there are still many more things that can be moved into the Commit object, especially in helpers.py. I will keep this bug open for now, we can fix more instances and add them to this bug or file new bugs against this one.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: