Skip to content

Normalize cataloger configuration patterns#2365

Merged
wagoodman merged 2 commits intomainfrom
return-cataloger-interface
Nov 28, 2023
Merged

Normalize cataloger configuration patterns#2365
wagoodman merged 2 commits intomainfrom
return-cataloger-interface

Conversation

@wagoodman
Copy link
Copy Markdown
Contributor

@wagoodman wagoodman commented Nov 28, 2023

This PR ensures the following is true amongst all catalogers:

  • Constructors return pkg.Cataloger interfaces over instances
  • Any config structs expose options to json marshallers and to anyone to set values plainly
  • Configs follow similar naming convention (e.g. *CatalogerConfig)
  • Default config constructors are present and are named similarly (e.g. Default*CatalogerConfig)

This also adds a common struct for any cataloger within syft/cataloging, which will be more heavily used in #1383 .

The breaking change made in this PR is renaming existing cataloger option structs within the java and golang packages.

(This work was broken off of PR #1383)

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman added the breaking-change Change is not backwards compatible label Nov 28, 2023
@wagoodman wagoodman requested a review from a team November 28, 2023 15:42
Copy link
Copy Markdown
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 except the use of "central", unless I'm misunderstanding it

Comment thread syft/pkg/cataloger/java/config.go Outdated
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@github-actions github-actions Bot removed the breaking-change Change is not backwards compatible label Nov 28, 2023
@wagoodman wagoodman enabled auto-merge (squash) November 28, 2023 16:52
@wagoodman wagoodman merged commit 1cfc4c7 into main Nov 28, 2023
@wagoodman wagoodman deleted the return-cataloger-interface branch November 28, 2023 17:02
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
* normalize cataloger patterns

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* remove central reference for maven configurable

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

---------

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
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.

2 participants