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

Change license metadata semantics #1073

Merged
merged 2 commits into from
Jul 18, 2024
Merged

Change license metadata semantics #1073

merged 2 commits into from
Jul 18, 2024

Conversation

rydrman
Copy link
Collaborator

@rydrman rydrman commented Jul 13, 2024

Updates the license field to be an Option<String> as desired.

Also adds a validation rule for checking if it's a valid SPDX license identifier, which becomes a default.

NOTE that this will start failing for builds for package specs that have a license in them which is not recognized. I'm making an assumption that most packages don't have one - but @jrray may want to confirm that this won't create any kind of migration pain...

closes #984

FYI @dcookspi

@rydrman rydrman requested a review from jrray July 13, 2024 22:55
@rydrman rydrman self-assigned this Jul 13, 2024
crates/spk-build/src/validation/error.rs Outdated Show resolved Hide resolved
crates/spk-build/src/validation/spdx_license.rs Outdated Show resolved Hide resolved
crates/spk-build/src/validation/spdx_license.rs Outdated Show resolved Hide resolved
impl Meta {
pub fn is_default(&self) -> bool {
self == &Self::default()
}
fn default_license() -> String {
"Unlicensed".into()
Copy link
Collaborator

Choose a reason for hiding this comment

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

So will packages that contain this "Unlicensed" license now be considered invalid to read that package? Or does this change only affect builds of packages?

Copy link
Collaborator Author

@rydrman rydrman Jul 17, 2024

Choose a reason for hiding this comment

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

The validation only runs at build time so existing published packages should be okay

Signed-off-by: Ryan Bottriell <ryan@bottriell.ca>
Signed-off-by: Ryan Bottriell <ryan@bottriell.ca>
@rydrman rydrman merged commit 6e42727 into main Jul 18, 2024
6 checks passed
@rydrman rydrman deleted the 984-license-metadata branch July 18, 2024 02:05
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.

Change Metadata License Field Semantics
2 participants