Substitute action references in Bugzilla comments#6364
Draft
suhaibmujahid wants to merge 1 commit into
Draft
Conversation
The submit_patch tool documents referencing the applied revision via
{{actions.<ref>.url}}, but SubmitPatchHandler returned the URL under
'revision_url'. resolve_placeholders then found no 'url' field and left
the placeholder literal, so Bugzilla comments were posted with an
unsubstituted {{actions.patch.url}}.
Return the URL under 'url' to match the tool's documented contract and
the bugzilla handlers' convention.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6330
Problem
Hackbot posted Bugzilla comments with an unresolved action reference, e.g. bug 2033910 comment 6 shows:
The
{{actions.patch.url}}placeholder was posted literally instead of the revision URL.Root cause
The
submit_patchtool documents referencing the applied revision via{{actions.<ref>.url}}(see the docstrings inphabricator.pyandrecorder.py). ButSubmitPatchHandlerreturned the URL under the keyrevision_url, noturl.resolve_placeholdersthen found nourlfield 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' existingurlconvention. Updated the handler test and the placeholder-resolver tests that used the stalerevision_urlexample key.