Page MenuHomePhabricator

gerritbot doesnt escape sequences from commitmsg
Closed, ResolvedPublic

Description

If __version__ is in a comment message, gerritbot adds __version__ to the phab post, which is rendered as underlined 'version': version .

Example: T73788#1133938

Raw markdown

Change 192082 merged by jenkins-bot:
[FEAT] version: actually interpret the __version__

[[https://gerrit.wikimedia.org/r/192082]]

Rendering

Change 192082 merged by jenkins-bot:
[FEAT] version: actually interpret the version

https://gerrit.wikimedia.org/r/192082

Event Timeline

jayvdb raised the priority of this task from to Needs Triage.
jayvdb updated the task description. (Show Details)
jayvdb added a project: Gerrit.
jayvdb added a subscriber: jayvdb.
jayvdb set Security to None.
Aklapper triaged this task as Lowest priority.Mar 20 2015, 11:32 AM

Looks like we can use Phabricator Literal Blocks using %%%:

Raw markdown

%%%> Text that won't be processed by remarkup
> [[http://www.example.com | example]]
%%%

Rendering

> Text that won't be processed by remarkup
> [[http://www.example.com | example]]

Can be adjusted in the templates in operations/puppet modules/gerrit/templates/its.

Change 674558 had a related patch set uploaded (by Hashar; owner: Hashar):
[operations/puppet@production] gerrit: escape remarkup for Phabricator comments

https://gerrit.wikimedia.org/r/674558

Change 674558 merged by Dzahn:
[operations/puppet@production] gerrit: escape remarkup for Phabricator comments

https://gerrit.wikimedia.org/r/674558

Change 675187 had a related patch set uploaded (by Dzahn; author: Dzahn):
[operations/puppet@production] %%%gerrit: test if version is rendered properly now%%%

https://gerrit.wikimedia.org/r/675187

Change 675187 abandoned by Dzahn:
[operations/puppet@production] gerrit: test if version is rendered properly now

Reason:
test failed

https://gerrit.wikimedia.org/r/675187

Looks like the %%% token has to be at the start of line. Seems like we can go with:

%%%Change 675187 had a related patch set uploaded (by Dzahn; author: Dzahn):
[operations/puppet@production] gerrit: test if __version__ is rendered properly now
%%%

https://gerrit.wikimedia.org/r/675187

Which renders as:

Change 675187 had a related patch set uploaded (by Dzahn; author: Dzahn):
[operations/puppet@production] gerrit: test if __version__ is rendered properly now

https://gerrit.wikimedia.org/r/675187

For the restored/abandoned message, we put the action in bold.

Change 675187 **abandoned** by Dzahn:
%%%[operations/puppet@production] gerrit: test if __version__ is rendered properly now

Reason:
test failed
%%%
https://gerrit.wikimedia.org/r/675187

Rendering:

Change 675187 abandoned by Dzahn:

[operations/puppet@production] gerrit: test if __version__ is rendered properly now

Reason:
test failed

https://gerrit.wikimedia.org/r/675187

That adds some extra space since Phabricator paragraphs have a 12 px bottom margin bah. Will revisit next week. It is week-end time ;)

Change 675479 had a related patch set uploaded (by Hashar; author: Hashar):
[operations/puppet@production] gerrit: escape remarkup for Phabricator comments [2]

https://gerrit.wikimedia.org/r/675479

Change 675479 merged by Dzahn:
[operations/puppet@production] gerrit: escape remarkup for Phabricator comments [2]

https://gerrit.wikimedia.org/r/675479

Change 675187 restored by Dzahn:

[operations/puppet@production] gerrit: test if __version__ is rendered properly now

https://gerrit.wikimedia.org/r/675187

Change 675187 abandoned by Hashar:

[operations/puppet@production] gerrit: test if __version__ is rendered properly now

Reason:

That works! #GerritBot

https://gerrit.wikimedia.org/r/675187

Solved by wrapping the subject and the abandon reason using literal block (%%%).