Skip to content

hackbot-ui: accept a Bugzilla bug URL in the bug ID field + run the tests in the CI - #6409

Open
sylvestre wants to merge 3 commits into
mozilla:masterfrom
sylvestre:hackbot-ui-bug-url
Open

hackbot-ui: accept a Bugzilla bug URL in the bug ID field + run the tests in the CI#6409
sylvestre wants to merge 3 commits into
mozilla:masterfrom
sylvestre:hackbot-ui-bug-url

Conversation

@sylvestre

Copy link
Copy Markdown
Contributor

No description provided.

Add parseBugId(), which takes either a bare bug ID or a Bugzilla URL
(show_bug.cgi?id=N or the short /N form), with unit tests run through
node:test + tsx via `npm test`.
Add a hackbot_ui_tests_task Taskcluster task (node:lts, npm ci && npm
test) and gate the PyPI-release and docker-push tasks on it.
Copilot AI review requested due to automatic review settings July 28, 2026 11:57
@sylvestre
sylvestre requested a review from a team as a code owner July 28, 2026 11:57

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

Adds support in hackbot-ui for entering a full Bugzilla URL (not just a numeric ID) in the “bug id” field, and introduces a dedicated CI task to run hackbot-ui unit tests.

Changes:

  • Introduce parseBugId() utility + unit tests to accept bare IDs and Bugzilla URLs.
  • Update TriggerForm validation/labels/placeholders to accept “Bugzilla bug ID or URL”.
  • Add npm test script (Node test runner + tsx) and wire a new Taskcluster job to run hackbot-ui tests in CI.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
services/hackbot-ui/tsconfig.json Enables TS extension imports to support TS test imports (e.g. ./file.ts).
services/hackbot-ui/package.json Adds test script using node --test with tsx; adds tsx devDependency.
services/hackbot-ui/package-lock.json Updates lockfile for added tsx (and its dependencies).
services/hackbot-ui/lib/bugzilla.ts Adds parseBugId() helper to extract numeric bug IDs from input/URLs.
services/hackbot-ui/lib/bugzilla.test.ts Adds Node-based unit tests for parseBugId().
services/hackbot-ui/components/TriggerForm.tsx Uses parseBugId() and updates UI text to accept Bugzilla URLs.
.taskcluster.yml Adds a Taskcluster task to run hackbot-ui tests and includes it in release dependencies.
Files not reviewed (1)
  • services/hackbot-ui/package-lock.json: Generated file

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

Comment thread services/hackbot-ui/lib/bugzilla.ts
Comment thread services/hackbot-ui/lib/bugzilla.test.ts
Addresses review feedback: parseBugId() accepted any http(s) URL with a
numeric id parameter, and normalized protocol-relative URLs into
"https:////…", which dropped the hostname. Strip leading slashes before
parsing and check the hostname against a Bugzilla allowlist.
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