Add temporary ID support for create_issue safe output#4698
Conversation
- Generate 12-char hex temporary IDs for issues created via safe outputs - Store temporary_id -> issue_number mapping in job output - Replace #temp:ID references in issue body with resolved issue numbers - Support parent field referencing temporary IDs for sub-issue linking - Pass temporary_id_map to add-comment job for reference resolution - Add comprehensive tests for temporary ID functionality Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Create temporary_id.cjs with shared functions for temporary ID handling - Update create_issue.cjs and add_comment.cjs to use shared utility - Add temporary_id.cjs to embedded JavaScript sources for bundling - Add comprehensive tests for temporary_id.cjs module Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot merge main, accept all the deleted workflow lock files, recompile and finish merge. |
Updated the temporary ID format from #temp:XXXXXXXXXXXX to #aw_XXXXXXXXXXXX as requested. The new format: - Generated IDs: aw_ prefix + 12 hex characters (e.g., aw_abc123def456) - Reference pattern: #aw_XXXXXXXXXXXX (e.g., #aw_abc123def456) - Case-insensitive matching for references Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…-id-generation # Conflicts: # .github/workflows/test-ollama-threat-detection.lock.yml
There was a problem hiding this comment.
Pull request overview
This PR enables agents to create parent issues and sub-issues that reference each other within the same workflow run by implementing a temporary ID system. Issues are assigned aw_ prefixed 12-character hex cryptographic IDs that resolve to actual issue numbers after creation.
Key changes:
- New
temporary_id.cjsutility module with ID generation, validation, and reference replacement functions - Enhanced
create_issuesafe output to support temporary IDs and reference resolution - Modified
add_commentto support temporary ID references via environment variable - Cross-job communication through
temporary_id_mapjob output
Reviewed changes
Copilot reviewed 41 out of 42 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/js/temporary_id.cjs | New utility module providing temporary ID generation, validation, normalization, and reference replacement functions |
| pkg/workflow/js/temporary_id.test.cjs | Comprehensive test suite for temporary_id.cjs covering all functions and edge cases |
| pkg/workflow/js/create_issue.cjs | Enhanced to generate/use temporary IDs, resolve parent references, and replace ID references in issue bodies |
| pkg/workflow/js/create_issue.test.cjs | Added tests for temporary ID functionality including parent resolution, reference replacement, and staged mode preview |
| pkg/workflow/js/add_comment.cjs | Modified to load and use temporary ID map for resolving references in comment bodies |
| pkg/workflow/js/add_comment.test.cjs | Added tests for temporary ID reference replacement in comments |
| pkg/workflow/js.go | Registered temporary_id.cjs in JavaScript sources map for bundling |
| pkg/workflow/create_issue.go | Added temporary_id_map output to create-issue job |
| pkg/workflow/add_comment.go | Added GH_AW_TEMPORARY_ID_MAP environment variable from create_issue job output |
| pkg/workflow/js/types/safe-outputs.d.ts | Updated CreateIssueItem interface to include temporary_id field and allow string for parent |
| pkg/workflow/js/safe_outputs_tools.json | Updated create_issue tool schema with temporary_id field and updated parent field description |
| docs/src/content/docs/labs.mdx | Documentation cleanup (removed cron schedule and test workflow entry) |
| .github/workflows/*.lock.yml | Updated all compiled workflow files with the new temporary ID functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
|
✅ Agentic Changeset Generator completed successfully. |
* Initial plan * Add temporary ID support for create_issue safe output - Generate 12-char hex temporary IDs for issues created via safe outputs - Store temporary_id -> issue_number mapping in job output - Replace #temp:ID references in issue body with resolved issue numbers - Support parent field referencing temporary IDs for sub-issue linking - Pass temporary_id_map to add-comment job for reference resolution - Add comprehensive tests for temporary ID functionality Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * Extract temporary ID functions to shared utility module - Create temporary_id.cjs with shared functions for temporary ID handling - Update create_issue.cjs and add_comment.cjs to use shared utility - Add temporary_id.cjs to embedded JavaScript sources for bundling - Add comprehensive tests for temporary_id.cjs module Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * Change temporary ID pattern to use aw_ prefix Updated the temporary ID format from #temp:XXXXXXXXXXXX to #aw_XXXXXXXXXXXX as requested. The new format: - Generated IDs: aw_ prefix + 12 hex characters (e.g., aw_abc123def456) - Reference pattern: #aw_XXXXXXXXXXXX (e.g., #aw_abc123def456) - Case-insensitive matching for references Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Summary
This PR adds temporary ID support for the
create_issuesafe output, enabling agents to create parent issues and sub-issues that reference each other within the same workflow run.Changes
aw_prefixed 12-char hex crypto IDs assigned to each issue (user-provided or auto-generated)#aw_IDreferences in issue bodies replaced with resolved issue numbersparentfield accepts temporary IDs for sub-issue linkingtemporary_id_mapjob output passed to add-comment jobNew shared utility
Created
temporary_id.cjswith functions for ID generation, validation, normalization, and reference replacement.Usage
[ { "type": "create_issue", "title": "Parent Issue", "body": "This is the parent", "temporary_id": "aw_abc123def456" }, { "type": "create_issue", "title": "Sub Issue", "body": "References #aw_abc123def456", "parent": "aw_abc123def456" } ]The
#aw_abc123def456resolves to#42(actual issue number) when the sub-issue is created.Checklist
aw_prefixsafe_outputs_tools.jsonschematypes/safe-outputs.d.tscreate_issue.cjscreate_issue.goadd_comment.goandadd_comment.cjstemporary_id.cjsutility moduleOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.