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

chore(deps): merge go-dep-parser into Trivy #6094

Merged
merged 219 commits into from Feb 19, 2024

Conversation

knqyf263
Copy link
Collaborator

@knqyf263 knqyf263 commented Feb 9, 2024

Description

Merge go-dep-parser into Trivy

Issues

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

knqyf263 and others added 30 commits April 29, 2019 10:47
* test(cargo): to lower

* test(cargo): to lower
* Initial NuGet parser files, implemented test cases for three package sources.

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>

* Implemented parser, updated testcase to remove duplicated entries.

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>

* test(nuget): Added a test for multiple versions of the same package.

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>

* Cleanup of nuget parser (removal of comments which are not really needed).

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>

* Removed JSON mapping from nuget dependency struct (not needed as it's a read not write operation).

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>

* Added a test for legacy nuget packages (x.x.x.x - not semver versions).

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>

* Replaced old nuget test-files with new, generated from netcore image (added comments on generation steps).

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>

* Fixed nuget parsing algorithm to work the same way nuget works internally with package resolving.

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>

* Changed name of 'Dependencies' to 'Targets' in LockFile struct for nuget parser.

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>

* Wraped error in nuget parser with xerrors.

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>

* Updated nuget testdata for legacy packages and removed second loop for sub-packages, as they are added in top-level as Transitive type.

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>

* Replaced the complex file with a even more complex file (multi target!), updated parse to again use version.

Signed-off-by: Johannes Tegnér <johannes@jitesoft.com>

* refactor(nuget): simplify

Co-authored-by: knqyf263 <knqyf263@gmail.com>
* feat: support jar/war/ear

* feat(jar): support sha1 search

* fix: do not return when MANIFEST.INF is invalid

* feat: add log package

* feat: search by artifactId

* refactor: add runtime scope

* feat: support multiple pom.properties

* test: add test jar

* fix: use fileProps

* fix: replace '+' with ' '

* fix: return when artifactId or version are empty

* refactor(jar): add a debug message

* fix(log): use zap.SugaredLogger
* add support for go.sum (go-dep-parser#20)

* modify test cases

* keep pseudo version

* rewrite test with testify

* simplify semver parsing

* wrap errors

* go mod tidy
* make parser compatible with yaml2

* Fix linting
…rser#28)

* feat(JarParse) return errors other than no artifact found error

* feat(JarParse) fix review: return error by search sha1 network error

* fix(JarParse) change error message
…-parser#27)

Signed-off-by: Arunprasad Rajkumar <arajkuma@redhat.com>
* feat: use retryablehttp

* feat: configure logger

* feat(jar): increase retry wait

* fix(jar): skip variables

* test(jar): fix

* feat: accept only 200 ok

* feat(jar): suppress log messages
* changing base url to https

* changing base url to https

Co-authored-by: Sherif Fathalla <sfathall@akamai.com>
Co-authored-by: sherif <sherif.mailbox@gmail.com>
Co-authored-by: Ankush K <akhobragade@gmail.com>
Co-authored-by: Ankush K <akhobragade42@gmail.com>
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
Co-authored-by: Teppei Fukuda <knqyf263@gmail.com>
…ep-parser#40)

Co-authored-by: knqyf263 <knqyf263@gmail.com>
Co-authored-by: knqyf263 <knqyf263@gmail.com>
@knqyf263 knqyf263 self-assigned this Feb 9, 2024
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Copy link
Contributor

@nikpivkin nikpivkin left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@DmitriyLewen DmitriyLewen left a comment

Choose a reason for hiding this comment

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

LGTM.
Left some small comments.

pkg/log/logger.go Outdated Show resolved Hide resolved
pkg/dependency/parser/io/io.go Show resolved Hide resolved
pkg/dependency/parser/java/jar/sonatype/sonatype.go Outdated Show resolved Hide resolved
pkg/dependency/parser/types/types.go Outdated Show resolved Hide resolved
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Signed-off-by: knqyf263 <knqyf263@gmail.com>
Copy link
Contributor

@DmitriyLewen DmitriyLewen left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: knqyf263 <knqyf263@gmail.com>
@knqyf263 knqyf263 added this pull request to the merge queue Feb 19, 2024
Merged via the queue into aquasecurity:main with commit 74dc5b6 Feb 19, 2024
16 checks passed
@knqyf263 knqyf263 deleted the go-dep-parser branch February 19, 2024 11:37
@knqyf263
Copy link
Collaborator Author

I was supposed to keep git history, but the Trivy project allows only "squash and merge". I accidentally lost history of go-dep-parser😭

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

Successfully merging this pull request may close these issues.

refactor: Merging go-dep-parser into Trivy