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

License References table missing from HTML output #4101

Open
pepper-jk opened this issue Jan 16, 2025 · 0 comments
Open

License References table missing from HTML output #4101

pepper-jk opened this issue Jan 16, 2025 · 0 comments
Labels

Comments

@pepper-jk
Copy link

Image

Description

The license references table in the HTML output does not get created with the current version of scancode (32.3.1).
The table was previously (31.2.6) called licenses and was located at the very bottom the static HTML output, see image above.
It summarized all licenses found in the scanned project in one table.

Investigation of the issue revealed this is due to an empty license_references list given to the template:

return template.generate(files=files, license_references=license_references, version=version)

The list is obtained from codebase.attributes.license_references:
license_references = codebase.attributes.license_references

Evidence suggests that this is broken ever since 32.0.0, specifically PR #3275, where the source of the license references was changed.
I was able to reproduce the issue on 32.0.1 and 32.3.1 alike. 31.2.6 worked fine, all installed via pip in a miniconda venv.
32.0.0 was not tested directly due to not running out of the box.

Unfortunately I was not able to follow the codebase rabbit hole, as its attributes seem to get constructed during runtime.
However, I did create a POC, where I reverted the source of license references the legacy implementation: html-license-ref-table-poc
This should show that the html template is not to blame.

Thanks in advance for taking the time Scancode Team.

Kind regards
Jens Keim (JJ)
FOSS Office
HELLA Aglaia

How To Reproduce

$ cd path/to/project
$ scancode --license --package --copyright --classify --verbose --info --json-pp result-scancode.json --ignore ort --ignore result-scancode.json --ignore result-scancode.html .
$ scancode --from-json result-scancode.json --html result-scancode.html

Open result-scancode.html and observe.

I also tried to output directly to html instead of json, but the license_references list was still empty.
I really hope I did not miss any obvious CLI arguments to fix the issue.

As test input I used paho.mqtt.python at current master (d45de37).

I do have output htmls for all versions mentioned above and my POC, but github does not allow upload of html files.
Please request the html files, if you need them, then I will upload them somewhere and share them via link.

System configuration

  • OS: Linux, but the bug was reported to us by users running Windows iirc
  • scancode-toolkit version: 32.3.1
  • installation method: pip in venv and later miniconda venv
@pepper-jk pepper-jk added the bug label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant