Skip to content

feat: add license check#527

Merged
vitaliy-guliy merged 2 commits intoche-incubator:mainfrom
olexii4:CHE-23363
May 19, 2025
Merged

feat: add license check#527
vitaliy-guliy merged 2 commits intoche-incubator:mainfrom
olexii4:CHE-23363

Conversation

@olexii4
Copy link
Contributor

@olexii4 olexii4 commented Mar 11, 2025

What does this PR do?

Add license check.

What issues does this PR fix?

fixes eclipse-che/che#23363

How to test this PR?

Does this PR contain changes that override default upstream Code-OSS behavior?

  • the PR contains changes in the code folder (you can skip it if your changes are placed in a che extension )
  • the corresponding items were added to the CHANGELOG.md file
  • rules for automatic git rebase were added to the .rebase folder

@github-actions
Copy link

github-actions bot commented Mar 11, 2025

Click here to review and test in web IDE: Contribute

@github-actions
Copy link

@vitaliy-guliy
Copy link
Contributor

Honestly, I do not have the whole picture of what this PR does.

Could we instead of adding all those files, add only one GitHub action, that will be triggered by pushing to the main branch (or pull request)? The action should not block anything and its successful execution may be represented as a badge in the README file.

@olexii4
Copy link
Contributor Author

olexii4 commented Mar 12, 2025

Honestly, I do not have the whole picture of what this PR does.

Could we instead of adding all those files, add only one GitHub action, that will be triggered by pushing to the main branch (or pull request)? The action should not block anything and its successful execution may be represented as a badge in the README file.

@vitaliy-guliy We have some information here che-incubator/dash-licenses:

...
Update dependency info
The following command generates dependencies info of a project and then checks all found dependencies. It returns a non-zero exit code if any of them are restricted to use.

docker run --rm -t \
       -v ${PWD}/:/workspace/project  \
       quay.io/che-incubator/dash-licenses:next

As a result, this command creates the next files:

  • prod.md with the list of production dependencies;
  • dev.md which contains only build and test dependencies;
  • problems.md will be created if some dependencies are not covered with CQ, unnecessary excludes present, etc.

Check dependencies
If you just need to verify that all dependencies satisfy IP requirements, use the --check flag, like the following

docker run --rm -t \
       -v ${PWD}/:/workspace/project  \
       quay.io/che-incubator/dash-licenses:next --check

So, this command doesn't create any new files in the project directory (except a temporary one) but checks if the dependencies info is up-to-date and then validates all found dependencies. It returns a non-zero exit code if any of the dependencies are restricted to use.
...

Files prod.md and dev.md include license information for libraries. for example:

Production dependencies

Packages License Resolved CQs
@vscode/sqlite3@5.1.8-vscode BSD-3-Clause clearlydefined
...

You can click a link with CQ and the next page will be opened

Знімок екрана 2025-03-12 о 15 20 20

@github-actions
Copy link

1 similar comment
@github-actions
Copy link

@olexii4 olexii4 marked this pull request as draft April 23, 2025 00:40
@olexii4 olexii4 marked this pull request as ready for review April 23, 2025 13:22
Copy link
Collaborator

@RomanNikitenko RomanNikitenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olexii4
I propose to add section that describes license check functionality to the readme file
you could take this comment as a basis #527 (comment)

@github-actions
Copy link

1 similar comment
@github-actions
Copy link

@olexii4
Copy link
Contributor Author

olexii4 commented Apr 29, 2025

@olexii4 I propose to add section that describes license check functionality to the readme file you could take this comment as a basis #527 (comment)

@RomanNikitenko I have fixed it:

Знімок екрана 2025-04-29 о 18 18 28

@github-actions
Copy link

2 similar comments
@github-actions
Copy link

@github-actions
Copy link

@github-actions
Copy link

@RomanNikitenko
Copy link
Collaborator

@olexii4
ubi9-based build is failing, I created an issue for that problem eclipse-che/che#23424
#541 should fix the problem, waiting for the jobs...

@RomanNikitenko
Copy link
Collaborator

@olexii4
I've merged my fix, please fetch new changes from the main branch to fix che-code build in your PR

@vitaliy-guliy
Copy link
Contributor

vitaliy-guliy commented May 2, 2025

My first attempt of launching npm run license:generate has been failed.

I created a workspace from https://github.com/olexii4/che-code/tree/CHE-23363 and installed node dependencies. Then I added "comment-json": "4.2.5" dependency to che-api, installed dependency again and launched npm run license:generate command for che-api

Screenshot from 2025-05-02 13-56-17

Signed-off-by: Oleksii Orel <oorel@redhat.com>
@olexii4
Copy link
Contributor Author

olexii4 commented May 2, 2025

My first attempt of launching npm run license:generate has been failed.

I created a workspace from https://github.com/olexii4/che-code/tree/CHE-23363 and installed node dependencies. Then I added "comment-json": "4.2.5" dependency to che-api, installed dependency again and launched npm run license:generate command for che-api

Screenshot from 2025-05-02 13-56-17

@vitaliy-guliy I updated the thread. Please try again.

@olexii4
Copy link
Contributor Author

olexii4 commented May 2, 2025

@vitaliy-guliy I updated the thread. Please try again.

With the update podman doesn't even try to download the image

Screenshot from 2025-05-02 18-14-51

@olexii4 could you please update package-lock.json files for che-* extensions? This is what I have after installing node dependencies

$ git status
On branch CHE-23363
Your branch is up to date with 'origin/CHE-23363'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   code/extensions/che-activity-tracker/package-lock.json
        modified:   code/extensions/che-api/package-lock.json
        modified:   code/extensions/che-commands/package-lock.json
        modified:   code/extensions/che-port/package-lock.json
        modified:   code/extensions/che-remote/package-lock.json
        modified:   code/extensions/che-resource-monitor/package-lock.json

no changes added to commit (use "git add" and/or "git commit -a")

@vitaliy-guliy Why should I do it in this PR? It is a separate issue that doesn't depend on my changes.

@vitaliy-guliy
Copy link
Contributor

vitaliy-guliy commented May 2, 2025

@olexii4 could you please update package-lock.json files for che-* extensions? This is what I have after installing node dependencies

$ git status
On branch CHE-23363
Your branch is up to date with 'origin/CHE-23363'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   code/extensions/che-activity-tracker/package-lock.json
        modified:   code/extensions/che-api/package-lock.json
        modified:   code/extensions/che-commands/package-lock.json
        modified:   code/extensions/che-port/package-lock.json
        modified:   code/extensions/che-remote/package-lock.json
        modified:   code/extensions/che-resource-monitor/package-lock.json

no changes added to commit (use "git add" and/or "git commit -a")

@vitaliy-guliy Why should I do it in this PR? It is a separate issue that doesn't depend on my changes.

Ok, let's skip them as the changes are not related to this PR.

@olexii4
Copy link
Contributor Author

olexii4 commented May 2, 2025

Знімок екрана 2025-05-02 о 23 28 11

@olexii4
Copy link
Contributor Author

olexii4 commented May 8, 2025

@vitaliy-guliy FYI: che-incubator/dash-licenses#26 was merged.

@vitaliy-guliy
Copy link
Contributor

vitaliy-guliy commented May 9, 2025

Let's merge this PR as it is.
In case of any issues, changes in this PR will not block creating and merging the pull requests and will not affect the main branch.

Signed-off-by: Oleksii Orel <oorel@redhat.com>
@github-actions
Copy link

@vitaliy-guliy vitaliy-guliy merged commit 673a87e into che-incubator:main May 19, 2025
13 of 14 checks passed
@vitaliy-guliy
Copy link
Contributor

@olexii4 thanks for the contribution!

@olexii4 olexii4 deleted the CHE-23363 branch May 19, 2025 12:59
@devspacesbuild
Copy link

Build 3.22 :: code_3.x/1597: Console, Changes, Git Data

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

Build 3.22 :: code_3.x/1597: SUCCESS

Upstream sync done; /DS_CI/sync-to-downstream_3.x/9332 triggered

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

@devspacesbuild
Copy link

Build 3.22 :: copyIIBsToQuay/2999: Console, Changes, Git Data

@devspacesbuild
Copy link

Build 3.22 :: sync-to-downstream_3.x/9333: SUCCESS

Build container: devspaces-operator-bundle synced; /DS_CI/get-sources-rhpkg-container-build_3.x/9481 triggered; /job/DS_CI/job/dsc_3.x triggered;

@devspacesbuild
Copy link

Build 3.22 :: operator-bundle_3.x/4909: SUCCESS

Upstream sync done; /DS_CI/sync-to-downstream_3.x/9333 triggered

@devspacesbuild
Copy link

Build 3.22 :: dsc_3.x/2054: Console, Changes, Git Data

@devspacesbuild
Copy link

Build 3.22 :: update-digests_3.x/9233: SUCCESS

Detected new images: rebuild operator-bundle
* code; /DS_CI/operator-bundle_3.x/4909 triggered

@devspacesbuild
Copy link

Build 3.22 :: dsc_3.x/2054: SUCCESS

3.22.0-CI

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.

[che-code] Add a GitHub job to check licenses for using libraries for PRs

4 participants