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

add flag to toggle getting deps.dev dependencies #1382

Merged
merged 4 commits into from Oct 13, 2023

Conversation

mdeicas
Copy link
Collaborator

@mdeicas mdeicas commented Oct 10, 2023

Description of the PR

Adds the flag retrieve-deps to guaccollect. When set to false, the deps.dev collector only queries for metadata (scorecard and source) and not for dependencies. The default setting is true.

Also, a log message (level info) was added to log when the dependencies for a package are retrieved.

Fixes #1359.

Behavior

After starting Guac and ingesting an SBOM, running guaccollect deps_dev --retrieve-dependencies=false does not lead to any new IsDependency nodes appearing and results in logs look like

{"level":"info","ts":1696975519.9959376,"caller":"deps_dev/deps_dev.go:197","msg":"obtained additional metadata for package: pkg:golang/4d63.com/gocheckcompilerdirectives@v1.2.1"}
{"level":"info","ts":1696975520.0867465,"caller":"deps_dev/deps_dev.go:197","msg":"obtained additional metadata for package: pkg:golang/4d63.com/gochecknoglobals@v0.2.1"}
{"level":"info","ts":1696975520.166465,"caller":"deps_dev/deps_dev.go:197","msg":"obtained additional metadata for package: pkg:golang/github.com/4meepo/tagalign@v1.3.2"}
{"level":"info","ts":1696975520.2557125,"caller":"deps_dev/deps_dev.go:197","msg":"obtained additional metadata for package: pkg:golang/github.com/Abirdcfly/dupword@v0.0.12"}
...

Running guaccollect deps_dev instead results in the normal expected behavior: dependencies are ingested and the logs indicate both metadata and dependency retrievals.

PR Checklist

  • All commits have a Developer Certificate of Origin (DCO) -- they are generated using -s flag to git commit.
  • All new changes are covered by tests
  • All CI checks are passing (tests and formatting)

Copy link
Collaborator

@pxp928 pxp928 left a comment

Choose a reason for hiding this comment

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

Overall looks good! Just a comment to maybe speed up the retrieval process.

pkg/handler/collector/deps_dev/deps_dev.go Outdated Show resolved Hide resolved
pkg/handler/collector/deps_dev/deps_dev.go Outdated Show resolved Hide resolved
cmd/guaccollect/cmd/root.go Outdated Show resolved Hide resolved
Copy link
Contributor

@naveensrinivasan naveensrinivasan left a comment

Choose a reason for hiding this comment

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

@mdeicas This is cool! Thanks for taking the feedback and reusing the existing code.

@pxp928
Copy link
Collaborator

pxp928 commented Oct 13, 2023

@mdeicas just need a rebase

Signed-off-by: Marco Deicas <mdeicas@google.com>
Signed-off-by: Marco Deicas <mdeicas@google.com>
Signed-off-by: Marco Deicas <mdeicas@google.com>
Signed-off-by: Marco Deicas <mdeicas@google.com>
@kodiakhq kodiakhq bot merged commit c225a8e into guacsec:main Oct 13, 2023
9 checks passed
@mdeicas mdeicas deleted the deps-flag branch October 23, 2023 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a flag to disable pulling in dependencies from deps.dev
4 participants