Normalize include order in workflow compilation#1258
Merged
Conversation
- Add alphabetical sorting of included files in compiler - Add test case to verify alphabetical ordering - Recompile workflows to apply fix to dev.lock.yml Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Normalize include order in workflow compilation
Normalize include order in workflow compilation
Oct 6, 2025
pelikhan
approved these changes
Oct 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR fixes non-deterministic ordering of included files in generated workflow lock files by ensuring they are sorted alphabetically.
Problem
The include order in generated
.lock.ymlfiles was non-deterministic because the compiler was iterating over a Go map to build the list of included files. Since Go maps have random iteration order, this resulted in inconsistent diffs when recompiling workflows, even when no actual changes were made.For example,
dev.lock.ymlwould sometimes show:And other times:
Solution
Added alphabetical sorting of included files after building the slice from the deduplication map in
pkg/workflow/compiler.go:Changes Made
pkg/workflow/compiler.go: Addedsortimport and alphabetical sorting after line 628pkg/workflow/manifest_test.go: AddedTestManifestIncludeOrderingto verify includes are always listed alphabetically.github/workflows/dev.lock.yml: Recompiled with normalized include order (alphabetical:keep-it-short.mdbeforeuse-emojis.md)Impact
This is a minimal, cosmetic change that:
Validation
✅ All unit tests pass (including new test)
✅ All integration tests pass
✅ Code formatting verified with
make fmt✅ Linting passed with
make lint✅ Full validation with
make agent-finishOriginal 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.