Skip to content

Bug 2086124 - [HACKBOT] Structured metadata on comments - #2819

Merged
dklawren merged 11 commits into
mozilla:masterfrom
kyoshino:2086124
Nov 17, 2026
Merged

dklawren merged 11 commits into
mozilla:masterfrom
kyoshino:2086124

Conversation

@kyoshino

@kyoshino kyoshino commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Bug 2086124 - [HACKBOT] Structured metadata on comments

  • Add the Hackbot extension that will house all the Hackbot features
  • Hide the front matter block sent from Hackbot in the bug comments and bug mails as well as webhook and pulse payloads
  • Add a badge that shows an agent name and a run link to the bug comment headers
  • Add the hackbot_user admin param to enable this feature
  • Show the AI label beside the Hackbot user name
image

t/critic.t failed in CI: the extension added hand-written character classes,
a `no warnings`, and a `$+[0]` above the counts in t/.perlcritic-history.

- Use POSIX classes with /a, which match the same ASCII characters.
- Capture the comment text in the front matter regex instead of reading $+[0].
- Drop `no warnings 'redefine'`: nothing defines Bugzilla::Comment::hackbot
  before the extension does.
Attachment, duplicate and other typed comments are formatted without the
comment_body_full hook, so a front matter block in them stayed visible while
the header still showed the agent and hid its tag. Only plain comments are
parsed now. The DB test adds an attachment with a block in its comment.
@kyoshino

kyoshino commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator Author

It looks like the current test failures are not related to the code. @dklawren Please trigger rerun later. I don’t have permission to do it.

Comment thread extensions/Hackbot/Extension.pm Resolved
Saving an inline edit put the HTML of the raw text in the page, so a Hackbot
comment showed its front matter block until reload. The response is now
rendered from body_full, which applies the comment_body_full hook, like the
bug page.
@kyoshino
kyoshino requested a review from dklawren November 11, 2026 02:42
Comment thread extensions/BugModal/web/bug_modal.css Resolved
Comment thread Bugzilla/Comment.pm Resolved
With the comment_body_full hook, extensions can hide part of a comment from the REST `text` field, as the Hackbot extension does with its front matter. `raw_text` still has the stored text.
@kyoshino

Copy link
Copy Markdown
Collaborator Author

The fixes are in. I didn’t trigger CI because these are just minor document and CSS updates.

@kyoshino
kyoshino requested a review from dklawren November 16, 2026 14:51

@dklawren dklawren left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM r=dkl

@dklawren
dklawren merged commit 0a5e69a into mozilla:master Nov 17, 2026
7 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.

2 participants