Skip to content

Substitute action references in Bugzilla comments#6364

Open
suhaibmujahid wants to merge 2 commits into
mozilla:masterfrom
suhaibmujahid:worktree-fix-6330-action-ref-substitution
Open

Substitute action references in Bugzilla comments#6364
suhaibmujahid wants to merge 2 commits into
mozilla:masterfrom
suhaibmujahid:worktree-fix-6330-action-ref-substitution

Conversation

@suhaibmujahid

Copy link
Copy Markdown
Member

Fixes #6330

Problem

Hackbot posted Bugzilla comments with an unresolved action reference, e.g. bug 2033910 comment 6 shows:

Submitted a patch implementing the agreed approach (comment #5): D-patch.

The {{actions.patch.url}} placeholder was posted literally instead of the revision URL.

Root cause

The submit_patch tool documents referencing the applied revision via {{actions.<ref>.url}} (see the docstrings in phabricator.py and recorder.py). But SubmitPatchHandler returned the URL under the key revision_url, not url. resolve_placeholders then found no url field on the result and, by design, left the placeholder untouched rather than raising, so the literal text was posted.

Fix

Return the revision URL under url, matching the tool's documented contract and the Bugzilla handlers' existing url convention. Updated the handler test and the placeholder-resolver tests that used the stale revision_url example key.

@suhaibmujahid
suhaibmujahid force-pushed the worktree-fix-6330-action-ref-substitution branch from dcca270 to 99038ff Compare July 23, 2026 20:23
@suhaibmujahid
suhaibmujahid marked this pull request as ready for review July 23, 2026 20:23
@suhaibmujahid
suhaibmujahid requested a review from a team as a code owner July 23, 2026 20:23
Copilot AI review requested due to automatic review settings July 23, 2026 20:23
@suhaibmujahid
suhaibmujahid enabled auto-merge (rebase) July 23, 2026 20:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Fixes unresolved {{actions.<ref>.url}} placeholders appearing literally in posted Bugzilla comments by aligning the submit_patch handler result contract with the documented url field and improving visibility when placeholders can’t be resolved.

Changes:

  • Change SubmitPatchHandler to return the revision URL under url (instead of revision_url) and update its test accordingly.
  • Update placeholder resolver tests to use {{actions.<ref>.url}} and assert unresolved placeholders are logged.
  • Enhance resolve_placeholders to log when a placeholder can’t be resolved (missing ref / missing field).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
services/hackbot-api/tests/test_actions_applier.py Updates placeholder examples to url and adds caplog assertions for unresolved placeholders.
services/hackbot-api/app/actions_applier.py Adds logging for unresolved placeholders during substitution.
libs/hackbot-runtime/tests/test_phabricator_handler.py Updates expected SubmitPatchHandler result key from revision_url to url.
libs/hackbot-runtime/hackbot_runtime/actions/handlers/phabricator_handler.py Returns revision URL under url to match the documented placeholder contract.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread services/hackbot-api/app/actions_applier.py
Upstream mozilla#6334 added a `url` key to the SubmitPatchHandler result (the key
the submit_patch tool documents for `{{actions.<ref>.url}}`), leaving
`revision_url` as a duplicate that nothing consumes. Drop it so the result
exposes a single canonical `url`.
resolve_placeholders leaves an unresolved {{actions.<ref>.<field>}} as-is
by design, but until now did so silently, so a literal placeholder posted
to a comment went unnoticed. Log a warning naming the missing ref or field
so it surfaces in the run logs.
@suhaibmujahid
suhaibmujahid force-pushed the worktree-fix-6330-action-ref-substitution branch from 1be7199 to 5cd422f Compare July 23, 2026 21:13
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.

Hackbot does not substitute action references when commenting on Bugzilla.

2 participants