Skip to content

Fix failure to apply bugzilla.create_bug action - #6758

Open
ayoubdiourin7 wants to merge 1 commit into
mozilla:masterfrom
ayoubdiourin7:bugzilla-create-bug-drop-is-markdown
Open

Fix failure to apply bugzilla.create_bug action#6758
ayoubdiourin7 wants to merge 1 commit into
mozilla:masterfrom
ayoubdiourin7:bugzilla-create-bug-drop-is-markdown

Conversation

@ayoubdiourin7

Copy link
Copy Markdown
Contributor

create_bug records is_markdown: true, but BMO's POST /bug endpoint rejects that parameter with a 400 Bad Request, causing every recorded bug filing to fail when applied.

Changes

  • create_bug no longer records is_markdown in the action body.

  • CreateBugHandler strips is_markdown before sending the POST request, allowing already-recorded actions to succeed on retry.

    • This is temporary and can be removed once no pending action rows contain the flag.

Fixes #6752

@ayoubdiourin7
ayoubdiourin7 requested a review from a team as a code owner September 2, 2026 14:30
@ayoubdiourin7

Copy link
Copy Markdown
Contributor Author

Verified: filing a bug without the is_markdown field succeeds :
https://bugzilla-dev.allizom.org/show_bug.cgi?id=1855543

Comment on lines 204 to 216
extra: Annotated[
dict[str, Any] | None,
Field(
default=None,
description=(
"Optional additional fields accepted by Bugzilla's POST /bug "
"endpoint (severity, priority, keywords, whiteboard, blocks, "
"depends_on, cc, groups, op_sys, platform, assigned_to, "
"see_also, ...). Merged into the recorded body — explicit "
"top-level args win on conflict."
),
),
] = None,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These fields should be validated against what Bugzilla accepts. Similarly, for the update bug tool.

We might need to file a follow-up to consider that for future improvement.

Comment on lines +146 to +150
# TEMPORARY: BMO's POST /bug rejects `is_markdown` with a 400 Bad
# Request. `create_bug` no longer records it, but this strip is needed
# to apply actions recorded before that change. Delete it once no
# pending/failed `bugzilla.create_bug` row still carries the flag.
body = {k: v for k, v in params.items() if k != "is_markdown"}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You could drop this. I already deploy the current version of the PR, so we can use it without even landing the PR.

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.

Failed to apply bugzilla.create_bug action

2 participants