|
21 | 21 |
|
22 | 22 | from hackbot_runtime.actions.recorder import ActionsRecorder, confirmation |
23 | 23 |
|
| 24 | +SUBMIT_PATCH_ACTION_TYPE = "phabricator.submit_patch" |
| 25 | +UPDATE_PATCH_ACTION_TYPE = "phabricator.update_patch" |
| 26 | + |
24 | 27 | # Both patch actions submit the working directory's changes as a diff, so |
25 | 28 | # anything gated on "this run submits a patch" — today the diff artifact built |
26 | 29 | # in ``context.publish_changes`` — has to cover both types. |
27 | | -PATCH_ACTION_TYPES = frozenset({"phabricator.submit_patch", "phabricator.update_patch"}) |
| 30 | +PATCH_ACTION_TYPES = frozenset({SUBMIT_PATCH_ACTION_TYPE, UPDATE_PATCH_ACTION_TYPE}) |
28 | 31 |
|
29 | 32 | _PHABRICATOR_TEST_PLAN_HEADER_RE = re.compile( |
30 | 33 | r"^(?:Test Plan|Testplan|Tested|Tests):", |
@@ -126,7 +129,7 @@ async def submit_patch( |
126 | 129 | if parent_revision_id is not None: |
127 | 130 | params["parent_revision_id"] = parent_revision_id |
128 | 131 | action = recorder.record( |
129 | | - "phabricator.submit_patch", params, reasoning=reasoning, ref=ref |
| 132 | + SUBMIT_PATCH_ACTION_TYPE, params, reasoning=reasoning, ref=ref |
130 | 133 | ) |
131 | 134 | return confirmation(action) |
132 | 135 |
|
@@ -164,7 +167,7 @@ async def update_patch( |
164 | 167 | association exactly as they are. |
165 | 168 | """ |
166 | 169 | action = recorder.record( |
167 | | - "phabricator.update_patch", |
| 170 | + UPDATE_PATCH_ACTION_TYPE, |
168 | 171 | {"revision_id": revision_id}, |
169 | 172 | reasoning=reasoning, |
170 | 173 | ) |
|
0 commit comments