Skip to content

chore: For assets bundled at a particular version, reference the version’s license#3098

Merged
johanneskoester merged 2 commits intosnakemake:mainfrom
musicinmybrain:version-license
Sep 25, 2024
Merged

chore: For assets bundled at a particular version, reference the version’s license#3098
johanneskoester merged 2 commits intosnakemake:mainfrom
musicinmybrain:version-license

Conversation

@musicinmybrain
Copy link
Copy Markdown
Contributor

@musicinmybrain musicinmybrain commented Sep 21, 2024

Referencing the license file from the release tag corresponding to the bundled release of each asset makes it less likely that the checksum will eventually start to match due to later upstream license changes – perhaps as simple as a new copyright date – and makes errors in the included licenses less likely.

Since the copyright statement in the react license changed from "Copyright (c) Facebook, Inc. and its affiliates." to "Copyright (c) Meta Platforms, Inc. and affiliates." since the bundled version of react was released – and this commit uses the older version that corresponds to the bundled library – the checksum of the react license file changes.

Similarly, in the vega license, the copyright date range changed from 2015-2021 to 2015-2023 after the bundled version was released, so using the correct license file for the bundled version changes the checksum.

QC

  • The PR contains a test case for the changes or the changes are already covered by an existing test case. N/A – this change is not really testable – except that building the package confirms the checksums match.
  • The documentation (docs/) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake). N/A – no documentation update is believed to be necessary.

Summary by CodeRabbit

  • New Features

    • Updated asset URLs to point to specific tagged versions for improved stability and reliability.
  • Bug Fixes

    • Corrected SHA256 checksums for various assets to ensure integrity and security.

Referencing the license file from the release tag corresponding to the
bundled release of each asset makes it less likely that the checksum
will eventually stop matching due to later upstream license changes –
perhaps as simple as a new copyright date – and makes errors in the
included license less likely.

Since the copyright statement in the react license changed from
"Copyright (c) Facebook, Inc. and its affiliates." to "Copyright (c)
Meta Platforms, Inc. and affiliates." since the bundled version of react
was released – and this commit uses the older version that corresponds
to the bundled library – the checksum of the react license file changes.

Similarly, in the vega license, the copyright date range changed from
2015-2021 to 2015-2023 after the bundled version was released, so using
the correct license file for the bundled version changes the checksum.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Sep 21, 2024

Walkthrough

The changes involve updating the Assets class in the snakemake/assets/__init__.py file. Specifically, the URLs and SHA256 checksums for various licenses of assets such as Tailwind CSS, React, Vega, Vega-Lite, Vega-Embed, Heroicons, and Prop-Types have been modified to point to specific tagged versions in their respective repositories.

Changes

File Change Summary
snakemake/assets/__init__.py Updated asset URLs and SHA256 checksums for Tailwind CSS, React, Vega, Vega-Lite, Vega-Embed, Heroicons, and Prop-Types licenses.

Possibly related PRs

  • fix: add assets and use local file links to allow offline reports #2904: The changes in this PR involve adding assets and local file links for offline report generation, which directly relates to the updates made to asset URLs and checksums in the main PR. Both PRs focus on managing resources and licenses for various libraries, ensuring they are accessible in offline environments.

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f692a4b and b108bbf.

Files selected for processing (1)
  • snakemake/assets/init.py (2 hunks)
Additional context used
Path-based instructions (1)
snakemake/assets/__init__.py (1)

Pattern **/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of the self argument of methods.
Do not suggest type annotation of the cls argument of classmethods.
Do not suggest return type annotation if a function or method does not contain a return statement.

Additional comments not posted (7)
snakemake/assets/__init__.py (7)

57-57: LGTM!

Updating the URL to reference the license file for a specific version tag (v3.0.23) is a good practice to ensure consistency and avoid potential checksum mismatches.


65-66: LGTM!

Updating the URL to reference the license file for a specific version tag (v18.2.0) and updating the corresponding SHA256 checksum is a good practice to ensure consistency and avoid potential checksum mismatches due to upstream license file changes.


81-82: LGTM!

Updating the URL to reference the license file for a specific version tag (v5.21.0) and updating the corresponding SHA256 checksum is a good practice to ensure consistency and avoid potential checksum mismatches due to upstream license file changes.


89-89: LGTM!

Updating the URL to reference the license file for a specific version tag (v5.2.0) is a good practice to ensure consistency and avoid potential checksum mismatches.


97-97: LGTM!

Updating the URL to reference the license file for a specific version tag (v6.20.8) is a good practice to ensure consistency and avoid potential checksum mismatches.


101-102: LGTM!

Updating the URL to reference the license file for a specific version tag (v1.0.3) and updating the corresponding SHA256 checksum is a good practice to ensure consistency and avoid potential checksum mismatches due to upstream license file changes.


109-109: LGTM!

Updating the URL to reference the license file for a specific version tag (v15.7.2) is a good practice to ensure consistency and avoid potential checksum mismatches.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, please review it.
    -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    -- @coderabbitai generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    -- @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@musicinmybrain
Copy link
Copy Markdown
Contributor Author

musicinmybrain commented Sep 21, 2024

I’ve been studying this new asset bundling scheme because I want to update Fedora’s snakemake package past 8.18.2, but I have to make sure I handle all the licensing details for the assets correctly.

I plan to open a follow-up PR that adds a large number of license files for things that I can find bundled in the various JavaScript assets – either because they are NPM dependencies that get included in the final bundle, as happens in vega-embed, or because bits of code are copied or “derived from” with attribution, as in vega.js. These are all under various licenses like MIT, BSD-2-Clause, Apache-2.0, and ISC, almost all of which do require retaining the copyright and permission notices in copies and derived works, yet the full license text is generally not present in the JavaScript files in question. These messing texts are something I need to correct – downstream if necessary, upstream if possible – before shipping the asset bundle in Fedora.

This is tedious work, and it will greatly increase the number of entries in the Assets.spec dictionary and the number of directories in snakemake/assets/data, but making a reasonable effort to ensure all required license texts are present is necessary due diligence before shipping these assets in Fedora. (In fact, it’s only very recently that it became allowable to ship pre-compiled/pre-minified JavaScript in Fedora when it’s too hard to rebuild it from original sources, and a similar relaxation of the rules for CSS is still pending a vote but seems to be headed for approval.) I’ve already started this follow-up work, but please let me know if you have any general feedback or suggestions on the plan.

The current version as of when icon paths from heroicons were
incorporated in Snakemake (in d09df0c on 2022-03-13 and 142a452 on
2022-03-23) was 1.0.3; in version 2.1.2, the copyright statement changed
from "Copyright (c) 2020 Refactoring UI Inc." to "Copyright (c) Tailwind
Labs, Inc.". Since this commit switches to the older license text, it
changes the checksum.
@sonarqubecloud
Copy link
Copy Markdown

@musicinmybrain
Copy link
Copy Markdown
Contributor Author

The two licenses that are still referenced at main or master are:

  • snakemake itself, because accessing the current version number here without importing snakemake would be painful, and you will know if you are planning to change your own license text
  • and pygments, because Pygments CSS included in HTML reports is provided by the pygments Python dependency at runtime, and it’s not possible to know a priori exactly which version that will be.

@johanneskoester johanneskoester merged commit 42f8c12 into snakemake:main Sep 25, 2024
fgvieira added a commit that referenced this pull request Mar 11, 2025
<!--Add a description of your PR here-->
This PR is intended to apply on top of
#3098; see that PR for the
first two commits.

From there, I attempted to account for all of the NPM packages that are
bundled in `vega/vega.js` via dependencies. I made an effort to verify
that every license file added in this commit actually corresponds to
some code present in `vega.js`.

Next, I inspected `vega.js` for comments indicating that particular
routines were copied, derived, or adapted from other projects, and added
the license files for those projects. I didn’t attempt to judge whether
or not any of snippets might be distant enough from their inspirations
that they could perhaps claim not to be derived works under a particular
set of copyright laws – I just took the attributions at their word.

Almost all of these licenses are ones (like `MIT`, `Apache-2.0`, `ISC`
or `BSD-3-Clause`) that require including the copyright and permission
statements (the license text) in copies and derived works, so while this
work is fussy, tedious, and unrewarding, it would seem to be necessary.

So far, I only dug through `vega.js`. I still need to check if there is
anything in `vega-lite.js` or `vega-embed.js` that isn’t already
accounted for in `vega.js`, and I need to look at the other libraries
too. Still, I thought I should post my work in progress in case it
collected any feedback.


### QC
<!-- Make sure that you can tick the boxes below. -->

* [ ] The PR contains a test case for the changes or the changes are
already covered by an existing test case. **N/A – this change is not
really testable – except that building the package confirms the
checksums match.**
* [x] The documentation (`docs/`) is updated to reflect the changes or
this is not necessary (e.g. if the change does neither modify the
language nor the behavior or functionalities of Snakemake). **N/A – no
documentation update is believed to be necessary.**


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added numerous new assets and dependencies related to the Vega
library, enhancing functionality.
- Expanded package declarations for various D3 modules and other
libraries in the reporting system.
- Introduced a new class for executing Xonsh scripts, allowing for more
scripting options.
- Added a new rule for running Python scripts in a Conda environment,
improving workflow flexibility.
- Enhanced documentation with a new "Maintainers" section and expanded
resources.
	- Introduced a new test suite for validating Conda functionalities.
- Enhanced data validation capabilities using both Pandas and Polars for
handling sample data.

- **Bug Fixes**
- Ensured that licenses and versions are accurately maintained for
various libraries.
- Improved error handling for Windows-specific issues in the testing
framework.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Filipe G. Vieira <1151762+fgvieira@users.noreply.github.com>
Co-authored-by: Johannes Köster <johannes.koester@tu-dortmund.de>
kjohnsen pushed a commit to kjohnsen/snakemake that referenced this pull request Dec 15, 2025
…3099)

<!--Add a description of your PR here-->
This PR is intended to apply on top of
snakemake#3098; see that PR for the
first two commits.

From there, I attempted to account for all of the NPM packages that are
bundled in `vega/vega.js` via dependencies. I made an effort to verify
that every license file added in this commit actually corresponds to
some code present in `vega.js`.

Next, I inspected `vega.js` for comments indicating that particular
routines were copied, derived, or adapted from other projects, and added
the license files for those projects. I didn’t attempt to judge whether
or not any of snippets might be distant enough from their inspirations
that they could perhaps claim not to be derived works under a particular
set of copyright laws – I just took the attributions at their word.

Almost all of these licenses are ones (like `MIT`, `Apache-2.0`, `ISC`
or `BSD-3-Clause`) that require including the copyright and permission
statements (the license text) in copies and derived works, so while this
work is fussy, tedious, and unrewarding, it would seem to be necessary.

So far, I only dug through `vega.js`. I still need to check if there is
anything in `vega-lite.js` or `vega-embed.js` that isn’t already
accounted for in `vega.js`, and I need to look at the other libraries
too. Still, I thought I should post my work in progress in case it
collected any feedback.


### QC
<!-- Make sure that you can tick the boxes below. -->

* [ ] The PR contains a test case for the changes or the changes are
already covered by an existing test case. **N/A – this change is not
really testable – except that building the package confirms the
checksums match.**
* [x] The documentation (`docs/`) is updated to reflect the changes or
this is not necessary (e.g. if the change does neither modify the
language nor the behavior or functionalities of Snakemake). **N/A – no
documentation update is believed to be necessary.**


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added numerous new assets and dependencies related to the Vega
library, enhancing functionality.
- Expanded package declarations for various D3 modules and other
libraries in the reporting system.
- Introduced a new class for executing Xonsh scripts, allowing for more
scripting options.
- Added a new rule for running Python scripts in a Conda environment,
improving workflow flexibility.
- Enhanced documentation with a new "Maintainers" section and expanded
resources.
	- Introduced a new test suite for validating Conda functionalities.
- Enhanced data validation capabilities using both Pandas and Polars for
handling sample data.

- **Bug Fixes**
- Ensured that licenses and versions are accurately maintained for
various libraries.
- Improved error handling for Windows-specific issues in the testing
framework.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Filipe G. Vieira <1151762+fgvieira@users.noreply.github.com>
Co-authored-by: Johannes Köster <johannes.koester@tu-dortmund.de>
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.

2 participants