Skip to content

feat: use the SCI layer2 module for the cmd CLI #284

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

trumant
Copy link
Contributor

@trumant trumant commented May 1, 2025

This PR removes duplication of the layer2 code
from revanite-io/sci in favor of simply using that module directly.

This PR also changes our YAML dependency as the prior one used is now archived and no longer maintained.

SecurityCRob
SecurityCRob previously approved these changes May 1, 2025
@SecurityCRob
Copy link
Contributor

Are we interested in making the change from assessment-requirements to requirements? I'm glad to go through files and make changes if the group agrees.

@trumant
Copy link
Contributor Author

trumant commented May 1, 2025

Are we interested in making the change from assessment-requirements to requirements? I'm glad to go through files and make changes if the group agrees.

In this particular case, I believe the change should probably happen in SCI, because of:

From my perspective, this is more motivation to ensure that the go types for Layer 2 are generated based on the schema, so they cannot fall out of sync with one another.

That said, since the baseline YAML files do not contain a schema reference to the version of the SCI layer 2 schema in use, its hard to pin down.

In short, this is good feedback for the SCI project and can help us mature it

@funnelfiasco funnelfiasco added the go Pull requests that update Go code label May 1, 2025
Copy link
Contributor

@funnelfiasco funnelfiasco left a comment

Choose a reason for hiding this comment

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

Thanks for making this better, @trumant! Nack-ing for now so that we don't accidentally merge this too soon.

I think the overall approach is good, but it will also require an update to template-checklist.md and to README.md to reflect the changed name of the fields. Plus the open discussion items.

trumant added a commit to trumant/sci that referenced this pull request May 1, 2025
This PR introduces generation of Layer 2 go struct
types using `cue exp gengotypes`.

This change will ensure that all changes made to
the `schemas/layer-2.cue` will be reflected in the
go types without manual maintenance effort.

This should help reduce the occurrence of bugs like
those noted in ossf/security-baseline#284

This PR updates revanite-io#22

Signed-off-by: Travis Truman <[email protected]>
@trumant trumant force-pushed the use-sci-for-catalog-manipulation branch from 1477772 to 4750975 Compare May 1, 2025 16:13
trumant added a commit to revanite-io/sci that referenced this pull request May 6, 2025
* feat: generate layer 2 go types from cue schema

This PR introduces generation of Layer 2 go struct
types using `cue exp gengotypes`.

This change will ensure that all changes made to
the `schemas/layer-2.cue` will be reflected in the
go types without manual maintenance effort.

This should help reduce the occurrence of bugs like
those noted in ossf/security-baseline#284

This PR updates #22

Signed-off-by: Travis Truman <[email protected]>

* docs: rm misleading doc section

Signed-off-by: Travis Truman <[email protected]>

---------

Signed-off-by: Travis Truman <[email protected]>
@trumant trumant force-pushed the use-sci-for-catalog-manipulation branch 4 times, most recently from ed2a116 to c90cfbc Compare May 6, 2025 15:58
@trumant
Copy link
Contributor Author

trumant commented May 6, 2025

Are we interested in making the change from assessment-requirements to requirements? I'm glad to go through files and make changes if the group agrees.

I've made these changes within this PR

@trumant trumant force-pushed the use-sci-for-catalog-manipulation branch from c90cfbc to 31d77bb Compare May 6, 2025 16:37
@trumant
Copy link
Contributor Author

trumant commented May 6, 2025

Thanks for making this better, @trumant! Nack-ing for now so that we don't accidentally merge this too soon.

I think the overall approach is good, but it will also require an update to template-checklist.md and to README.md to reflect the changed name of the fields. Plus the open discussion items.

Thanks for the reminder on those additional required changes. They have now been made.

@trumant trumant marked this pull request as ready for review May 6, 2025 16:46
@trumant trumant requested a review from funnelfiasco May 6, 2025 19:04
funnelfiasco
funnelfiasco previously approved these changes May 6, 2025
Copy link
Contributor

@funnelfiasco funnelfiasco left a comment

Choose a reason for hiding this comment

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

Looks good to me! In addition to the CI checks, I ran it manually and published it to my fork and everything seems good. And it's a net reduction of 51 lines! 🎉

eddie-knight
eddie-knight previously approved these changes May 7, 2025
Copy link
Contributor

@eddie-knight eddie-knight left a comment

Choose a reason for hiding this comment

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

This is excellent @trumant 🔥

And @funnelfiasco thanks for testing locally so that I can just review the code changes here ✊

@trumant trumant dismissed stale reviews from eddie-knight and funnelfiasco via 90801e4 May 7, 2025 15:19
@trumant trumant force-pushed the use-sci-for-catalog-manipulation branch 2 times, most recently from 90801e4 to a27283e Compare May 7, 2025 15:19
This PR removes duplication of the layer2 code
from revanite-io/sci in favor of simply using that
module directly.

Signed-off-by: Travis Truman <[email protected]>
@trumant trumant force-pushed the use-sci-for-catalog-manipulation branch from a27283e to 8051b6b Compare May 8, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants