-
Notifications
You must be signed in to change notification settings - Fork 56
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
Enhance the check_license functionality + Check for duplicate and near matches of license submittal #128
Conversation
I would like to do the original check license algorithm if there is a close match. The replacement algorithm doesn't take into account the templates and replaceable terms. An algorithm like:
|
@goneall Isn't the isTextStandardLicense of the SPDX tools took account for the templates and replaceable terms? I have also tried testing it with few templates and it works for some of them as it works for text that returns isDifferentFound to be false in case if difference found it does not report it to be a license match and just report it to be a close match. Also, when I'm using the check_license with the original algo on the production for templates it returns "there are no matching spdx licenses". Thanks |
Yes - that should take into account the template. I may have just missed the code. I was reading the file diffs for this PR and saw the code to call the SPDX tools removed, but didn't see the call to isTextStandardLicense |
@goneall Right. The function is called inside the spdx-license-matcher itself and that's why it is not visible in the current code. But still I don't know the code behind isTextStandardLicense but when I use a template (eg AAL.template.txt) it reports that difference is found. I'm using the exact same template so, it shouldn't have returned any differences in the first place right? |
The template is used to describe optional and variable text, you don't actually match against it - you match against the license text. But if you remove some optional text or change variable text in a license it will still match. For example, in the Apache 2.0 license, you can change When you look at the license text on spdx.org/licenses, you will see optional text as blue and variable/alt text as red. The code that implements that matching is in Java staring here. |
I understood it. And I will check out the code. Thanks for the reply. :) |
519f966
to
25854d4
Compare
@goneall @techytushar @rtgdk I have updated the PR with the below changes. Please have a look at it. Thanks In the PR I have done the following changes:
Also, This function is not used anywhere as a similar function is there right below it, I think it was left out by mistake should I remove it as well? |
If it is not being used, please remove it - we can always go back in git history if we need to refer to the old method. |
@Ugtan Please update the README.md file with the instructions for installing and running the redis server and any other steps needed to successfully setup the online tools. After that, I'll test this out on my local machine. I took a quick look at the files and it looks good. |
Sounds good.
Sure, I will add it tomorrow. |
@rtgdk @techytushar Could one of you do a quick review of the code and let me know if this is good to be merged. Thanks |
@goneall I have added the documentation regarding the installation of the redis server also, I have removed the unnecessary code. |
@Ugtan Running this on my local machine, I'm getting the following errors in the JavaScript console when trying to show the diff:
I also noticed the following error when starting up the app (not sure if this is related to the problem):
|
813bed7
to
33497e3
Compare
I have fixed the error. Please have a look it should work now. I accidentally deleted the treeview js file while removing unnecessary files as I had imported all the files used in the xml editor. Sorry for the inconvenience.
I know why this issue is showing up. So, I'm importing a script js file of XML editor which handles the PR making stuff only in the html of the submit license page and in that script there is codemirror used to fix this issue we can shift the make pr function to some other file which will not show the error anymore. But I think it will not impact the functionality of this feature. Although, if you like I will create a new PR refactoring these function. @goneall |
It works - thanks!
Let's go ahead and create a PR since you know how to fix it. |
I had a chance to test it out and it worked for me. Nice work @Ugtan! Once @rtgdk or @techytushar reviews the Python code, I can merge. In going through the workflow, we may want to change to submitting an issue rather than a PR for the case when there is a close match which should match the existing licenses since many users won't have the technical skills to create the PR. This can be a separate issue and something we add after GSoC since this would be a change in the requirements and the GSoC project implemented the project correctly for the project idea/requirements at the time. |
Sure.
If in case the user wants the licenses to match? Then what if he wants to add a new license request? |
NVM. I just saw the issue and it makes sense now. I will soon gonna work on the issue. Should I add changes to this PR or create a new one @goneall ? |
@Ugtan Thanks for taking this on! I would open a new PR once we merge this one - that way we can keep the GSoC PR's consistent with the project plan. Once I get one more technical review of the Python code, I'll merge then we can create a new PR. |
README.md
Outdated
|
||
**For linux/Mac user use** | ||
|
||
`sudo apt-get install redis-server`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On MAC, apt-get is not available. Put the command for HomeBrew.
The changes works fine for me. Just a small change in README needed. Other than that, PR looks good, ready to be merged. I hope tests will be added to verify the functionality (maybe selenium tests) and edge cases. Also, I hope this works well in production after setting up the redis server. Another thing I noticed is the |
Hello @rtgdk, Thank you so much for your feedback.
Yeah, I will write some tests to verify the functionality.
This is already transferred to SPDX. |
@Ugtan It looks like when I merged your other PR, it created a conflict. If you could resolve the conflict and update the README for the mac I'll merge this in. |
@goneall I will resolve the merge conflicts soon. |
Enhance the check_license functionality by using close matches for optimization to narrow down the possible matches.
Add details on how to install redis server
Fixes the displayModal error while showing diff for close matches in the license submittal feature.
33497e3
to
f39b7f2
Compare
@goneall @techytushar @rtgdk I have resolved the merge conflicts as well as the changes that were suggested. Please have a look. Thanks |
for optimization to narrow down the possible matches.