Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/ea8c22a1-67bb-4824-a89d-294f93ce8138 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
This reverts commit cf88faf. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/ea8c22a1-67bb-4824-a89d-294f93ce8138 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
set-issue-field safe output with schema/compiler wiring and actionable field-value errors
|
Hey One item is still outstanding before this is ready for review:
Once those gates are green, this looks like it should be in great shape for maintainer review. Consider converting from Draft when all tasks are complete. If you'd like a hand finishing up, you can assign this prompt to your coding agent:
|
There was a problem hiding this comment.
Pull request overview
Adds a new set-issue-field safe output/tool that allows workflows to set a single GitHub issue field by name/value (or by field node ID), with compiler/schema/docs wiring so it can be enabled via safe-outputs.set-issue-field.
Changes:
- Introduces a new safe-output runtime handler
set_issue_field(with tests) and registers it in the safe-output handler manager and tool catalogs. - Extends workflow compiler/config/schema plumbing to parse
safe-outputs.set-issue-field, emit handler config, compute enabled tools, validatemax, derive permissions, and add repo-parameter support. - Updates documentation and TypeScript safe-output type definitions to include
set_issue_field.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/unified_prompt_step.go | Adds set_issue_field to prompt tool budgeting when configured. |
| pkg/workflow/set_issue_field.go | Adds compiler-side config type and parser for set-issue-field. |
| pkg/workflow/safe_outputs_validation_config.go | Adds validation rules for set_issue_field safe-output items. |
| pkg/workflow/safe_outputs_tools_repo_params.go | Enables optional repo parameter behavior for set_issue_field based on safe-output targeting config. |
| pkg/workflow/safe_outputs_tools_computation.go | Enables tool name computation for set_issue_field. |
| pkg/workflow/safe_outputs_state.go | Adds SetIssueField into safe-output state mapping and enabled checks. |
| pkg/workflow/safe_outputs_permissions.go | Adds permissions derivation for set-issue-field (issues write). |
| pkg/workflow/safe_outputs_max_validation.go | Adds max validation for set_issue_field. |
| pkg/workflow/safe_outputs_config.go | Wires parsing/extraction of safe-outputs.set-issue-field into the compiler. |
| pkg/workflow/js/safe_outputs_tools.json | Adds set_issue_field tool definition to workflow JS tool catalog. |
| pkg/workflow/imports.go | Adds import conflict/type detection + merge behavior for set-issue-field. |
| pkg/workflow/compiler_types.go | Adds SetIssueField pointer to SafeOutputsConfig. |
| pkg/workflow/compiler_safe_outputs_handlers.go | Emits handler-manager config for set_issue_field. |
| pkg/workflow/compiler_safe_outputs_config_test.go | Adds coverage to ensure handler config is emitted for set_issue_field. |
| pkg/parser/schemas/main_workflow_schema.json | Adds frontmatter schema support + comment list entry for safe-outputs.set-issue-field. |
| docs/src/content/docs/reference/safe-outputs.md | Documents set-issue-field safe output and example configuration. |
| docs/src/content/docs/reference/glossary.md | Adds glossary entry describing set-issue-field. |
| actions/setup/js/types/safe-outputs.d.ts | Adds SetIssueFieldItem to safe-output TS types/exports. |
| actions/setup/js/set_issue_field.test.cjs | Adds vitest coverage for set_issue_field handler behavior and errors. |
| actions/setup/js/set_issue_field.cjs | Implements set_issue_field runtime handler (field discovery + typed updates). |
| actions/setup/js/safe_outputs_tools.json | Adds set_issue_field tool definition to actions runtime tool catalog. |
| actions/setup/js/safe_output_handler_manager.cjs | Registers set_issue_field handler module in the handler manager map. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 21/22 changed files
- Comments generated: 3
|
|
||
| if (fieldName || !fieldNodeId) { | ||
| const availableFields = await fetchIssueFields(githubClient, owner, repo); | ||
|
|
||
| if (availableFields.length === 0 && !fieldNodeId) { | ||
| const error = "No issue fields were discovered for this repository. Verify issue fields are enabled, or provide field_node_id to skip field discovery."; | ||
| core.error(error); | ||
| return { success: false, error }; | ||
| } | ||
|
|
||
| if (fieldName) { | ||
| resolvedField = availableFields.find(field => field.name.toLowerCase() === fieldName.toLowerCase()) || null; | ||
|
|
||
| if (!resolvedField) { | ||
| const availableNames = availableFields.map(field => field.name).join(", "); | ||
| const error = `Issue field ${JSON.stringify(fieldName)} not found. Available fields: ${availableNames}. Use a listed field_name or provide field_node_id to bypass discovery.`; | ||
| core.error(error); | ||
| return { success: false, error }; | ||
| } | ||
|
|
||
| if (!fieldNodeId) { | ||
| fieldNodeId = resolvedField.id; | ||
| } | ||
| } else if (fieldNodeId) { | ||
| resolvedField = availableFields.find(field => field.id === fieldNodeId) || null; | ||
| } |
| "set_issue_field": { | ||
| DefaultMax: 5, | ||
| Fields: map[string]FieldValidation{ | ||
| "issue_number": {IssueOrPRNumber: true}, | ||
| "field_name": {Type: "string", Sanitize: true, MaxLength: 128}, | ||
| "field_node_id": {Type: "string", MaxLength: 256}, | ||
| "value": {Required: true, Type: "string", Sanitize: true, MaxLength: 256}, | ||
| "repo": {Type: "string", MaxLength: 256}, // Optional: target repository in format "owner/repo" | ||
| }, | ||
| }, |
| "MissingTool": "missing_tool", | ||
| "MissingData": "missing_data", | ||
| "SetIssueType": "set_issue_type", | ||
| "SetIssueField": "set_issue_field", | ||
| "NoOp": "noop", |
|
@copilot review all comments |
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/ae7c7c7f-8a67-4047-a371-d8b1b1b170be Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
This reverts commit 72334f5. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/ae7c7c7f-8a67-4047-a371-d8b1b1b170be Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/ae7c7c7f-8a67-4047-a371-d8b1b1b170be Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done — I reviewed and addressed the actionable review threads. Implemented in commit
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 merge main and recompile |
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/671b2f8d-06c5-44f4-8ffe-0cb3386f1bcd Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
This reverts commit 5552a95. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot use set-issue-field in smoke-codex |
|
@copilot merge main and recompile |
…-field-safe-output # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/671b2f8d-06c5-44f4-8ffe-0cb3386f1bcd Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done in
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:
|
set-issue-field safe output with schema/compiler wiring and actionable field-value errorsset-issue-field safe output with allowed-fields constraints, schema/compiler wiring, and actionable field-value errors
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/7f1d22a8-421b-4c7f-aec5-2c0f013ca53d Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
This reverts commit cbbffd8. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…-field-safe-output # Conflicts: # .github/workflows/daily-cache-strategy-analyzer.lock.yml # .github/workflows/duplicate-code-detector.lock.yml # .github/workflows/issue-arborist.lock.yml # .github/workflows/smoke-codex.lock.yml Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented in
Done in 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:
|
set-issue-field safe output with allowed-fields constraints, schema/compiler wiring, and actionable field-value errorsset-issue-field safe output with allowed-fields constraints, schema/compiler wiring, actionable field-value errors, and smoke-codex coverage
This introduces a focused
set-issue-fieldsafe output, analogous toset-issue-type, so workflows can set one issue field by name/value without routing throughupdate-issue. It also adds explicit failure messages for unknown field names and invalid field values.Safe output runtime: new
set_issue_fieldhandleractions/setup/js/set_issue_field.cjsand registered it insafe_output_handler_manager.cjs.issue_number,field_name,value, and optionalfield_node_id(to bypass discovery).field_name→ lists available fields and suggestsfield_node_idAllowed-fields support for
set-issue-fieldallowed-fieldsconfiguration tosafe-outputs.set-issue-field(including["*"]wildcard semantics) to mirrorcreate-issuebehavior.set_issue_fieldruntime before applying updates.allowed_fieldsinto handler config emission and schema/docs forset-issue-field.set_issue_fieldwhenallowed-fieldsis configured.Refactor: shared issue-field allowlist helpers
actions/setup/js/allowed_issue_fields.cjswith shared parsing/validation helpers.create_issue.cjsandset_issue_field.cjsto use shared allowlist logic.Tool surface and type contracts
set_issue_fieldin both tool catalogs:actions/setup/js/safe_outputs_tools.jsonpkg/workflow/js/safe_outputs_tools.jsonactions/setup/js/types/safe-outputs.d.tswithSetIssueFieldItem.Compiler/config/schema integration
SetIssueFieldConfigparser (pkg/workflow/set_issue_field.go).max validation, permission derivation, imports merge, prompt tool budget,
repo-parameter derivation, and safe-output state mapping.
safe-outputs.set-issue-fieldinpkg/parser/schemas/main_workflow_schema.json.Smoke workflow adoption (
smoke-codex).github/workflows/smoke-codex.mdto enablesafe-outputs.set-issue-field.set_issue_fieldexactly once on the created issue using a type-compatible field/value pair.Docs updates
set-issue-fieldto safe-outputs reference and glossary:docs/src/content/docs/reference/safe-outputs.mddocs/src/content/docs/reference/glossary.mdExample usage
{"type":"set_issue_field","issue_number":123,"field_name":"Priority","value":"High"}