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

Allow licenses to be absent from netkans #4137

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Jul 31, 2024

Problem

If you omit the license from a netkan, you get a license should match spec error from the inflator, even if the mod is hosted on a server that provides license info in its API.

Cause

Many years ago, netkan validation was much more primitive (see #346 (comment)). It did not inflate netkans into .ckan files, so all validation checks had to be performed with only the netkan available. A missing license in a netkan could mean a missing or invalid license in the ckan, which would make the client throw an exception. There was no way to catch that, so the field was made required, with a x_netkan_license_ok override for when the person reviewing the pull request had manually confirmed that the license on the server was valid.

Since then, inflation was added to the validation, which allows validation to be performed on the .ckans as well, so it is no longer necessary to require the license in the netkan.

Changes

  • Now the LicensesValidator is moved from NetkanValidator to CkanValidator. This will allow the license field to be omitted from netkans and filled in by the inflator. Any invalid licenses will still cause inflation errors, just later in the process.
  • Now the SpacedockTransformer replaces spaces in licenses with -, to make SD's CC-BY-NC-SA 4.0 strings translate properly to our CC-BY-NC-SA-4.0.

Fixes #4136.

@HebaruSan HebaruSan added Enhancement New features or functionality Easy This is easy to fix Netkan Issues affecting the netkan data labels Jul 31, 2024
@HebaruSan HebaruSan merged commit 701afa1 into KSP-CKAN:master Jul 31, 2024
3 checks passed
@HebaruSan HebaruSan deleted the feature/relax-license-req branch July 31, 2024 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy This is easy to fix Enhancement New features or functionality Netkan Issues affecting the netkan data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Inflator should pull the license from kref when available
1 participant