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: "or-later" suffix updated to consider deprecated "+" operator #1907

Merged
merged 5 commits into from
Jul 11, 2023

Conversation

spiffcs
Copy link
Contributor

@spiffcs spiffcs commented Jun 29, 2023

Summary

Fixes #1899

If a given license has the suffix "or-later" it previously could have been considered or represented with a "+".

Example "GFDL-1.0-or-later" could have been represented as "GFDL-1.0+" in the past. This PR allows the license list generation to consider or-later as == to + when generating permutations for upgrading deprecated licenses.

Note

The case assert.Equal(t, "GPL-2.0-or-later", licenseIDs["gpl2+"]) was considered previously because gpl2+ was explicitly included in the SPDX license list as a deprecated license.

This fix is for deprecated licenses that do NOT exist in the json data we read from the SPDX license list publisher.

If a given license has the suffix "or-later" it previously could have
been considered or represented with a "+". Example "GFDL-1.0-or-later"
could have been represented as "GFDL-1.0+". This PR allows the license
list generation to consider "or-later" as == to "+" when generating
permutations for upgrading deprecated licenses.

Signed-off-by: Christopher Phillips <[email protected]>
@github-actions
Copy link

github-actions bot commented Jun 29, 2023

Benchmark Test Results

Benchmark results from the latest changes vs base branch
goos: linux%0Agoarch: amd64%0Apkg: github.com/anchore/syft/test/integration%0Acpu: Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz%0A                                                          │ ./.tmp/benchmark-8862d2a.txt │%0A                                                          │            sec/op            │%0AImagePackageCatalogers/alpmdb-cataloger-2                                   15.23m ±  7%25%0AImagePackageCatalogers/apkdb-cataloger-2                                    923.2µ ±  5%25%0AImagePackageCatalogers/binary-cataloger-2                                   244.9µ ±  3%25%0AImagePackageCatalogers/dpkgdb-cataloger-2                                   768.4µ ±  4%25%0AImagePackageCatalogers/dotnet-deps-cataloger-2                              1.578m ±  2%25%0AImagePackageCatalogers/go-module-binary-cataloger-2                         114.0µ ±  1%25%0AImagePackageCatalogers/java-cataloger-2                                     16.91m ±  2%25%0AImagePackageCatalogers/graalvm-native-image-cataloger-2                     111.0µ ± 15%25%0AImagePackageCatalogers/javascript-package-cataloger-2                       516.4µ ±  3%25%0AImagePackageCatalogers/nix-store-cataloger-2                                350.4µ ±  2%25%0AImagePackageCatalogers/php-composer-installed-cataloger-2                   1.023m ±  4%25%0AImagePackageCatalogers/portage-cataloger-2                                  619.6µ ±  3%25%0AImagePackageCatalogers/python-package-cataloger-2                           4.293m ±  6%25%0AImagePackageCatalogers/r-package-cataloger-2                                258.7µ ±  4%25%0AImagePackageCatalogers/rpm-db-cataloger-2                                   715.9µ ±  9%25%0AImagePackageCatalogers/ruby-gemspec-cataloger-2                             1.206m ±  3%25%0AImagePackageCatalogers/sbom-cataloger-2                                     147.1µ ±  5%25%0Ageomean                                                                     779.4µ%0A%0A                                                          │ ./.tmp/benchmark-8862d2a.txt │%0A                                                          │             B/op             │%0AImagePackageCatalogers/alpmdb-cataloger-2                                   5.117Mi ± 0%25%0AImagePackageCatalogers/apkdb-cataloger-2                                    205.0Ki ± 0%25%0AImagePackageCatalogers/binary-cataloger-2                                   30.19Ki ± 0%25%0AImagePackageCatalogers/dpkgdb-cataloger-2                                   168.9Ki ± 0%25%0AImagePackageCatalogers/dotnet-deps-cataloger-2                              405.2Ki ± 0%25%0AImagePackageCatalogers/go-module-binary-cataloger-2                         9.906Ki ± 0%25%0AImagePackageCatalogers/java-cataloger-2                                     2.825Mi ± 0%25%0AImagePackageCatalogers/graalvm-native-image-cataloger-2                     8.594Ki ± 0%25%0AImagePackageCatalogers/javascript-package-cataloger-2                       100.9Ki ± 0%25%0AImagePackageCatalogers/nix-store-cataloger-2                                49.13Ki ± 0%25%0AImagePackageCatalogers/php-composer-installed-cataloger-2                   186.7Ki ± 0%25%0AImagePackageCatalogers/portage-cataloger-2                                  119.9Ki ± 0%25%0AImagePackageCatalogers/python-package-cataloger-2                           1.003Mi ± 0%25%0AImagePackageCatalogers/r-package-cataloger-2                                53.30Ki ± 0%25%0AImagePackageCatalogers/rpm-db-cataloger-2                                   180.9Ki ± 0%25%0AImagePackageCatalogers/ruby-gemspec-cataloger-2                             144.0Ki ± 0%25%0AImagePackageCatalogers/sbom-cataloger-2                                     14.20Ki ± 0%25%0Ageomean                                                                     132.7Ki%0A%0A                                                          │ ./.tmp/benchmark-8862d2a.txt │%0A                                                          │          allocs/op           │%0AImagePackageCatalogers/alpmdb-cataloger-2                                    87.75k ± 0%25%0AImagePackageCatalogers/apkdb-cataloger-2                                     4.182k ± 0%25%0AImagePackageCatalogers/binary-cataloger-2                                     830.0 ± 0%25%0AImagePackageCatalogers/dpkgdb-cataloger-2                                    3.002k ± 0%25%0AImagePackageCatalogers/dotnet-deps-cataloger-2                               6.338k ± 0%25%0AImagePackageCatalogers/go-module-binary-cataloger-2                           281.0 ± 0%25%0AImagePackageCatalogers/java-cataloger-2                                      39.87k ± 0%25%0AImagePackageCatalogers/graalvm-native-image-cataloger-2                       228.0 ± 0%25%0AImagePackageCatalogers/javascript-package-cataloger-2                        1.404k ± 0%25%0AImagePackageCatalogers/nix-store-cataloger-2                                  895.0 ± 0%25%0AImagePackageCatalogers/php-composer-installed-cataloger-2                    4.079k ± 0%25%0AImagePackageCatalogers/portage-cataloger-2                                   2.268k ± 0%25%0AImagePackageCatalogers/python-package-cataloger-2                            16.45k ± 0%25%0AImagePackageCatalogers/r-package-cataloger-2                                  929.0 ± 0%25%0AImagePackageCatalogers/rpm-db-cataloger-2                                    3.989k ± 0%25%0AImagePackageCatalogers/ruby-gemspec-cataloger-2                              2.447k ± 0%25%0AImagePackageCatalogers/sbom-cataloger-2                                       394.0 ± 0%25%0Ageomean                                                                      2.583k

@spiffcs spiffcs marked this pull request as draft June 29, 2023 18:28
@spiffcs spiffcs changed the title fix: or-later suffix has been updated to consider deprecated + fix: "or-later" suffix has been updated to consider deprecated "+" operator Jun 29, 2023
@spiffcs spiffcs changed the title fix: "or-later" suffix has been updated to consider deprecated "+" operator fix: "or-later" suffix updated to consider deprecated "+" operator Jun 29, 2023
@spiffcs spiffcs added the enhancement New feature or request label Jun 29, 2023
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
@spiffcs spiffcs marked this pull request as ready for review July 11, 2023 16:06
Copy link
Contributor

@kzantow kzantow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

* main:
  feat: CLI flag for directory base (#1867)
  Fix CPE gen for k8s python client (#1921)
  chore: update iterations to protect against race (#1927)
  chore(deps): update bootstrap tools to latest versions (#1922)
  fix: Don't use the actual redis or grpc CPEs for gems (#1926)
  fix(install): return with right error code (#1915)
  Remove erroneous Java CPEs from generation (#1918)
  chore(deps): bump golang.org/x/net from 0.11.0 to 0.12.0 (#1916)
  Switch UI to bubbletea (#1888)
  fix: use filepath.EvalSymlinks if os.Readlink fails to evaluate the link (#1884)
  add file source digest support (#1914)
  chore(deps): update bootstrap tools to latest versions (#1908)
  chore(deps): bump golang.org/x/mod from 0.11.0 to 0.12.0 (#1912)
  chore(deps): bump golang.org/x/term from 0.9.0 to 0.10.0 (#1913)
  doc(readme): add installation section with scoop (#1909)
  Refactor source API (#1846)
  chore(deps): update bootstrap tools to latest versions (#1905)
@spiffcs
Copy link
Contributor Author

spiffcs commented Jul 11, 2023

Ahh - didn't merge into main to get my own race fix!

Signed-off-by: Christopher Phillips <[email protected]>
@spiffcs spiffcs enabled auto-merge (squash) July 11, 2023 16:14
@spiffcs spiffcs merged commit 72616db into main Jul 11, 2023
@spiffcs spiffcs deleted the 1899-deprecated-license-variant branch July 11, 2023 16:21
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
…nchore#1907)

* fix: or-later suffix has been updated to consider deprecated +

If a given license has the suffix "or-later" it previously could have
been considered or represented with a "+". Example "GFDL-1.0-or-later"
could have been represented as "GFDL-1.0+". This PR allows the license
list generation to consider "or-later" as == to "+" when generating
permutations for upgrading deprecated licenses.

---------

Signed-off-by: Christopher Phillips <[email protected]>
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 this pull request may close these issues.

Deprecated license: GFDL-1.2+
2 participants