Add temporary ID support to assign_milestone safe output#21578
Add temporary ID support to assign_milestone safe output#21578
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Hey The PR looks ready for maintainer review. 🟢
|
|
@copilot keep working |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Refactored |
There was a problem hiding this comment.
Pull request overview
Adds temporary ID support to the assign_milestone safe-output flow so a workflow can create an issue and then assign it a milestone in the same run.
Changes:
- Accept temporary ID strings for
assign_milestone.issue_numberin validation + tool schema docs. - Resolve
issue_numbervia the temporary-ID map in the JS handler, returning{ deferred: true }when unresolved. - Add JS tests covering temporary-ID resolution and deferral behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
actions/setup/js/assign_milestone.cjs |
Resolves issue_number using temporary-ID helpers and defers when unresolved. |
actions/setup/js/assign_milestone.test.cjs |
Adds tests for resolving and deferring temporary IDs. |
pkg/workflow/safe_outputs_validation_config.go |
Updates validator to allow temporary IDs for assign_milestone.issue_number. |
pkg/workflow/js/safe_outputs_tools.json |
Updates tool schema description to advertise temporary ID support. |
actions/setup/js/safe_outputs_tools.json |
Updates tool schema description to advertise temporary ID support. |
go.mod |
Promotes github.com/charmbracelet/lipgloss to a direct dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| // Resolve issue_number, which may be a temporary ID (e.g. "aw_abc123") or a plain number | ||
| const resolvedIssueTarget = resolveRepoIssueTarget(item.issue_number, temporaryIdMap, context.repo.owner, context.repo.repo); | ||
|
|
| DefaultMax: 1, | ||
| Fields: map[string]FieldValidation{ | ||
| "issue_number": {IssueOrPRNumber: true}, | ||
| "issue_number": {IssueNumberOrTemporaryID: true}, |
| processedCount++; | ||
|
|
||
| const item = message; | ||
|
|
||
| const issueNumber = Number(item.issue_number); | ||
| const milestoneNumber = Number(item.milestone_number); | ||
| // Convert resolvedTemporaryIds to a normalized Map for resolveRepoIssueTarget |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in f83ccf5. The 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:
|
assign_milestonedidn't support temporary IDs forissue_number, preventing agents from creating an issue and immediately assigning it a milestone in the same workflow run.Changes
assign_milestone.cjs: ImportresolveRepoIssueTargetfromtemporary_id.cjs; initialize atemporaryIdMapclosure insidemain(); mergeresolvedTemporaryIdson each invocation; replace directNumber(item.issue_number)withresolveRepoIssueTarget()to handle both plain numbers and temporary IDs; return{ success: false, deferred: true }when a temporary ID is not yet resolved so the handler manager retries later.safe_outputs_validation_config.go: Changeassign_milestone.issue_numberfromIssueOrPRNumber→IssueNumberOrTemporaryIDso the input validator accepts temporary ID strings.safe_outputs_tools.json(both copies): Updateissue_numberdescription to advertise temporary ID support.assign_milestone.test.cjs: Add tests for successful resolution, deferral on unresolved ID, and correct downstream API call.Example
{"type": "create_issue", "temporary_id": "aw_abc123", "title": "New feature"} {"type": "assign_milestone", "issue_number": "aw_abc123", "milestone_number": 5}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:
https://github.com/ghapi/graphql/usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw(http block)/usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw GQvkIRGV1HcZ(http block)/usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw "$k=".$v["local-C --property=Memor/home/REDACTED/work/gh-aw/gh-aw/.github/workflows bash --no�� --noprofile -collect-logs de/node/bin/git(http block)https://github.com/ghapi/orgs/test-owner/actions/secrets/usr/bin/gh gh api /orgs/test-owner/actions/secrets --jq .secrets[].name actions/setup-cl-p(http block)https://github.com/ghapi/repos/actions/ai-inference/git/ref/tags/v1/usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha nt/action/git/ref/tags/v999.999.999 status /usr/bin/git .github/workflowgit on x_amd64/vet git conf�� user.email test@example.com /usr/bin/git ub/workflows(http block)/usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v1 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel 64/pkg/tool/linurev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel ache/go/1.25.0/xrev-parse /usr/bin/git git(http block)https://github.com/ghapi/repos/actions/checkout/git/ref/tags/v3/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha k/gh-aw/gh-aw/pkg/cli/access_log.go k/gh-aw/gh-aw/pkg/cli/actionlint.go ache/node/24.14.0/x64/bin/node */*.ts' '**/*.jsgit(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v3 --jq .object.sha /tmp/gh-aw/aw-master.patch git 64/pkg/tool/linux_amd64/vet --get remote.origin.urrev-parse /opt/hostedtoolc--show-toplevel 64/pkg/tool/linux_amd64/vet rev-�� --show-toplevel /opt/hostedtoolcache/node/24.14.0/x64/bin/node /usr/bin/git secrets.TOKEN x_amd64/vet /usr/bin/git git(http block)https://github.com/ghapi/repos/actions/checkout/git/ref/tags/v5/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha k/gh-aw/gh-aw/.github/workflows .cfg 64/pkg/tool/linux_amd64/vet l tions/setup/js/sremote k/_temp/ghcca-no-v 64/pkg/tool/linux_amd64/vet api k/gh-aw/gh-aw/.github/workflows .cfg 64/pkg/tool/linux_amd64/vet l owner=github DiscussionsEnabl--show-toplevel 64/pkg/tool/linux_amd64/vet(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel 1441583/b449/_testmain.go /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/link "prettier" --wrigit ent=2)) x_amd64/vet /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/link -o /tmp/go-build2601441583/b449/workflow.test -importcfg /usr/bin/git -s -w -buildmode=exe git(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v5 --jq .object.sha --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git se 1441583/b036/vetrev-parse .cfg git rev-�� --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git ir_test.go 1441583/b202/vetrev-parse 64/pkg/tool/linu--show-toplevel git(http block)https://github.com/ghapi/repos/actions/checkout/git/ref/tags/v6/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --get remote.origin.url ache/go/1.25.0/x64/pkg/tool/linux_amd64/compile ithub/workflows(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha user.name Test User /usr/bin/git ithub/workflows(http block)/usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha --show-toplevel 64/pkg/tool/linux_amd64/vet /usr/bin/git graphql -f ache/go/1.25.0/x--show-toplevel git rev-�� --show-toplevel ache/go/1.25.0/x64/pkg/tool/linuTest User /usr/bin/git 4124-15334/test-git 1441583/b003/vetrev-parse .cfg git(http block)https://github.com/ghapi/repos/actions/github-script/git/ref/tags/v8/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha *.json' '!../../-errorsas(http block)/usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha --noprofile /assign_milestone.test.cjs h nore(http block)https://github.com/ghapi/repos/actions/setup-go/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha k/gh-aw/gh-aw/.github/workflows/audit-workflows.md origin ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet ithub/workflows(http block)/usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha --show-toplevel git /usr/bin/git --show-toplevel ef/N6GE9dzJuLpfUrev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel 64/pkg/tool/linurev-parse /usr/bin/git git(http block)https://github.com/ghapi/repos/actions/setup-node/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha user.name stmain.go ache/go/1.25.0/x64/pkg/tool/linux_amd64/link te 'scripts/**/*git(http block)/usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha --show-toplevel git ash --show-toplevel 64/pkg/tool/linurev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel 64/pkg/tool/linurev-parse /usr/bin/git git(http block)https://github.com/ghapi/repos/actions/setup-node/git/ref/tags/v6/usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq .object.sha th .prettierignoremote.origin.url(http block)https://github.com/ghapi/repos/actions/upload-artifact/git/ref/tags/v4/usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha 1441583/b418/logger.test -buildtags 0/x64/bin/node -errorsas -ifaceassert -nilfunc sAFIA48ngLY-h/fQkmIpjEVxgPIJbBLrkR/yyjxJESSHc3089fRgrZr/tga2eoUsAFIA48ngLY-h -has�� ithub/workflows/ace-editor.md -buildtags 0/x64/bin/node -errorsas -ifaceassert -nilfunc /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet(http block)/usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v4 --jq .object.sha --show-toplevel git /usr/bin/git = get && echo "pgit = get && echo "prev-parse /usr/bin/git git rev-�� --show-toplevel git /usr/bin/mkdir .*[0-9]\.[0-9] x_amd64/vet /usr/bin/git mkdir(http block)https://github.com/ghapi/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b/usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha h ../../../.pret.prettierignore --local cal/bin/bash user.name(http block)https://github.com/ghapi/repos/github/gh-aw/usr/bin/gh gh api /repos/github/gh-aw --jq .visibility --noprofile(http block)https://github.com/ghapi/repos/github/gh-aw-actions/git/ref/tags/v1.0.0/usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha 4124-15334/test-2846759087 /tmp/go-build2601441583/b050/vet.cfg 1441583/b362/vet.cfg --noprofile(http block)/usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel git /usr/bin/git master pidof /usr/bin/git git rev-�� --show-toplevel git /usr/bin/git --show-toplevel x_amd64/vet /usr/bin/git git(http block)https://github.com/ghapi/repos/github/gh-aw-actions/git/ref/tags/v1.2.3/usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha jpq_JbW5I /tmp/go-build2601441583/b067/vet.cfg(http block)/usr/bin/gh gh api /repos/github/gh-aw-actions/git/ref/tags/v1.2.3 --jq .object.sha --show-toplevel 1441583/b449/workflow.test /usr/bin/git t0 sed(http block)https://github.com/ghapi/repos/github/gh-aw/actions/runs/1/artifacts/usr/bin/gh gh run download 1 --dir test-logs/run-1 --write 64/pkg/tool/linux_amd64/vet !../../../pkg/wogit --ignore-path ed } } 64/pkg/tool/linux_amd64/vet --no�� ub/workflows .cfg x_amd64/compile ignore-path ../.git g/workflow/compirev-parse ache/node/24.14.--show-toplevel x_amd64/compile(http block)https://github.com/ghapi/repos/github/gh-aw/actions/runs/12345/artifacts/usr/bin/gh gh run download 12345 --dir test-logs/run-12345(http block)https://github.com/ghapi/repos/github/gh-aw/actions/runs/12346/artifacts/usr/bin/gh gh run download 12346 --dir test-logs/run-12346(http block)https://github.com/ghapi/repos/github/gh-aw/actions/runs/2/artifacts/usr/bin/gh gh run download 2 --dir test-logs/run-2 --write 64/pkg/tool/linux_amd64/vet !../../../pkg/wogit --ignore-path ../../../.prettiuser.email 64/pkg/tool/linutest@example.com -V=f�� k/gh-aw/gh-aw/.github/workflows(http block)https://github.com/ghapi/repos/github/gh-aw/actions/runs/3/artifacts/usr/bin/gh gh run download 3 --dir test-logs/run-3 --write 64/pkg/tool/linux_amd64/vet !../../../pkg/wogit --ignore-path ../../../.pretti--git-dir 64/pkg/tool/linux_amd64/vet -o ub/workflows .cfg 64/pkg/tool/linux_amd64/vet l -buildid=zXdDlYyrev-parse -s 64/pkg/tool/linux_amd64/vet(http block)https://github.com/ghapi/repos/github/gh-aw/actions/runs/4/artifacts/usr/bin/gh gh run download 4 --dir test-logs/run-4 --write x_amd64/compile l --ignore-path DiscussionsEnabl--show-toplevel x_amd64/compile --no�� --noprofile .cfg 64/pkg/tool/linux_amd64/vet ignore-path ../.git(http block)https://github.com/ghapi/repos/github/gh-aw/actions/runs/5/artifacts/usr/bin/gh gh run download 5 --dir test-logs/run-5 --write 64/pkg/tool/linux_amd64/vet !../../../pkg/wogit --ignore-path ../../../.pretti--show-toplevel 64/pkg/tool/linux_amd64/vet --no�� k/gh-aw/gh-aw/.github/workflows(http block)https://github.com/ghapi/repos/github/gh-aw/actions/workflows/usr/bin/gh gh workflow list --json name,state,path --format %(refname) repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } ignore acb9edb0da2a598b-atomic(http block)/usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 100(http block)/usr/bin/gh gh run list --json databaseId,number,url,status,conclusion,workflowName,createdAt,startedAt,updatedAt,event,headBranch,headSha,displayTitle --workflow nonexistent-workflow-12345 --limit 6(http block)https://github.com/ghapi/repos/github/gh-aw/git/ref/tags/v1.0.0/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha k/gh-aw/gh-aw/.g-c=4 .cfg 64/pkg/tool/linu-importcfg --ignore-path ../../../.prettiinit DiscussionsEnabl/home/REDACTED/work/gh-aw/gh-aw/pkg/testutil/tempdir_test.go 64/pkg/tool/linux_amd64/vet -C /home/REDACTED/work/gh-aw/gh-aw/.github/workflows .cfg x_amd64/compile it}(http block)/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.0.0 --jq .object.sha --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git 1 bash /opt/hostedtoolc--show-toplevel ghyAnFaSO77x rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.0/x64/pkg/tool/linux_amd64/vet ac29b4b160e3e891-d -unreachable=falgit /tmp/go-build260rev-parse(http block)https://github.com/ghapi/repos/github/gh-aw/git/ref/tags/v1.2.3/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v1.2.3 --jq .object.sha te '**/*.cjs' '**/*.ts' '**/*.js-f(http block)https://github.com/ghapi/repos/github/gh-aw/git/ref/tags/v2.0.0/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha te '**/*.cjs' '**/*.ts' '**/*.js-f --log-level in/sh --log-target journal-or-kmsg(http block)/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha ithub/workflows(http block)/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v2.0.0 --jq .object.sha te '**/*.cjs' '**/*.ts' '**/*.json' --ignore-pat-f(http block)https://github.com/ghapi/repos/github/gh-aw/git/ref/tags/v3.0.0/usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/v3.0.0 --jq .object.sha te '**/*.cjs' '**/*.ts' '**/*.jsremote.origin.url(http block)https://github.com/ghapi/repos/githubnext/agentics/git/ref/tags//usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/# --jq .object.sha --local user.email k/_temp/ghcca-node/node/bin/bash(http block)https://github.com/ghapi/repos/nonexistent/action/git/ref/tags/v999.999.999/usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha g_.a ../../../**/*.json 64/pkg/tool/linux_amd64/vet --ignore-path w cal/bin/git 64/pkg/tool/linutest@example.com api 2817321644/.github/workflows .cfg 64/pkg/tool/linux_amd64/vet l owner=github -f 64/pkg/tool/linux_amd64/vet(http block)/usr/bin/gh gh api /repos/nonexistent/action/git/ref/tags/v999.999.999 --jq .object.sha --show-toplevel ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet /usr/bin/git SameOutput260196git -trimpath /opt/hostedtoolc--show-toplevel git rev-�� --show-toplevel /opt/hostedtoolcache/go/1.25.0/xowner=github /usr/bin/git runs/20260318-12git -buildtags(http block)https://github.com/ghapi/repos/nonexistent/repo/actions/runs/12345/usr/bin/gh gh run view 12345 --repo nonexistent/repo --json status,conclusion l r x_amd64/asm 64/pkg/tool/linux_amd64/vet -c k/gh-aw/gh-aw/.github/workflows .cfg 64/pkg/tool/linux_amd64/vet --format=%H:%ct(http block)https://github.com/ghapi/repos/owner/repo/actions/workflows/usr/bin/gh gh workflow list --json name,state,path --repo owner/repo repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } ignore(http block)/usr/bin/gh gh workflow list --json name,state,path --repo owner/repo k/gh-aw/gh-aw/actions/setup/node_modules/.bin/node(http block)https://github.com/ghapi/repos/owner/repo/contents/file.md/tmp/go-build2601441583/b399/cli.test /tmp/go-build2601441583/b399/cli.test -test.testlogfile=/tmp/go-build2601441583/b399/testlog.txt -test.paniconexit0 -test.v=true -test.parallel=4 -test.timeout=10m0s -test.run=^Test -test.short=true OUTPUT -d 168.63.129.16 bash --no�� o actions/setup-go1.25.0 53 repository(owne-nolocalimports ACCEPT(http block)https://github.com/ghapi/repos/test-owner/test-repo/actions/secrets/usr/bin/gh gh api /repos/test-owner/test-repo/actions/secrets --jq .secrets[].name race(http block)If you need me to access, download, or install something from one of these locations, you can either:
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.