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

Update licenses in license.go #57

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Update licenses in license.go #57

wants to merge 6 commits into from

Conversation

darsh12
Copy link

@darsh12 darsh12 commented Apr 30, 2024

Upon using the ExtractLicense function, I found out that the license list is hard coded. After comparing the license list from spdx to the from license.go I found out many licenses that were missing. Hence, I came up with an automated approach to update all the various licenses being used.

Also update one of the tests in license_test.go since the location of that test got updated

P,S. Happy to share my n8n workflow.

@darsh12
Copy link
Author

darsh12 commented Apr 30, 2024

Sorry for all those commits. I found some edge cases that I had to fix.

@darsh12
Copy link
Author

darsh12 commented May 11, 2024

Hi,
Wanted to follow up on this. The MPL range entries are not deleted, they are still there.

"MPL-1.1",

@dangoor
Copy link
Contributor

dangoor commented May 12, 2024

@elrayle told me there are scripts in this repo for regenerating the license list. I'd like for her to weigh in here.

@elrayle
Copy link
Collaborator

elrayle commented May 13, 2024

Yep, I will take a look at this shortly. @darsh12 Thanks for pushing on this. The licenses need an update.

FYI, the scripts to update licenses are in the cmd directory. See cmd/docs.md for instructions on how to run. The process for updating license ranges is manual. 😞

The rest of this is a reminder to myself...

I see two short term changes that need to happen in response to your work.

  • add documentation to README about how to update licenses, pointing to cmd/docs.md
  • add to cmd/docs.md how to update license ranges

And longer term...

  • figure out if there is a way to auto-generate license ranges
  • add action to auto-update licenses and ranges

NOTE: License ranges are hard because there isn't a consistent pattern to how they are grouped.

@xnox
Copy link

xnox commented May 15, 2024

Should the .json files be upgraded in https://github.com/github/go-spdx/tree/main/cmd too ? the ones which these updates are based on? Although not sure what the value of json files is, relative the spdx upstream git repo.

@elrayle
Copy link
Collaborator

elrayle commented May 16, 2024

PR #62 is very close to complete. It will run a nightly cron to auto-generate the code for getting licenses. The generated code will go in to a branch that can be more easily merged. Unfortunately, at least at this point, the range data still has to be manually updated. I intend to revisit this implementation to see if there is a way to at least simplify the handling of ranges. That will not be part of the auto-gen PR. I am hoping to resolve the remaining issues with the PR by Monday

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.

None yet

4 participants