Skip to content

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

Open
kyoshino wants to merge 8 commits into
mozilla:masterfrom
kyoshino:2086124
Open

kyoshino wants to merge 8 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
flex-wrap: wrap;
gap: 4px 0;
width: 128px;
width: 64px;

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.

this narrows the action group and drops the row gap for every comment on small screens, not just hackbot ones. tag/reply/spinner (and private for insiders) now wrap two per row with no spacing. could this move to hackbot.css scoped to hackbot comments, or is the global change intended

Comment thread Bugzilla/Comment.pm
}
else {
$body = $self->body;
Bugzilla::Hook::process('comment_body_full',

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.

with this hook the rest text field (and show.xml thetext, webhook/pulse body) can now omit part of the stored text. docs/en/md/api/core/v1/comment.md still says text is the full body. worth a line there saying extensions may hide parts of text and raw_text always has the stored text

This branch has not been deployed

No deployments
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