-
-
Notifications
You must be signed in to change notification settings - Fork 610
feat(OutputHTML): Always print license references table #4474
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
feat(OutputHTML): Always print license references table #4474
Conversation
Everything succeeds except the macOS tests, which I assume fail for unrelated reasons. I also added myself to Authors and added the fix to the changelog as per the PR template tasks. |
Hi @AyanSinhaMahapatra, could you please review my changes and let me know if they are OK? From reading your code in 49e7d89, I had the hunch you were about to change the underlying data sources, but did not get around to finishing it, at least not for the license ref table in the HTML output. (more context in the issue) I thought, until your refactoring is finished maybe this PR could act as a temporary fix, so users can utilize the html reports again? |
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.
@pepper-jk thanks for the PR.
The license references are available with the --license-references
CLI option enabled, this was added allright.
Please see my comments and also #4101 (comment), could you also add a small documentation improvement for this?
I submitted the requested changes, but I'd like to test the behavior before we merge, so I set the PR back to a draft. I will test the behavior shortly. |
cd91e29
to
a63ae00
Compare
I finished testing and can confirm that with these changes the license reference table gets printed in html outputs, if the I will now work on the documentation and potentially squash the changes inside |
The `--license-references` cli argument enables collection and storge of license reference data in output files. So as long as it was present as a Post-Scan option the `license_references` should not be empty. In such cases, the license reference table shall be filled with the already stored data. If however the `license_references` list is empty, the licenses should be collected from the `license_db` as a fall back, similar to the legacy license collection pre 49e7d89. Fixes aboutcode-org#4101. Signed-off-by: Jens Keim <[email protected]>
Link Issue aboutcode-org#4101 and Pull Request aboutcode-org#4474. Signed-off-by: Jens Keim <[email protected]>
Signed-off-by: Jens Keim <[email protected]>
Signed-off-by: Jens Keim <[email protected]>
`--license-references` is recommended, but mention the new fallback. Signed-off-by: Jens Keim <[email protected]>
3089c7b
to
1842cad
Compare
I added a note in the documentation, updated the changelog and the commit messages to the new changes, and squashed the commits. Should be ready now. |
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.
LGTM! Thanks++ @pepper-jk Merging!
Description
The license references table in the HTML output does not get created with the current version of scancode (32.3.2).
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 together with their metadata, such as URL to license text and category.
Evidence suggests that this is broken ever since 32.0.0, specifically PR #3275, where the source of the license references table was changed. This PR basically reverts the changes from 49e7d89, which case the described bug, and adjusts the older code to fit the current HTML template:
The new template expects a sorted list of license objects, therefore the
licenses
dictionary gets converted.None
entries get discarded. Finally the emptylicense_references
get overridden with the finished list of collected licenses.Fixes #4101. Please refer to the issue for more information on the bug.
Tasks
Run tests locally to check for errors.
Signed-off-by: Jens Keim [email protected]