Skip to content

Conversation

@bxf12315
Copy link
Contributor

No description provided.

@bxf12315 bxf12315 requested a review from mrizzi March 31, 2025 06:28
@bxf12315 bxf12315 force-pushed the license-clearly-defined branch from 63f2351 to 0224bef Compare April 1, 2025 06:57
@bxf12315 bxf12315 marked this pull request as ready for review April 1, 2025 06:57
curation: Curation,
db: &C,
sbom_id: Uuid,
node_id: String,
Copy link
Contributor

Choose a reason for hiding this comment

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

To my understanding clearly defined doesn't have a real "node ID", right? If that's the case, then we could use a static/magic/const value instead. Like we do it with the CyclondeDX root node. In the context of the "SBOM", that would always be unique.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed that. What about the proposal to use a static value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe it is also acceptable, but it would be better to use the same method in the same place.

Copy link
Contributor

Choose a reason for hiding this comment

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

What's the benefit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@bxf12315 bxf12315 Apr 3, 2025

Choose a reason for hiding this comment

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

At this point, the document id incorporates the content of the coordinates from the curation, such as "crate/cratesio/-/chrono." In my view, this approach is more meaningful in practice.

Copy link
Contributor

Choose a reason for hiding this comment

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

The "node id" is an unique ID in the context of an SBOM. Having a static node id makes it predictable. As the value itself is not important, it wouldn't matter.

Unless there are reasons against it, I'd like to use a static value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What static value should we use? “ClearlyDefinedCuration”.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds reasonable.

@bxf12315 bxf12315 force-pushed the license-clearly-defined branch from 0224bef to 577a884 Compare April 8, 2025 13:17
// });
sbom_package_license_list.push(sbom_package_license::ActiveModel {
sbom_id: Set(self.sbom.sbom_id),
node_id: Set("ClearlyDefinedCuration".to_string()),
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you pull that out into a const please.

let mut purls = PurlCreator::new();
let mut licenses = LicenseCreator::new();

// TODO: Since the node id cannot be obtained here, it’s not possible to replace purl_license_assertion with sbom_package_license.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is that comment still valid?

// let mut assertions = Vec::new();
let mut sbom_package_license_list = Vec::new();

let _a: SbomInformation = (&curation).into();
Copy link
Contributor

Choose a reason for hiding this comment

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

That seems to be dead code.

@bxf12315 bxf12315 force-pushed the license-clearly-defined branch 2 times, most recently from 6b251ab to 7226472 Compare April 9, 2025 05:53
use trustify_entity::sbom_package_license;
use uuid::Uuid;

const CLEARLYDEFINEDCURATION: &str = "ClearlyDefinedCuration";
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please use "uppercase snake case": CLEARLY_DEFINED_CURATION

@bxf12315 bxf12315 force-pushed the license-clearly-defined branch from 7226472 to 739ae40 Compare April 9, 2025 09:27
@bxf12315 bxf12315 force-pushed the license-clearly-defined branch from 739ae40 to ec744f4 Compare April 29, 2025 13:32
@bxf12315 bxf12315 force-pushed the license-clearly-defined branch 2 times, most recently from 3399ef7 to ec744f4 Compare May 28, 2025 02:43
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