Sort required arrays in safe output schemas for stable compilation #8267
+507
−113
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.
Go map iteration order is non-deterministic, causing the
requiredarrays in custom job schemas to change order between compilations. This creates unnecessary diffs in lock files and makes schemas unstable.Changes
Code fix (
pkg/workflow/safe_outputs_config_generation.go):requiredFieldsarray before assignment to ensure deterministic outputsort.Strings()call ingenerateCustomJobToolDefinition()Schema normalization (embedded JSON):
requiredarrays inpkg/workflow/js/safe_outputs_tools.json(8 tools)requiredarrays inactions/setup/js/safe_outputs_tools.json(7 tools)Test coverage:
TestCustomJobToolsRequiredFieldsAreSortedto verify alphabetical orderingExample
Before:
{ "inputSchema": { "required": ["zebra", "alpha", "middle"] } }After:
{ "inputSchema": { "required": ["alpha", "middle", "zebra"] } }All compiled schemas now produce stable, sorted
requiredarrays regardless of map iteration order.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://api.github.com/user/usr/bin/gh gh api user --jq .login k/gh-aw/gh-aw/internal/tools/generate-action-metadata/main.go l/linux_amd64/compile /home/REDACTED/go/pkg/mod/golang.org/[email protected]/pkg/tool/linux_amd64/veuser rg/[email protected] rg/[email protected] t /home/REDACTED/go/pkg/mod/golang.o--jq -ato�� -bool t 548119/b397/vet.cfg -errorsas -ifaceassert l/linux_amd64/link git(http block)/usr/bin/gh gh api user --jq .login ithub/workflows l /usr/bin/git --noprofile t om/different-own--show-toplevel git -c .git .git(http block)/usr/bin/gh gh api user --jq .login ithub/workflows 2949526/b406/_testmain.go 2949526/b415/_pkg_.a mary-test-344817infocmp --noheadings /home/REDACTED/go/xterm-color git -C p-deno.git p-deno.git k/gh-aw/gh-aw/gh-aw l /tmp/go-build334api /usr/bin/gh k/gh-aw/gh-aw/gh--jq(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original 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.