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
Open
hackbot-ui: accept a Bugzilla bug URL in the bug ID field + run the tests in the CI#6409sylvestre wants to merge 3 commits into
sylvestre wants to merge 3 commits into
Conversation
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.
There was a problem hiding this comment.
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
TriggerFormvalidation/labels/placeholders to accept “Bugzilla bug ID or URL”. - Add
npm testscript (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.
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.
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.
No description provided.