Skip to content

Support removing issue types - #2999

Merged
zwick merged 5 commits into
mainfrom
zwick-clear-issue-types
Aug 7, 2026
Merged

Support removing issue types#2999
zwick merged 5 commits into
mainfrom
zwick-clear-issue-types

Conversation

@zwick

@zwick zwick commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Allow consolidated issue_write and granular update_issue_type to remove an issue type with explicit JSON null.

Why

Related: github/plan-track-agentic-org#193

What changed

  • Preserve omitted/set/clear semantics with anyOf schemas (string with minLength: 1 or null), avoiding nullable type arrays for client compatibility noted in fix: use anyOf instead of nullable type array #325.
  • Preserve the same tri-state intent in the issue-write MCP App: omitted values may use existing-issue prefill, strings select a type, and explicit null or “Clear selection” submits null.
  • Send explicit clears as one REST PATCH containing "type": null and render schema unions as string | null in generated docs.
  • Reject suggestion metadata on granular removals because backend and live validation show removal is applied immediately without creating a pending suggestion.

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed — explicit null removes an issue type; empty strings are invalid.
  • New tool added

Prompts tested (tool changes only)

  • "Set this issue type to Bug"
  • "Remove the type from this issue"

Security / limits

  • No security or limits impact — this uses the existing issue update permission and endpoint.
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

Tool renaming

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR

Note: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Focused Go tests cover omitted, string, null, empty-string rejection, exact PATCH JSON, granular suggestions, and metadata rejection without a request. The MCP App passes typecheck and production build. Existing live validation confirmed set and clear through the built server; separate backend/live validation confirmed suggested null removal clears immediately with no pending suggestion.

Docs

  • Not needed
  • Updated (README / docs / examples) — generated references render nullable unions.
@zwick zwick self-assigned this Aug 3, 2026
@zwick
zwick marked this pull request as ready for review August 3, 2026 20:47
@zwick
zwick requested a review from a team as a code owner August 3, 2026 20:47
Copilot AI review requested due to automatic review settings August 3, 2026 20:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds empty-string support for clearing issue types in consolidated and granular issue tools.

Changes:

  • Sends "type": null when clearing an issue type.
  • Bypasses form deferral to preserve explicit clears.
  • Adds exact request-body tests and updates generated documentation.
Show a summary per file
File Description
README.md Documents issue-type removal.
pkg/github/issues.go Implements consolidated clear behavior.
pkg/github/issues_test.go Tests set, omit, clear, and form bypass.
pkg/github/issues_granular.go Implements granular clear behavior.
pkg/github/granular_tools_test.go Tests granular clear and validation.
pkg/github/__toolsnaps__/update_issue_type.snap Updates granular schema snapshot.
pkg/github/__toolsnaps__/issue_write.snap Updates consolidated schema snapshot.
docs/insiders-features.md Updates generated insiders documentation.
docs/feature-flags.md Updates generated feature documentation.

Review details

  • Files reviewed: 9/9 changed files
  • Comments generated: 0
  • Review effort level: Balanced
Comment thread pkg/github/issues.go Outdated
Comment thread pkg/github/issues_granular.go Outdated

@tommaso-moro tommaso-moro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested clears are supported by the API using {"type" {"value":null,"suggest":true}}. However, looking at issues_granolar.go it seems to be that {"issue_type":"","is_suggestion":true} currently sends {"type":null} and clears the type immediately? Is this intentional or should we preserve the suggestion flag here?

@alirezainanlosalehi7-lgtm

Copy link
Copy Markdown
zwick added 3 commits August 5, 2026 13:29
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ea8faa5c-7f26-4e2d-bf9c-6f0b5f173e8c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ea8faa5c-7f26-4e2d-bf9c-6f0b5f173e8c
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ea8faa5c-7f26-4e2d-bf9c-6f0b5f173e8c
@zwick
zwick force-pushed the zwick-clear-issue-types branch from 2666a34 to 3611fb2 Compare August 5, 2026 17:30
@zwick
zwick requested a review from tommaso-moro August 5, 2026 17:37
@tommaso-moro

Copy link
Copy Markdown
Contributor

Looking at issues.go I think something like {"type":null,"state":"closed","state_reason":"duplicate"} currently clears the type first (due to "type":null,) , and then returns an error because duplicate_of is missing, but I think it should validate the logic and fail before making any API request?

@zwick

zwick commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

@tommaso-moro Very nice catch. Adding a validation to prevent this from making the API call accompanied with a test

zwick added 2 commits August 6, 2026 09:05
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ea8faa5c-7f26-4e2d-bf9c-6f0b5f173e8c

@tommaso-moro tommaso-moro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm 🚀

@zwick
zwick merged commit e7f7bb8 into main Aug 7, 2026
26 of 43 checks passed
@zwick
zwick deleted the zwick-clear-issue-types branch August 7, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants