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

Sanitize creating an Identifier from SPDX #4771

Merged
merged 3 commits into from
Dec 3, 2021
Merged

Conversation

sschuberth
Copy link
Member

Please have a look at the individual commit messages for the details.

Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
…X name

There is no strict need to deduplicate the SPDX name like this as only
the SPDX ID needs to be unique. Also, the type and namespace can be
retrieved from the PURL.

Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
@MarcelBochtler
Copy link
Member

Adding breaking change label as this will break curations and package configuration that use the unsanitized ID

@MarcelBochtler MarcelBochtler added the breaking change Pull requests that break compatibility with previous behavior label Nov 29, 2021
* supported, replace them with dashes, too, for readability.
*/
private fun String.sanitize(): String =
replace(Regex("[: ]"), "-").replace(Regex("-{2,}"), "-")
Copy link
Member

Choose a reason for hiding this comment

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

While I agree that replacing spaces with dashes is a good idea, it will break a lot of curations and I'm not sure if readability is worth it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't believe there are many SpdxDocumentFile-type curations for packages with spaces in their names around, but I agree we should be conservative still, and I've changed the implementation.

Together with the previous commit, this fixes #4744.

Signed-off-by: Sebastian Schuberth <sebastian.schuberth@bosch.io>
@sschuberth
Copy link
Member Author

@oss-review-toolkit/core-devs can we move forward with this?

@sschuberth sschuberth merged commit 2c3d256 into master Dec 3, 2021
@sschuberth sschuberth deleted the id-spdx-sanitize branch December 3, 2021 09:23
@sschuberth sschuberth added the release notes Changes that should be mentioned in release notes label Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Pull requests that break compatibility with previous behavior release notes Changes that should be mentioned in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants