Bug filing

From mozilla/enterprise-firefox · View interactive version

Bug filing is an AI agent skill from the GitHub repository mozilla/enterprise-firefox. File a Bugzilla bug for Firefox/Gecko work, draft a bug summary and description, or attach a file to an existing bug. Use when the user asks to file a bug, wants a bug summary/description for a change, needs to report a defect/enhancement/task, or wants a file (e.g. a screenshot or testcase) attache

How to use this skill

Skill file

Filing a bug

Overview

File a Mozilla bug by opening a prefilled Bugzilla "enter bug" form in the user's

browser. The skill picks the right component automatically, drafts a well-formatted

summary and description, and hands the form to the user to submit, so the bug is

created under their own account with a chance to review and adjust.

Workflow

  1. Determine the product and component. Run

./mach file-info bugzilla-component <file> on a representative file the change

touches. The output is Product :: Component; split on :: for the product

and component URL params.

leaving it blank.

  1. Choose the bug type (per Mozilla's task/defect/enhancement guide):

engineering changes with no user-facing behavior change (tooling, tests, docs, build).

  1. Draft the summary and description.

mechanism, the file list, and any counts belong in the description, not the

summary.

use ("Restored tabs come back with blank titles"). Not the suspected

cause and not the fix: either can turn out wrong, and the symptom is what

people search for.

per window").

sessionstore modules").

a helper's namespace prefix (declareLazy, not XPCOMUtils.declareLazy),

glob shorthand (lazy.*).

project has no established name for the thing, describe it instead.

together, and let any trailing clause carry only what distinguishes this

one.

pref, and flag names) in backticks so they render as code in the filed bug.

https://tests.firefox.dev/test.html?test=<path>.

  1. Open the prefilled form. Don't print the draft or ask for approval first: the

user reviews it in the form, and nothing is filed until they submit it. Printing

it as well would put a second copy of the draft in your context, re-sent with

every later request in the session. If the user asked only for a summary and

description, print those instead and stop.

A request to file a bug, in any wording, means opening this form. Never create

the bug yourself, even with a Bugzilla API key at hand: the form is the user's

only chance to review the text before it goes public under their name.

Attaching a file to an existing bug is the one post you make yourself, and

only once the user approves it (see below).

Run the helper script with each Bugzilla

enter_bug.cgi field as a field=value argument; it URL-encodes the values and

opens the form in the browser (cross-platform, so Linux, macOS, and Windows all work):

```

python3 .agents/skills/bug-filing/file-bug.py 'product=<P>' 'component=<C>' \

'bug_type=<T>' 'short_desc=<summary>' 'comment=<description>'

```

code identifiers; the script does all the encoding.

bug most often needs are status_whiteboard (copy it from the parent or a

sibling bug, since teams use it for tags such as a Jira sync marker),

keywords (e.g. regression, meta), cc and assigned_to.

bug's fix needs the other bug's fix to land first, and blocked=<bug> when

the other bug's fix needs this one's or the other bug is a meta bug tracking

this one. Set regressed_by=<bug> when the other bug's patch caused this

bug. Use see_also otherwise, and for an external bug tracker URL, which

the other fields don't take.

The script opens the form and prints a one-line confirmation. **Never paste the

URL into your reply**: a prefilled form carries the whole description

percent-encoded in its query string, which puts the URL past the length at which

a terminal stops linkifying it, so the reader gets an unclickable wall of %20.

It also costs you: those characters stay resident in your context and are re-sent

with every later request in the session. Report the summary and the component

instead - and don't compress the description to shorten the URL, which nobody

was meant to read.

Tell the user they can edit the form before submitting it, or ask you for

changes; for changes, run the script again with the revised draft. Once they

submit the form, they provide the bug number.

Attaching a file to an existing bug

A form cannot prefill a file input, so attaching goes through the REST API:

python3 .agents/skills/bug-filing/attach-to-bug.py --bug <N> --file <path> \
    --summary '<attachment description>' --comment-file <path>

It reads the API key from api_key under [bugzilla.mozilla.org] in

~/.config/python-bugzilla/bugzillarc, and prints the new attachment's URL.

--comment '<text>' takes the comment inline, for short text without quotes.

--help lists the other options, e.g. --file-name.

Run it with --dry-run first, which prints the payload without posting it.

The dry run fails when no key is configured, but never checks the key against

Bugzilla, so a bad key shows up only as an HTTP 401 on the real run.

Show the user that output, name the bug, and wait for their approval before

the real run: the attachment is public and permanent.

Notes

itself. It posts only an attachment, after the user approves the dry run.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.