Skip to content

Add code-review-skills documentation

fac1b71
Select commit
Loading
Failed to load commit list.
Draft

Allow loading external content during review #6086

Add code-review-skills documentation
fac1b71
Select commit
Loading
Failed to load commit list.
Community-TC Integration / bugbug lint failed May 28, 2026 in 8m 38s

Community-TC (pull_request)

bugbug lint

Details

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

Task Status

Started: 2026-05-28T17:23:10.429Z
Resolved: 2026-05-28T17:31:48.190Z
Task Execution Time: 8 minutes, 37 seconds, 761 milliseconds
Task Status: failed
Reason Resolved: failed
TaskId: T9JT099HSJaRcHJNk1lhQg
RunId: 0

Artifacts

- public/logs/live_backing.log
- public/logs/live.log


[taskcluster 2026-05-28T17:23:10.640Z] Worker Type (proj-bugbug/batch) settings:
[taskcluster 2026-05-28T17:23:10.640Z]   {
[taskcluster 2026-05-28T17:23:10.640Z]     "generic-worker": {
[taskcluster 2026-05-28T17:23:10.640Z]       "config": {
[taskcluster 2026-05-28T17:23:10.640Z]         "capacity": 1,
[taskcluster 2026-05-28T17:23:10.640Z]         "headlessTasks": false
[taskcluster 2026-05-28T17:23:10.640Z]       },
[taskcluster 2026-05-28T17:23:10.640Z]       "engine": "multiuser",
[taskcluster 2026-05-28T17:23:10.640Z]       "go-arch": "amd64",
[taskcluster 2026-05-28T17:23:10.640Z]       "go-os": "linux",
[taskcluster 2026-05-28T17:23:10.640Z]       "go-version": "go1.26.2",
[taskcluster 2026-05-28T17:23:10.640Z]       "release": "https://github.com/taskcluster/taskcluster/releases/tag/v100.0.1",
[taskcluster 2026-05-28T17:23:10.640Z]       "revision": "fcf9d8ed582ed8de3d1cdb8f4f91ccec93b7803c",
[taskcluster 2026-05-28T17:23:10.640Z]       "source": "https://github.com/taskcluster/taskcluster/commits/fcf9d8ed582ed8de3d1cdb8f4f91ccec93b7803c",
[taskcluster 2026-05-28T17:23:10.640Z]       "version": "100.0.1"
[taskcluster 2026-05-28T17:23:10.640Z]     },
[taskcluster 2026-05-28T17:23:10.640Z]     "image": "projects/community-tc-workers/global/images/generic-worker-ubuntu-24-04-bngpghpfficdxtlhnusi",
[taskcluster 2026-05-28T17:23:10.640Z]     "instance-id": "2550806712491034576",
[taskcluster 2026-05-28T17:23:10.640Z]     "instance-type": "projects/757942385826/machineTypes/n2-standard-2",
[taskcluster 2026-05-28T17:23:10.640Z]     "local-ipv4": "10.128.0.25",

...(9120 lines hidden)...

    |
523 | def test_strip_frontmatter_unterminated():
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `test_strip_frontmatter_unterminated` redefined here
524 |     text = "---\nname: mozilla\nstill no closing marker\n"
525 |     assert _strip_frontmatter(text) == text
    |
   ::: tests/test_code_review.py:326:5
    |
326 | def test_strip_frontmatter_unterminated():
    |     ----------------------------------- previous definition of `test_strip_frontmatter_unterminated` here
327 |     text = "---\nname: mozilla\nstill no closing marker\n"
328 |     assert _strip_frontmatter(text) == text
    |
help: Remove definition: `test_strip_frontmatter_unterminated`

Found 4 errors (1 fixed, 3 remaining).

ruff format..............................................................Failed
- hook id: ruff-format
- files were modified by this hook

warning: Selection `CPY` has no effect because preview is not enabled.
4 files reformatted, 241 files left unchanged

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..............................................................Failed
- hook id: mypy
- exit code: 1

scripts/build_repair_eval.py:178: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
scripts/retrieve_ci_failures.py:265: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
scripts/retrieve_ci_failures.py:366: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
bugbug/commit_features.py:902: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
bugbug/model.py:180: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
bugbug/model.py:182: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
tests/test_code_review.py:503: error: Name "_mock_client_returning" already defined on line 307  [no-redef]
tests/test_code_review.py:512: error: Name "test_strip_frontmatter_present" already defined on line 316  [no-redef]
tests/test_code_review.py:517: error: Name "test_strip_frontmatter_absent" already defined on line 321  [no-redef]
tests/test_code_review.py:522: error: Name "test_strip_frontmatter_unterminated" already defined on line 326  [no-redef]
Found 4 errors in 1 file (checked 187 source files)

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/bugbug/tools/code_review/data_types.py b/bugbug/tools/code_review/data_types.py
index 3b2c48e4..f16fc0f4 100644
--- a/bugbug/tools/code_review/data_types.py
+++ b/bugbug/tools/code_review/data_types.py
@@ -112,6 +112,7 @@ class LocalPatch(Patch):
         m3 = _DATE_RE.search(commit_message)
         if m3:
             from email.utils import parsedate_to_datetime
+
             try:
                 self._date = parsedate_to_datetime(m3.group(1))
             except Exception:
@@ -193,7 +194,9 @@ class ExternalContent(BaseModel):
 
     name: str = Field(description="A unique identifier for this content item.")
     url: str = Field(description="HTTPS URL of the file to fetch.")
-    description: str = Field(description="Short description of what this content provides.")
+    description: str = Field(
+        description="Short description of what this content provides."
+    )
 
     _cached_body: str | None = PrivateAttr(default=None)
 
diff --git a/bugbug/tools/code_review/prompts/first_message.md b/bugbug/tools/code_review/prompts/first_message.md
index 848897fb..a20a5cac 100644
--- a/bugbug/tools/code_review/prompts/first_message.md
+++ b/bugbug/tools/code_review/prompts/first_message.md
@@ -5,7 +5,6 @@ Here is a summary of the patch:
 </patch_summary>
 {external_context}
 
-
 Here are examples of good code review comments to guide your style and approach:
 
 <examples>
@@ -13,7 +12,6 @@ Here are examples of good code review comments to guide your style and approach:
 {approved_examples}
 </examples>
 
-
 Here is the patch you need to review:
 
 <patch>
diff --git a/bugbug/tools/code_review/skill_rules.py b/bugbug/tools/code_review/skill_rules.py
index aeb43c50..eba3365b 100644
--- a/bugbug/tools/code_review/skill_rules.py
+++ b/bugbug/tools/code_review/skill_rules.py
@@ -228,7 +228,11 @@ def collect_actions(
         }
 
     changed_files = parse_diff_files(diff)
-    logger.debug("Matching rules against %d changed file(s): %s", len(changed_files), changed_files)
+    logger.debug(
+        "Matching rules against %d changed file(s): %s",
+        len(changed_files),
+        changed_files,
+    )
 
     seen: set[tuple] = set()
     actions: list[dict] = []
@@ -246,7 +250,9 @@ def collect_actions(
             actions.append(action)
             new_actions.append(action)
         if new_actions:
-            logger.debug("Rule %r matched: %d action(s) queued", rule_name, len(new_actions))
+            logger.debug(
+                "Rule %r matched: %d action(s) queued", rule_name, len(new_actions)
+            )
 
     logger.debug("Total actions to execute: %d", len(actions))
     return actions
diff --git a/services/mcp/src/bugbug_mcp/server.py b/services/mcp/src/bugbug_mcp/server.py
index b0fe053e..5d513670 100644
--- a/services/mcp/src/bugbug_mcp/server.py
+++ b/services/mcp/src/bugbug_mcp/server.py
@@ -1,6 +1,7 @@
 """MCP server for Firefox Development."""
 
 import functools
+import json
 import logging
 import os
 from pathlib import Path
@@ -13,8 +14,6 @@ from fastmcp.exceptions import ToolError
 from fastmcp.resources import FileResource
 from pydantic import Field
 
-import json
-
 from bugbug.tools.code_review.data_types import LocalPatch
 from bugbug.tools.code_review.prompts import (
     EXTERNAL_CONTEXT_TEMPLATE,
@@ -101,7 +100,9 @@ async def _patch_review_impl(
             )
             external_context = EXTERNAL_CONTEXT_TEMPLATE.format(content=content)
 
-    initial_prompt = tool.generate_initial_prompt(patch, patch_summary, external_context)
+    initial_prompt = tool.generate_initial_prompt(
+        patch, patch_summary, external_context
+    )
     return system_prompt + "\n\n" + initial_prompt
 
 
diff --git a/tests/test_code_review.py b/tests/test_code_review.py
index ed112be0..27d5394c 100644
--- a/tests/test_code_review.py
+++ b/tests/test_code_review.py
@@ -493,7 +493,6 @@ def test_fetch_file_skips_revision_when_none():
     client.get_file_at_revision.assert_not_called()
 
 
-
 @pytest.fixture(autouse=True)
 def clear_rules_cache():
     skill_rules._rules_cache.clear()
@@ -864,7 +863,10 @@ actions = [{ type = "load_file", path = ".claude/skills/dom-media-v2.md" }]
     with patch.object(data_types, "get_http_client", return_value=client):
         with patch.object(skill_rules, "get_http_client", return_value=client):
             results = await load_external_content_for_diff(
-                _DIFF_MEDIA, rules_url, extra_rules_toml=extra, content_overrides=overrides
+                _DIFF_MEDIA,
+                rules_url,
+                extra_rules_toml=extra,
+                content_overrides=overrides,
             )
 
     assert len(results) == 1
[taskcluster 2026-05-28T17:31:45.205Z]                        Exit Code: 1
[taskcluster 2026-05-28T17:31:45.205Z]                        User Time: 154.306ms
[taskcluster 2026-05-28T17:31:45.205Z]                      Kernel Time: 171.912ms
[taskcluster 2026-05-28T17:31:45.205Z]                        Wall Time: 8m15.607715519s
[taskcluster 2026-05-28T17:31:45.205Z]  Average Available System Memory: 5.89 GiB
[taskcluster 2026-05-28T17:31:45.205Z]       Average System Memory Used: 1.86 GiB
[taskcluster 2026-05-28T17:31:45.205Z]          Peak System Memory Used: 2.90 GiB
[taskcluster 2026-05-28T17:31:45.205Z]              Total System Memory: 7.75 GiB
[taskcluster 2026-05-28T17:31:45.205Z]                           Result: FAILED
[taskcluster 2026-05-28T17:31:45.205Z] === Task Finished ===
[taskcluster 2026-05-28T17:31:45.205Z] Task Duration: 8m15.608273186s
[taskcluster:error] exit status 1