Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore: code cleanup #1865

Merged
merged 8 commits into from
Jun 5, 2023
Merged

chore: code cleanup #1865

merged 8 commits into from
Jun 5, 2023

Conversation

spiffcs
Copy link
Contributor

@spiffcs spiffcs commented Jun 5, 2023

@testwill I've kept your commits so you get credit for the branch and work - I just could not push to your WIP since it was testwill:main. Apologies for the confusion here.

I had to revert the XCOFF changes - there is some subtle difference why we're not using io for this file yet. It was lifted directly from the Golang source code since it's under an internal directory. Their updated version uses io, but leans on another internal library called saferio so make the ReadFile call behave correctly.

testwill and others added 7 commits May 23, 2023 10:00
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
* main: (21 commits)
  chore(deps): bump github.com/sirupsen/logrus from 1.9.2 to 1.9.3 (#1862)
  chore(deps): bump modernc.org/sqlite from 1.22.1 to 1.23.0 (#1863)
  feat: source-version flag (#1859)
  chore(deps): bump github.com/spf13/viper from 1.15.0 to 1.16.0 (#1851)
  accept main.version ldflags even without vcs (#1855)
  feat: add scope to pom properties (#1779)
  chore(deps): bump github.com/stretchr/testify from 1.8.3 to 1.8.4 (#1852)
  chore(deps): bump github.com/docker/docker (#1849)
  Add test to ensure package metadata is represented in the JSON schema (#1841)
  Fix directory resolver to consider CWD and root path input correctly (#1840)
  Migrate location-related structs to the file package (#1751)
  chore(deps): bump github.com/go-git/go-git/v5 from 5.6.1 to 5.7.0 (#1843)
  fix: add panic recovery for license parse (#1839)
  chore: return both failures when failed to retrieve an image with a scheme (#1801)
  Extract go module versions from ldflags for binaries built by go (#1832)
  fix: duplicate packages, support pnpm lockfile v6 (#1778)
  chore(deps): update stereoscope to e14bc4437b2eac481c5b6f101890b22df4f33596 (#1834)
  chore(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.3 (#1829)
  chore(deps): bump github.com/docker/docker (#1833)
  Keep original FileInfo persisted on file.Metadata structs (#1794)
  ...

Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
@spiffcs spiffcs marked this pull request as ready for review June 5, 2023 16:35
@spiffcs spiffcs requested a review from kzantow June 5, 2023 16:35
@github-actions
Copy link

github-actions bot commented Jun 5, 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) CPU E5-2673 v4 @ 2.30GHz%0A                                                          │ ./.tmp/benchmark-72499a7.txt │%0A                                                          │            sec/op            │%0AImagePackageCatalogers/alpmdb-cataloger-2                                   13.95m ±  4%25%0AImagePackageCatalogers/apkdb-cataloger-2                                    879.7µ ±  7%25%0AImagePackageCatalogers/binary-cataloger-2                                   255.7µ ±  6%25%0AImagePackageCatalogers/dpkgdb-cataloger-2                                   781.9µ ±  8%25%0AImagePackageCatalogers/dotnet-deps-cataloger-2                              1.526m ±  6%25%0AImagePackageCatalogers/go-module-binary-cataloger-2                         138.1µ ±  7%25%0AImagePackageCatalogers/java-cataloger-2                                     17.82m ± 16%25%0AImagePackageCatalogers/graalvm-native-image-cataloger-2                     130.9µ ± 19%25%0AImagePackageCatalogers/javascript-package-cataloger-2                       536.9µ ±  5%25%0AImagePackageCatalogers/nix-store-cataloger-2                                376.7µ ±  5%25%0AImagePackageCatalogers/php-composer-installed-cataloger-2                   1.011m ±  5%25%0AImagePackageCatalogers/portage-cataloger-2                                  638.7µ ±  8%25%0AImagePackageCatalogers/python-package-cataloger-2                           4.095m ±  8%25%0AImagePackageCatalogers/r-package-cataloger-2                                279.9µ ± 10%25%0AImagePackageCatalogers/rpm-db-cataloger-2                                   650.3µ ± 12%25%0AImagePackageCatalogers/ruby-gemspec-cataloger-2                             1.213m ± 12%25%0AImagePackageCatalogers/sbom-cataloger-2                                     159.1µ ±  6%25%0Ageomean                                                                     800.3µ%0A%0A                                                          │ ./.tmp/benchmark-72499a7.txt │%0A                                                          │             B/op             │%0AImagePackageCatalogers/alpmdb-cataloger-2                                   5.129Mi ± 0%25%0AImagePackageCatalogers/apkdb-cataloger-2                                    204.9Ki ± 0%25%0AImagePackageCatalogers/binary-cataloger-2                                   30.17Ki ± 0%25%0AImagePackageCatalogers/dpkgdb-cataloger-2                                   168.8Ki ± 0%25%0AImagePackageCatalogers/dotnet-deps-cataloger-2                              404.3Ki ± 0%25%0AImagePackageCatalogers/go-module-binary-cataloger-2                         9.906Ki ± 0%25%0AImagePackageCatalogers/java-cataloger-2                                     2.826Mi ± 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.14Ki ± 0%25%0AImagePackageCatalogers/php-composer-installed-cataloger-2                   186.5Ki ± 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.29Ki ± 0%25%0AImagePackageCatalogers/rpm-db-cataloger-2                                   180.9Ki ± 0%25%0AImagePackageCatalogers/ruby-gemspec-cataloger-2                             144.1Ki ± 0%25%0AImagePackageCatalogers/sbom-cataloger-2                                     14.20Ki ± 0%25%0Ageomean                                                                     132.7Ki%0A%0A                                                          │ ./.tmp/benchmark-72499a7.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.000k ± 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.88k ± 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.269k ± 0%25%0AImagePackageCatalogers/python-package-cataloger-2                            16.44k ± 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.448k ± 0%25%0AImagePackageCatalogers/sbom-cataloger-2                                       394.0 ± 0%25%0Ageomean                                                                      2.583k

@spiffcs spiffcs mentioned this pull request Jun 5, 2023
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.

One note about a t.Cleanup that I think can be removed

syft/source/source_test.go Outdated Show resolved Hide resolved
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
@spiffcs spiffcs enabled auto-merge (squash) June 5, 2023 16:59
@spiffcs spiffcs changed the title Pr 1825 chore: code cleanup Jun 5, 2023
@spiffcs spiffcs merged commit f07581f into main Jun 5, 2023
@spiffcs spiffcs deleted the pr-1825 branch June 5, 2023 17:01
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
chore: code cleanup

Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>

---------

Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Co-authored-by: guoguangwu <guoguangwu@magic-shield.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants