fix: stabilize compiled lock file output ordering#17927
Merged
Conversation
…job dependencies - Add TestImportTopologicalSortStableAcrossRuns regression test from PR #17925 - Sort getCustomJobsDependingOnPreActivation result for deterministic ordering - Sort getReferencedCustomJobs result for deterministic ordering - Fix buildMainJob to iterate data.Jobs in sorted key order when building depends Fixes #17923 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix sources of compilation instability in tests
fix: stabilize compiled lock file output ordering
Feb 23, 2026
Contributor
|
@copilot merge main and recompile |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes non-deterministic lock file output ordering caused by Go map iteration in the job dependency builder. The unstable ordering of the needs: field in the agent job created noisy diffs across repeated compilations of the same workflow.
Changes:
- Added a regression test to validate stable import topological ordering across multiple runs
- Sorted the results of
FilterMapKeysingetCustomJobsDependingOnPreActivationandgetReferencedCustomJobs - Replaced non-deterministic map iteration in
buildMainJobwith sorted-key iteration for thedependslist
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/parser/import_topological_test.go | Adds regression test that runs import processing 5 times and verifies identical ordering |
| pkg/workflow/compiler_jobs.go | Sorts results from FilterMapKeys to ensure deterministic ordering in helper functions |
| pkg/workflow/compiler_activation_jobs.go | Replaces direct map iteration with sorted iteration when building job dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
Done — merged 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:
|
This was referenced Feb 23, 2026
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.
TestImportTopologicalSortStableAcrossRuns)getCustomJobsDependingOnPreActivation: sort result ofFilterMapKeysbefore returninggetReferencedCustomJobs: sort result ofFilterMapKeysbefore returningbuildMainJob: collect sorted job names fromdata.Jobsmap before iterating to builddependsmake fmtto ensure formatting is correctOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.