Skip to content
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 output ordering deterministic #182

Closed
michaelkedar opened this issue Feb 3, 2023 · 1 comment · Fixed by #220
Closed

Make output ordering deterministic #182

michaelkedar opened this issue Feb 3, 2023 · 1 comment · Fixed by #220
Labels
enhancement New feature or request

Comments

@michaelkedar
Copy link
Member

michaelkedar commented Feb 3, 2023

Currently, it looks like the order of the package source files (in every output format) can change between runs.

e.g.

# Output 1
╭─────────────────────────────────────┬───────────┬──────────────────────────┬─────────┬────────────────────╮
│ OSV URL (ID IN BOLD)                │ ECOSYSTEM │ PACKAGE                  │ VERSION │ SOURCE             │
├─────────────────────────────────────┼───────────┼──────────────────────────┼─────────┼────────────────────┤
│ https://osv.dev/GHSA-m5pq-gvj9-9vr8 │ crates.io │ regex                    │ 1.3.1   │ path/to/Cargo.lock │
│ https://osv.dev/RUSTSEC-2022-0013   │           │                          │         │                    │
│ https://osv.dev/GHSA-c3h9-896r-86jm │ Go        │ github.com/gogo/protobuf │ 1.3.1   │ path/to/go.mod     │
│ https://osv.dev/GO-2021-0053        │           │                          │         │                    │
╰─────────────────────────────────────┴───────────┴──────────────────────────┴─────────┴────────────────────╯

# Output 2
╭─────────────────────────────────────┬───────────┬──────────────────────────┬─────────┬────────────────────╮
│ OSV URL (ID IN BOLD)                │ ECOSYSTEM │ PACKAGE                  │ VERSION │ SOURCE             │
├─────────────────────────────────────┼───────────┼──────────────────────────┼─────────┼────────────────────┤
│ https://osv.dev/GHSA-c3h9-896r-86jm │ Go        │ github.com/gogo/protobuf │ 1.3.1   │ path/to/go.mod     │
│ https://osv.dev/GO-2021-0053        │           │                          │         │                    │
│ https://osv.dev/GHSA-m5pq-gvj9-9vr8 │ crates.io │ regex                    │ 1.3.1   │ path/to/Cargo.lock │
│ https://osv.dev/RUSTSEC-2022-0013   │           │                          │         │                    │
╰─────────────────────────────────────┴───────────┴──────────────────────────┴─────────┴────────────────────╯

(this can also happen in the json output)

From what I can tell, this only affects the ordering of package sources - the ordering of packages from a source, and vulnerabilities in a package seem to be consistent between runs.

@oliverchang
Copy link
Collaborator

+1 thanks for filing this. We should make this more deterministic for easy comparisons between runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants