-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sat reproducible #86
Conversation
16fba88
to
73c4e4a
Compare
This run shows the test failing before we sort the inputs to the SAT resolver
|
pkg/sat/sat.go
Outdated
@@ -146,8 +162,13 @@ func (r *Resolver) LoadInvolvedPackages(packages []*api.Package, ignoreRegex []s | |||
|
|||
if !r.nobest { | |||
packages = nil | |||
for _, v := range r.bestPackages { | |||
packages = append(packages, v) | |||
bestPackagesKeys := make([]string, 0, len(r.bestPackages)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use maps.Keys for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a go expert, so TIL about it, I'll make the change, it looks way cleaner
Reduce some tech debt by using cmp.Or instead of multi level ifs.
Will make use of slices.Sort and slices.SortFunc so we can sort dictionary keys before we send them to the sat resolver
Check if by making the input to sat stable the output is also stable
ed0a589
to
0b90edb
Compare
Make sure the sat solver output is deterministic and reproducible by making the input order stable
0b90edb
to
e9f6570
Compare
Looks good to me |
This PR will make the output of the sat resolver deterministic