Skip to content

reviewhelper: describe the patch stack to the review agent - #7662

Merged
cgsheeh merged 5 commits into
mozilla:masterfrom
cgsheeh:review-stack-prompt
Nov 28, 2026
Merged

cgsheeh merged 5 commits into
mozilla:masterfrom
cgsheeh:review-stack-prompt

Conversation

@cgsheeh

@cgsheeh cgsheeh commented Nov 25, 2026

Copy link
Copy Markdown
Member

Only expand_context applied the patch stack, so the agent checked stacked patches
against mozilla-central and flagged code added earlier in the stack as missing. The
first message now lists the patches before and after the reviewed one, with the files
the nearest ancestors touch, and the Searchfox tools warn that they do not see the
stack.

Refs #7350

Only `expand_context` applied the patch stack, so the agent checked stacked patches
against mozilla-central and flagged code added earlier in the stack as missing. The
first message now lists the patches before and after the reviewed one, with the files
the nearest ancestors touch, and the Searchfox tools warn that they do not see the
stack.

Refs mozilla#7350
@cgsheeh
cgsheeh requested a review from a team as a code owner November 25, 2026 15:33

@padenot padenot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make this async and parallel. I think the async client isn't amazing and creates a new object each time, so the ergonomics from the outside aren't amazing, but it's easily fixed.

As things stand, this will make sync requests for each revs and we don't want that.

One revision search per side of the stack and one diff query for the nearest
ancestors' files replace two calls per patch.
# Conflicts:
#	bugbug/tools/core/platforms/phabricator.py
Ancestors reuse the cached `get_stack_patches`, so they load concurrently and are
shared with `expand_context`. Descendants load with one revision search.
@community-tc-integration

Copy link
Copy Markdown
Uh oh! Looks like an error!

Taskcluster-GitHub attempted to create a task for this event with the following scopes:

["assume:repo:github.com/mozilla/ai-dev:pull-request","queue:route:checks","queue:scheduler-id:taskcluster-github"]

The expansion of these scopes is not sufficient to create the task, leading to the following:

Client ID static/taskcluster/github does not have sufficient scopes and is missing the following scopes:

{
  "AnyOf": [
    "queue:create-task:highest:proj-bugbug/batch",
    "queue:create-task:very-high:proj-bugbug/batch",
    "queue:create-task:high:proj-bugbug/batch",
    "queue:create-task:medium:proj-bugbug/batch",
    "queue:create-task:low:proj-bugbug/batch",
    "queue:create-task:very-low:proj-bugbug/batch",
    "queue:create-task:lowest:proj-bugbug/batch"
  ]
}

This request requires the client to satisfy the following scope expression:

{
  "AllOf": [
    "queue:route:checks",
    "queue:create-task:project:none",
    "queue:scheduler-id:taskcluster-github",
    {
      "AnyOf": [
        "queue:create-task:highest:proj-bugbug/batch",
        "queue:create-task:very-high:proj-bugbug/batch",
        "queue:create-task:high:proj-bugbug/batch",
        "queue:create-task:medium:proj-bugbug/batch",
        "queue:create-task:low:proj-bugbug/batch",
        "queue:create-task:very-low:proj-bugbug/batch",
        "queue:create-task:lowest:proj-bugbug/batch"
      ]
    }
  ]
}

  • method: createTask
  • errorCode: InsufficientScopes
  • statusCode: 403
  • time: 2026-11-28T00:32:56.698Z

@cgsheeh

cgsheeh commented Nov 28, 2026

Copy link
Copy Markdown
Member Author

Rebased onto the async-client changes after #7685. The stack now reuses get_stack_patches(), so the ancestors load concurrently and are shared with expand_context. The descendants' titles come from one async revision search, run alongside them. A single-revision stack makes no extra calls.

@cgsheeh
cgsheeh requested review from a team and padenot November 28, 2026 00:34

@suhaibmujahid suhaibmujahid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cgsheeh
cgsheeh merged commit af4ea46 into mozilla:master Nov 28, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants