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

Refactor: Change Plugin Architecture #306

Open
nishakm opened this issue Sep 18, 2023 · 2 comments
Open

Refactor: Change Plugin Architecture #306

nishakm opened this issue Sep 18, 2023 · 2 comments
Assignees
Labels
refactor Code refactor tech debt Technical Debt

Comments

@nishakm
Copy link
Collaborator

nishakm commented Sep 18, 2023

Summary

Update the project's plugin architecture to use actual compile-time Go plugins

Background

The project's current Plugin setup does not actually allow other tools to "plug-in". database/sql is an example of the "plugin" pattern implemented in Go. This example explains how the pattern is implemented.

This implementation allows us to do the following:

  • Clearly define the goal of the project
  • Allow the parsers project to be developed independent of this project
  • Allow other tools to use the project to generate SPDX SBOMs

Project goal

The goal of the project is currently ambiguous. It should be concretely to "generate SPDX SBOMs given data about software". From this statement, we can separate the "data" from the "generation". Hence the Plugin should allow for independent implementers to provide this data in a particular way.

The overall architecture should look like this:
sbomgen-plugin-arch-1

Now we can concentrate on the architecture of the Plugin Interface and the Generation part.

Proposed architecture

The project goal is to support SPDX specification 2.3 onwards and 3.0 onwards. The two data models are significantly different. In order to support future data models and scenarios, the proposal is to create Plugin Interface that returns a generic SPDX data struct with its corresponding version. The implementation of creating the SPDX data struct for each version then falls on Plugin implementers.

Currently SPDX's golang-tools provides some structs which we can enforce implementers provide.

@nishakm nishakm added tech debt Technical Debt refactor Code refactor labels Sep 18, 2023
@nishakm
Copy link
Collaborator Author

nishakm commented Sep 18, 2023

@ba11b0y I'll be using this space to document thoughts about how to implement the Plugin interface.

@nishakm
Copy link
Collaborator Author

nishakm commented Sep 20, 2023

@puerco's proposed changes #294

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Code refactor tech debt Technical Debt
Projects
None yet
Development

No branches or pull requests

2 participants