fix: uppercase state_reason enum constants in close_issue tool schema - #18269
Merged
pelikhan merged 2 commits intoFeb 25, 2026
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix failing tests in the application
fix: uppercase state_reason enum constants in close_issue tool schema
Feb 25, 2026
pelikhan
approved these changes
Feb 25, 2026
pelikhan
marked this pull request as ready for review
February 25, 2026 05:34
pelikhan
deleted the
copilot/fix-tests-32f46bac-0752-46bd-bd6e-69e94a3e33fb
branch
February 25, 2026 05:34
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a CI test failure by standardizing the close_issue tool's state_reason enum values to use UPPERCASE constants, consistent with the close_discussion tool and the safe_outputs_mcp_schema_validation test requirements. The implementation ensures compatibility with the GitHub REST API by converting values to lowercase before making API calls.
Changes:
- Updated
state_reasonenum constants from lowercase to UPPERCASE in the MCP schema - Added
.toLowerCase()conversion in the implementation to maintain GitHub API compatibility - Updated all tests to use UPPERCASE values while verifying lowercase reaches the API
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
actions/setup/js/safe_outputs_tools.json |
Changed state_reason enum from lowercase to UPPERCASE constants (["COMPLETED", "NOT_PLANNED", "DUPLICATE"]) |
actions/setup/js/close_issue.cjs |
Added .toLowerCase() conversion before API call and updated default value to "COMPLETED" |
actions/setup/js/close_issue.test.cjs |
Updated test descriptions and inputs to use UPPERCASE values while maintaining lowercase assertions for API calls |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
The
safe_outputs_mcp_schema_validationtest enforces that schema fields containing "reason" use UPPERCASE enum constants (consistent withclose_discussionand other tools). Theclose_issuetool'sstate_reasonfield used lowercase values, causing a CI failure.Changes
safe_outputs_tools.json: Changedstate_reasonenum from["completed", "not_planned", "duplicate"]→["COMPLETED", "NOT_PLANNED", "DUPLICATE"]close_issue.cjs: Added.toLowerCase()before passingstate_reasonto the GitHub REST API (which requires lowercase); updated default from"completed"→"COMPLETED"close_issue.test.cjs: Updated tests to pass UPPERCASE values (matching schema), while still asserting lowercase reaches the APIOriginal prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.