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

check license button no longer works #527

Open
goneall opened this issue Jan 21, 2024 · 15 comments
Open

check license button no longer works #527

goneall opened this issue Jan 21, 2024 · 15 comments

Comments

@goneall
Copy link
Member

goneall commented Jan 21, 2024

After updating to the latest release (1.2.3), clicking the check license button does not return anything.

In looking in the browser debug console message, it looks like it can't find the file https://tools.spdx.org/static/js/utils.js.

Perhaps the get static didn't execute successfully or it is in the wrong place.

Below is the console output:



submit_new_license/:422 
 GET https://tools.spdx.org/static/js/utils.js net::ERR_ABORTED 404 (Not Found)
submit_new_license/:896 Uncaught ReferenceError: findLicenseMatch is not defined
    at HTMLButtonElement.<anonymous> (submit_new_license/:896:5)
@goneall
Copy link
Member Author

goneall commented Jan 21, 2024

On the production server, there is a static directory, but it doesn't contain the utils.js.

Here's the contents of /spdx/src/app/static/js:

bootstrap.js      editor          jquery-ui.min.js  npm.js
bootstrap.min.js  html2canvas.js  jquery.min.js     warning.js

@goneall
Copy link
Member Author

goneall commented Jan 21, 2024

I could not locate the file utils.js in the docker instance.

I tried running the collect static command manually - here's the output:
collect-static-output.txt

@bact
Copy link
Contributor

bact commented Dec 29, 2024

What is the expected behavior of the tool at https://tools.spdx.org/app/check_license/ ?

The interface itself does not very telling.

@goneall
Copy link
Member Author

goneall commented Dec 29, 2024

What is the expected behavior of the tool at https://tools.spdx.org/app/check_license/ ?

The interface itself does not very telling.

The expected behavior is to compare the submitted text against all listed licenses and listed license exceptions. The result of the compare would be one of "Exact Match", "Close Match" or "No Match". Exact match only if it matches using the license matching guidelines. The implementation of close match is it achieve a high score on a text matching algorithm (e.g. Sørensen Dice) but does not pass the full matching guidelines.

There are two main use cases:

  • Check a found license during an analysis of open source licenses for compliance reasons
  • Check a license before submitting a new license to the license list - avoid duplication

@bact
Copy link
Contributor

bact commented Dec 29, 2024

Thank you

@bact
Copy link
Contributor

bact commented Dec 29, 2024

I have tried

Apache
Apache 2.0
Apache-2.0
GPL

Nothing matched

@goneall
Copy link
Member Author

goneall commented Dec 29, 2024

I have tried

Apache Apache 2.0 Apache-2.0 GPL

Nothing matched

It works from the full text of the license - not the license ID.

Try copy/pasting the official license text from the website: https://spdx.org/licenses/Apache-2.0.html

@bact
Copy link
Contributor

bact commented Dec 29, 2024

Got it. Thank you

@bact
Copy link
Contributor

bact commented Dec 30, 2024

@goneall I think the app is working now. I have tested it with the full text from https://spdx.org/licenses/Apache-2.0.html, hit the "Check License" button and got a dialog box reporting a result as "Close match".

The button is working. -- Tested on Firefox 133, Chrome 131, and Safari 17.6

@bact
Copy link
Contributor

bact commented Dec 30, 2024

The expected behavior is to compare the submitted text against all listed licenses and listed license exceptions. The result of the compare would be one of "Exact Match", "Close Match" or "No Match".

I put these usage/behaviour to the Check License UI in PR #545

@goneall
Copy link
Member Author

goneall commented Dec 31, 2024

The check license menu does work, but the "check license" button on the license submittal page still doesn't work on my web browser (chrome).
image

@bact - let me know if you see the same issue

@bact
Copy link
Contributor

bact commented Dec 31, 2024

I see. That's a different page.
I will check that. Thank you

@bact
Copy link
Contributor

bact commented Dec 31, 2024

On the production server, there is a static directory, but it doesn't contain the utils.js.

Here's the contents of /spdx/src/app/static/js:

bootstrap.js      editor          jquery-ui.min.js  npm.js
bootstrap.min.js  html2canvas.js  jquery.min.js     warning.js

Does it possible to copy https://github.com/spdx/spdx-online-tools/blob/main/src/app/static/js/utils.js over there?

@goneall
Copy link
Member Author

goneall commented Dec 31, 2024

Interesting - this should have been copied over during the docker build:

It copied everything else. I didn't capture the output of the docker build - next time I do a release, I'll have to capture the output and see if there is a clue as to why it either didn't get copied or it got deleted.

@goneall
Copy link
Member Author

goneall commented Dec 31, 2024

BTW - I did verify it is in the directory for the server where the docker build was done. Here's the output of ls on the machine where I ran the docker build:

ubuntu@ip-172-31-15-78:~$ ls spdx-online-tools/src/app/static/js/
bootstrap.js      editor          jquery-ui.min.js  npm.js    warning.js
bootstrap.min.js  html2canvas.js  jquery.min.js     utils.js

and here's the output of the ls in the container:

root@35d7eebd8d77:/spdx/src/app# ls static/js
bootstrap.js      editor          jquery-ui.min.js  npm.js
bootstrap.min.js  html2canvas.js  jquery.min.js     warning.js
root@35d7eebd8d77:/spdx/src/app# exit
exit

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

No branches or pull requests

2 participants