Skip to content

Introduce an ActionType enum instead of raw string action-type constants - #6825

Draft
theoniko wants to merge 1 commit into
mozilla:masterfrom
theoniko:fix-6626-introduce-ActionType-enum
Draft

theoniko wants to merge 1 commit into
mozilla:masterfrom
theoniko:fix-6626-introduce-ActionType-enum

Introduce an ActionType enum instead of raw string action-type constants

1884ecf
Select commit
Loading
Failed to load commit list.
Community-TC Integration / bugbug lint failed Sep 14, 2026 in 2m 1s

Community-TC (pull_request)

bugbug lint

Details

View task in Taskcluster | View logs in Taskcluster | View task group in Taskcluster

Task Status

Started: 2026-09-14T06:53:41.632Z
Resolved: 2026-09-14T06:55:42.065Z
Task Execution Time: 2 minutes, 433 milliseconds
Task Status: failed
Reason Resolved: failed
TaskId: Zwz4zc5fQW2ZV7mIe4UF0g
RunId: 0

Artifacts

- public/logs/live_backing.log (1.1 MB)
- public/logs/live.log


[taskcluster 2026-09-14T06:53:41.709Z] Worker Type (proj-bugbug/batch) settings:
[taskcluster 2026-09-14T06:53:41.709Z]   {
[taskcluster 2026-09-14T06:53:41.709Z]     "generic-worker": {
[taskcluster 2026-09-14T06:53:41.709Z]       "config": {
[taskcluster 2026-09-14T06:53:41.709Z]         "capacity": 1,
[taskcluster 2026-09-14T06:53:41.709Z]         "headlessTasks": false
[taskcluster 2026-09-14T06:53:41.709Z]       },
[taskcluster 2026-09-14T06:53:41.709Z]       "engine": "multiuser",
[taskcluster 2026-09-14T06:53:41.709Z]       "go-arch": "amd64",
[taskcluster 2026-09-14T06:53:41.709Z]       "go-os": "linux",
[taskcluster 2026-09-14T06:53:41.709Z]       "go-version": "go1.27.1",
[taskcluster 2026-09-14T06:53:41.709Z]       "release": "https://github.com/taskcluster/taskcluster/releases/tag/v108.1.0",
[taskcluster 2026-09-14T06:53:41.709Z]       "revision": "f86624a8bf3761cdbc48de2c7f74bae44d7464dd",
[taskcluster 2026-09-14T06:53:41.709Z]       "source": "https://github.com/taskcluster/taskcluster/commits/f86624a8bf3761cdbc48de2c7f74bae44d7464dd",
[taskcluster 2026-09-14T06:53:41.709Z]       "version": "108.1.0"
[taskcluster 2026-09-14T06:53:41.709Z]     },
[taskcluster 2026-09-14T06:53:41.709Z]     "image": "projects/taskcluster-imaging/global/images/generic-worker-ubuntu-24-04-9ed5a812d3d844ac9e4e",
[taskcluster 2026-09-14T06:53:41.709Z]     "instance-id": "6271571481261123461",
[taskcluster 2026-09-14T06:53:41.709Z]     "instance-type": "projects/757942385826/machineTypes/n2-standard-2",
[taskcluster 2026-09-14T06:53:41.709Z]     "local-ipv4": "10.128.0.32",

...(62 lines hidden)...

[INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier:prettier@3.1.0.
[INFO] Initializing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/codespell-project/codespell.
[INFO] Initializing environment for https://github.com/marco-c/taskcluster_yml_validator.
[INFO] Initializing environment for https://github.com/asottile/yesqa.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-mypy.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-mypy:types-pkg_resources==0.1.2,types-python-dateutil==2.9.0.20260807,types-PyYAML==6.0.12.20260815,types-orjson==3.6.2,types-tabulate==0.10.0.20260508,types-requests==2.33.0.20260712.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-mypy:types-pkg_resources==0.1.2,types-requests==2.33.0.20260712,types-Flask==1.1.6,types-redis==4.6.0.20241004,types-python-dateutil==2.9.0.20260807,types-orjson==3.6.2,types-tabulate==0.10.0.20260508.
[INFO] Installing environment for https://github.com/pre-commit/mirrors-prettier.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/codespell-project/codespell.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/marco-c/taskcluster_yml_validator.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/asottile/yesqa.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/mirrors-mypy.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/mirrors-mypy.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
prettier.................................................................Passed
ruff check...............................................................Failed
- hook id: ruff-check
- files were modified by this hook

warning: Selection `CPY` has no effect because preview is not enabled.
Found 5 errors (5 fixed, 0 remaining).

ruff format..............................................................Passed
check python ast.........................................................Passed
check docstring is first.................................................Passed
check that executables have shebangs.....................................Passed
check for merge conflicts................................................Passed
check for broken symlinks............................(no files to check)Skipped
debug statements (python)................................................Passed
trim trailing whitespace.................................................Passed
check yaml...............................................................Passed
mixed line ending........................................................Passed
python tests naming......................................................Passed
check json...............................................................Passed
check vcs permalinks.....................................................Passed
codespell................................................................Passed
taskcluster_yml..........................................................Passed
Strip unnecessary `# noqa`s..............................................Passed
mypy-bugbug..............................................................Passed
mypy-bugbug-http.........................................................Passed
Check for useless excludes...............................................Passed
pre-commit hook(s) made changes.
If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.
To run `pre-commit` as part of git workflow, use `pre-commit install`.
All changes made by hooks:
diff --git a/libs/hackbot-runtime/hackbot_runtime/actions/email.py b/libs/hackbot-runtime/hackbot_runtime/actions/email.py
index 0bbddeb5..42962342 100644
--- a/libs/hackbot-runtime/hackbot_runtime/actions/email.py
+++ b/libs/hackbot-runtime/hackbot_runtime/actions/email.py
@@ -24,7 +24,6 @@ from pydantic import Field
 from hackbot_runtime.actions.handlers.registry import ActionType
 from hackbot_runtime.actions.recorder import ActionsRecorder, confirmation
 
-
 ACTION_TYPE = ActionType.EMAIL_SEND.value
 
 # Substituted with the run's patch when the mail is sent. The agent decides
diff --git a/libs/hackbot-runtime/hackbot_runtime/actions/phabricator.py b/libs/hackbot-runtime/hackbot_runtime/actions/phabricator.py
index a39998d0..04b9a3ce 100644
--- a/libs/hackbot-runtime/hackbot_runtime/actions/phabricator.py
+++ b/libs/hackbot-runtime/hackbot_runtime/actions/phabricator.py
@@ -19,11 +19,9 @@ from typing import Annotated
 from agent_tools.registry import ToolError, tool, tools_in
 from pydantic import Field
 
-
 from hackbot_runtime.actions.handlers.registry import ActionType
 from hackbot_runtime.actions.recorder import ActionsRecorder, confirmation
 
-
 # Both patch actions submit the working directory's changes as a diff, so
 # anything gated on "this run submits a patch" — today the diff artifact built
 # in ``context.publish_changes`` — has to cover both types.
diff --git a/libs/hackbot-runtime/hackbot_runtime/actions/try_server.py b/libs/hackbot-runtime/hackbot_runtime/actions/try_server.py
index 4227c1fd..c7778bff 100644
--- a/libs/hackbot-runtime/hackbot_runtime/actions/try_server.py
+++ b/libs/hackbot-runtime/hackbot_runtime/actions/try_server.py
@@ -7,7 +7,6 @@ from typing import Annotated
 from agent_tools.registry import ToolError, tool, tools_in
 from pydantic import Field
 
-
 from hackbot_runtime.actions.handlers.registry import ActionType
 from hackbot_runtime.actions.recorder import ActionsRecorder, confirmation
 
diff --git a/services/hackbot-api/app/routers/runs.py b/services/hackbot-api/app/routers/runs.py
index fa2fca9c..ea6c81ce 100644
--- a/services/hackbot-api/app/routers/runs.py
+++ b/services/hackbot-api/app/routers/runs.py
@@ -10,7 +10,7 @@ from sqlalchemy import select
 from sqlalchemy.ext.asyncio import AsyncSession
 
 from app import gcs, jobs, pubsub
-from app.action_handlers.registry import ActionType, PATCH_ACTION_TYPES
+from app.action_handlers.registry import PATCH_ACTION_TYPES, ActionType
 from app.actions_applier import apply_all_pending
 from app.agents import AGENT_REGISTRY, AgentSpec, model_to_env
 from app.auth import require_api_key
diff --git a/services/hackbot-api/tests/test_phabricator_handler.py b/services/hackbot-api/tests/test_phabricator_handler.py
index 013a4c8c..3d0178db 100644
--- a/services/hackbot-api/tests/test_phabricator_handler.py
+++ b/services/hackbot-api/tests/test_phabricator_handler.py
@@ -12,7 +12,7 @@ from unittest.mock import AsyncMock
 
 import pytest
 from app.action_handlers import ApplyContext, phabricator_handler
-from app.action_handlers.registry import ActionType, PATCH_ACTION_TYPES, get_handler
+from app.action_handlers.registry import PATCH_ACTION_TYPES, ActionType, get_handler
 
 
 @pytest.fixture(autouse=True)
[taskcluster 2026-09-14T06:55:40.240Z]                        Exit Code: 1
[taskcluster 2026-09-14T06:55:40.240Z]                        User Time: 30.287ms
[taskcluster 2026-09-14T06:55:40.240Z]                      Kernel Time: 32.18ms
[taskcluster 2026-09-14T06:55:40.240Z]                        Wall Time: 1m35.211751551s
[taskcluster 2026-09-14T06:55:40.240Z]  Average Available System Memory: 6.22 GiB
[taskcluster 2026-09-14T06:55:40.240Z]       Average System Memory Used: 1.53 GiB
[taskcluster 2026-09-14T06:55:40.240Z]          Peak System Memory Used: 1.86 GiB
[taskcluster 2026-09-14T06:55:40.240Z]              Total System Memory: 7.75 GiB
[taskcluster 2026-09-14T06:55:40.240Z]                           Result: FAILED
[taskcluster 2026-09-14T06:55:40.242Z] === Task Finished ===
[taskcluster 2026-09-14T06:55:40.242Z] Task Duration: 1m35.213788696s
[taskcluster:error] exit status 1