Add unassign_from_user and assign_to_user to compile-time safe outputs schema#16132
Add unassign_from_user and assign_to_user to compile-time safe outputs schema#16132
Conversation
- Add unassign_from_user tool definition to compile-time schema - Add handler registry entries for assign_to_user and unassign_from_user - Add comprehensive tests for both handlers - Tool supports max limit, allowed users, target, and cross-repo operations Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Update workflow lock files to include the new unassign_from_user tool in schema and handler configs. This enables workflows like smoke-codex to properly remove assignees from PRs during cleanup. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done! Merged main branch and recompiled all workflows. The merge commit is c575e3a. All 154 workflows compiled successfully with no changes to lock files (the main branch changes were documentation-only). Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot lint go |
There was a problem hiding this comment.
Pull request overview
This PR adds the unassign_from_user tool to the compile-time safe outputs schema, resolving workflow validation failures in Smoke Codex and other workflows that need to remove assignees from issues/PRs. The missing tool existed at runtime but was absent from the compile-time schema, causing validation errors during workflow compilation.
Changes:
- Added
unassign_from_userto the compile-time schema (safe_outputs_tools.json) with full field definitions - Added handler registry entries for both
assign_to_userandunassign_from_userin the compiler configuration - Added comprehensive tests for both handlers, including validation of config generation with allowed users, max limits, target repos, and cross-repository operations
- Recompiled 13 workflow lock files to include the updated handler configurations
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/js/safe_outputs_tools.json | Added complete unassign_from_user tool schema with assignee/assignees, issue_number, and repo fields |
| pkg/workflow/compiler_safe_outputs_config.go | Added handler registry entries for assign_to_user and unassign_from_user with max, allowed users, target, and cross-repo support |
| pkg/workflow/compiler_safe_outputs_config_test.go | Added comprehensive tests for both handlers validating config generation with all fields |
| pkg/workflow/safe_outputs_tools_test.go | Updated expected tools list to include unassign_from_user |
| .github/workflows/smoke-codex.lock.yml | Added unassign_from_user tool schema and handler config allowing githubactionagent removal |
| .github/workflows/daily-assign-issue-to-user.lock.yml | Added assign_to_user handler config |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| "name": "assign_to_user", | ||
| "description": "Assign one or more GitHub users to an issue. Use this to delegate work to specific team members. Users must have access to the repository.", | ||
| "inputSchema": { | ||
| "type": "object", | ||
| "required": [ | ||
| "issue_number" | ||
| ], | ||
| "properties": { | ||
| "issue_number": { | ||
| "type": [ | ||
| "number", | ||
| "string" | ||
| ], | ||
| "description": "Issue number to assign users to. This is the numeric ID from the GitHub URL (e.g., 543 in github.com/owner/repo/issues/543). If omitted, assigns to the issue that triggered this workflow." | ||
| }, | ||
| "assignees": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "string" | ||
| }, | ||
| "description": "GitHub usernames to assign to the issue (e.g., ['octocat', 'mona']). Users must have access to the repository." | ||
| }, | ||
| "assignee": { | ||
| "type": "string", | ||
| "description": "Single GitHub username to assign. Use 'assignees' array for multiple users." | ||
| } | ||
| }, | ||
| "additionalProperties": false | ||
| } | ||
| }, |
There was a problem hiding this comment.
The assign_to_user schema is missing the "repo" field that is supported by the runtime handler. The unassign_from_user tool (lines 564-595) includes a "repo" field, and the assign_to_user runtime handler (actions/setup/js/assign_to_user.cjs:61) supports cross-repository operations using resolveAndValidateRepo. The schema should include a "repo" property with the same structure as unassign_from_user for consistency and to enable cross-repository assignment workflows.
Use assert.InDelta instead of assert.Equal for float64 comparisons in test assertions. This follows best practices for floating-point comparisons and resolves testifylint warnings. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Go linting completed. Fixed 2 testifylint issues in new test code (commit 839e08d). The remaining 2 staticcheck issues in Linting Results:
|
Add unassign_from_user and assign_to_user to compile-time safe outputs schema ✅
Summary
Successfully added the
unassign_from_usertool to the safe outputs toolset, enabling workflows to remove assignees from issues/PRs during cleanup operations.Root Cause
The
unassign_from_usertool existed at runtime but was missing from the compile-time schema, causing:Changes Implemented
Added tool to compile-time schema (
pkg/workflow/js/safe_outputs_tools.json)assignee/assignees,issue_number, andrepofieldsAdded handler registry entries (
pkg/workflow/compiler_safe_outputs_config.go)assign_to_userhandler (was missing)unassign_from_userhandlerAdded comprehensive tests
TestHandlerConfigAssignToUser- validates assign_to_user config generationTestHandlerConfigUnassignFromUser- validates unassign_from_user config generationTestGetSafeOutputsToolsJSONto include new tool in expected listRecompiled workflows
Merged main branch
Fixed linting issues
assert.InDeltafor proper floating-point assertionsWorkflows Updated
Test Results
All tests passing:
TestHandlerConfigAssignToUserTestHandlerConfigUnassignFromUserTestGetSafeOutputsToolsJSONpkg/workflow/Linting
Impact
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.