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

Always set the package ID for java packages #1493

Merged
merged 1 commit into from
Jan 20, 2023
Merged

Conversation

wagoodman
Copy link
Contributor

Today there are several instances of package IDs not being set by the time they reach the package catalog. This isn't good since it's the package catalogers role to do this. This PR adjusts the java package cataloger to call SetID() on all packages before returning the results (since the packages may be mutated after creation, this is the safest option).

@wagoodman wagoodman added the bug Something isn't working label Jan 19, 2023
@github-actions
Copy link

github-actions bot commented Jan 19, 2023

Benchmark Test Results

Benchmark results from the latest changes vs base branch
goos: linux
goarch: amd64
pkg: github.com/anchore/syft/test/integration
cpu: Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz
                                                          │ ./.tmp/benchmark-f3b777a.txt │
                                                          │            sec/op            │
ImagePackageCatalogers/alpmdb-cataloger-2                                   15.08m ± 20%
ImagePackageCatalogers/ruby-gemspec-cataloger-2                             1.651m ±  3%
ImagePackageCatalogers/python-package-cataloger-2                           4.253m ±  4%
ImagePackageCatalogers/php-composer-installed-cataloger-2                   1.369m ±  2%
ImagePackageCatalogers/javascript-package-cataloger-2                       971.6µ ±  2%
ImagePackageCatalogers/dpkgdb-cataloger-2                                   1.124m ±  3%
ImagePackageCatalogers/rpm-db-cataloger-2                                   1.612m ±  2%
ImagePackageCatalogers/java-cataloger-2                                     17.71m ±  5%
ImagePackageCatalogers/graalvm-native-image-cataloger-2                     8.518µ ±  4%
ImagePackageCatalogers/apkdb-cataloger-2                                    1.122m ±  3%
ImagePackageCatalogers/go-module-binary-cataloger-2                         18.05µ ±  2%
ImagePackageCatalogers/dotnet-deps-cataloger-2                              1.763m ±  2%
ImagePackageCatalogers/portage-cataloger-2                                  936.7µ ±  2%
ImagePackageCatalogers/sbom-cataloger-2                                     5.691m ±  4%
ImagePackageCatalogers/binary-cataloger-2                                   8.110m ±  7%
geomean                                                                     1.313m

                                                          │ ./.tmp/benchmark-f3b777a.txt │
                                                          │             B/op             │
ImagePackageCatalogers/alpmdb-cataloger-2                                   5.041Mi ± 0%
ImagePackageCatalogers/ruby-gemspec-cataloger-2                             204.6Ki ± 0%
ImagePackageCatalogers/python-package-cataloger-2                           953.2Ki ± 0%
ImagePackageCatalogers/php-composer-installed-cataloger-2                   217.4Ki ± 0%
ImagePackageCatalogers/javascript-package-cataloger-2                       158.4Ki ± 0%
ImagePackageCatalogers/dpkgdb-cataloger-2                                   200.2Ki ± 0%
ImagePackageCatalogers/rpm-db-cataloger-2                                   300.2Ki ± 0%
ImagePackageCatalogers/java-cataloger-2                                     3.373Mi ± 0%
ImagePackageCatalogers/graalvm-native-image-cataloger-2                     1.375Ki ± 0%
ImagePackageCatalogers/apkdb-cataloger-2                                    181.9Ki ± 0%
ImagePackageCatalogers/go-module-binary-cataloger-2                         1.809Ki ± 0%
ImagePackageCatalogers/dotnet-deps-cataloger-2                              378.0Ki ± 0%
ImagePackageCatalogers/portage-cataloger-2                                  137.9Ki ± 0%
ImagePackageCatalogers/sbom-cataloger-2                                     724.4Ki ± 0%
ImagePackageCatalogers/binary-cataloger-2                                   1.028Mi ± 0%
geomean                                                                     219.2Ki

                                                          │ ./.tmp/benchmark-f3b777a.txt │
                                                          │          allocs/op           │
ImagePackageCatalogers/alpmdb-cataloger-2                                    85.84k ± 0%
ImagePackageCatalogers/ruby-gemspec-cataloger-2                              4.347k ± 0%
ImagePackageCatalogers/python-package-cataloger-2                            16.81k ± 0%
ImagePackageCatalogers/php-composer-installed-cataloger-2                    5.600k ± 0%
ImagePackageCatalogers/javascript-package-cataloger-2                        3.429k ± 0%
ImagePackageCatalogers/dpkgdb-cataloger-2                                    4.572k ± 0%
ImagePackageCatalogers/rpm-db-cataloger-2                                    8.312k ± 0%
ImagePackageCatalogers/java-cataloger-2                                      58.85k ± 0%
ImagePackageCatalogers/graalvm-native-image-cataloger-2                       32.00 ± 0%
ImagePackageCatalogers/apkdb-cataloger-2                                     5.328k ± 0%
ImagePackageCatalogers/go-module-binary-cataloger-2                           55.00 ± 0%
ImagePackageCatalogers/dotnet-deps-cataloger-2                               7.203k ± 0%
ImagePackageCatalogers/portage-cataloger-2                                   3.680k ± 0%
ImagePackageCatalogers/sbom-cataloger-2                                      25.31k ± 0%
ImagePackageCatalogers/binary-cataloger-2                                    36.81k ± 0%
geomean                                                                      5.244k

@wagoodman wagoodman enabled auto-merge (squash) January 19, 2023 23:26
@wagoodman wagoodman enabled auto-merge (squash) January 20, 2023 00:30
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
@wagoodman wagoodman merged commit 972e4cd into main Jan 20, 2023
@wagoodman wagoodman deleted the set-id-java-pkgs branch January 20, 2023 14:18
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants