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

fix: determine upstream for apk version streams #1610

Merged
merged 1 commit into from
Feb 23, 2023

Conversation

westonsteimel
Copy link
Contributor

Determines better upstream package name for version-stream apk packages:

Examples:

  • postgresql-13 -> postgresql
  • postgresql15 -> postgresql
  • go-1.19 -> go
  • perl100.55 -> perl

Determines better upstream package name for version-stream apk packages:

Examples:

- postgresql-13 -> postgresql
- postgresql15 -> postgresql
- go-1.19 -> go
- perl100.55 -> perl

Signed-off-by: Weston Steimel <weston.steimel@anchore.com>
@github-actions
Copy link

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 8272CL CPU @ 2.60GHz
                                                          │ ./.tmp/benchmark-c0a3644.txt │
                                                          │            sec/op            │
ImagePackageCatalogers/alpmdb-cataloger-2                                   11.87m ± 19%
ImagePackageCatalogers/ruby-gemspec-cataloger-2                             891.6µ ±  1%
ImagePackageCatalogers/python-package-cataloger-2                           3.056m ±  3%
ImagePackageCatalogers/php-composer-installed-cataloger-2                   698.4µ ±  1%
ImagePackageCatalogers/javascript-package-cataloger-2                       376.2µ ±  3%
ImagePackageCatalogers/dpkgdb-cataloger-2                                   521.4µ ±  3%
ImagePackageCatalogers/rpm-db-cataloger-2                                   495.7µ ±  1%
ImagePackageCatalogers/java-cataloger-2                                     11.27m ±  1%
ImagePackageCatalogers/graalvm-native-image-cataloger-2                     8.640µ ±  5%
ImagePackageCatalogers/apkdb-cataloger-2                                    521.9µ ±  1%
ImagePackageCatalogers/go-module-binary-cataloger-2                         18.97µ ±  2%
ImagePackageCatalogers/dotnet-deps-cataloger-2                              999.1µ ±  2%
ImagePackageCatalogers/portage-cataloger-2                                  324.2µ ±  3%
ImagePackageCatalogers/sbom-cataloger-2                                     105.6µ ±  0%
ImagePackageCatalogers/binary-cataloger-2                                   143.0µ ±  2%
geomean                                                                     465.3µ

                                                          │ ./.tmp/benchmark-c0a3644.txt │
                                                          │             B/op             │
ImagePackageCatalogers/alpmdb-cataloger-2                                   5.060Mi ± 0%
ImagePackageCatalogers/ruby-gemspec-cataloger-2                             141.8Ki ± 0%
ImagePackageCatalogers/python-package-cataloger-2                           946.6Ki ± 0%
ImagePackageCatalogers/php-composer-installed-cataloger-2                   156.0Ki ± 0%
ImagePackageCatalogers/javascript-package-cataloger-2                       95.80Ki ± 0%
ImagePackageCatalogers/dpkgdb-cataloger-2                                   144.7Ki ± 0%
ImagePackageCatalogers/rpm-db-cataloger-2                                   170.4Ki ± 0%
ImagePackageCatalogers/java-cataloger-2                                     2.721Mi ± 0%
ImagePackageCatalogers/graalvm-native-image-cataloger-2                     1.523Ki ± 0%
ImagePackageCatalogers/apkdb-cataloger-2                                    123.1Ki ± 0%
ImagePackageCatalogers/go-module-binary-cataloger-2                         3.102Ki ± 0%
ImagePackageCatalogers/dotnet-deps-cataloger-2                              314.7Ki ± 0%
ImagePackageCatalogers/portage-cataloger-2                                  75.46Ki ± 0%
ImagePackageCatalogers/sbom-cataloger-2                                     13.04Ki ± 0%
ImagePackageCatalogers/binary-cataloger-2                                   20.82Ki ± 0%
geomean                                                                     106.8Ki

                                                          │ ./.tmp/benchmark-c0a3644.txt │
                                                          │          allocs/op           │
ImagePackageCatalogers/alpmdb-cataloger-2                                    86.71k ± 0%
ImagePackageCatalogers/ruby-gemspec-cataloger-2                              2.159k ± 0%
ImagePackageCatalogers/python-package-cataloger-2                            15.48k ± 0%
ImagePackageCatalogers/php-composer-installed-cataloger-2                    3.457k ± 0%
ImagePackageCatalogers/javascript-package-cataloger-2                        1.253k ± 0%
ImagePackageCatalogers/dpkgdb-cataloger-2                                    2.646k ± 0%
ImagePackageCatalogers/rpm-db-cataloger-2                                    3.759k ± 0%
ImagePackageCatalogers/java-cataloger-2                                      38.26k ± 0%
ImagePackageCatalogers/graalvm-native-image-cataloger-2                       40.00 ± 0%
ImagePackageCatalogers/apkdb-cataloger-2                                     3.252k ± 0%
ImagePackageCatalogers/go-module-binary-cataloger-2                           101.0 ± 0%
ImagePackageCatalogers/dotnet-deps-cataloger-2                               5.011k ± 0%
ImagePackageCatalogers/portage-cataloger-2                                   1.487k ± 0%
ImagePackageCatalogers/sbom-cataloger-2                                       392.0 ± 0%
ImagePackageCatalogers/binary-cataloger-2                                     627.0 ± 0%
geomean                                                                      2.175k

@westonsteimel westonsteimel requested a review from a team February 23, 2023 14:41
@westonsteimel westonsteimel merged commit 0c05855 into main Feb 23, 2023
@westonsteimel westonsteimel deleted the apk-upstream-determination-improvements branch February 23, 2023 17:32
@kzantow kzantow added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request labels Mar 2, 2023
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
Determines better upstream package name for version-stream apk packages:

Examples:

- postgresql-13 -> postgresql
- postgresql15 -> postgresql
- go-1.19 -> go
- perl100.55 -> perl

Signed-off-by: Weston Steimel <weston.steimel@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