Skip to content

Commit 673a87e

Browse files
authored
feat: add license check (#527)
Signed-off-by: Oleksii Orel <oorel@redhat.com>
1 parent e947978 commit 673a87e

File tree

43 files changed

+2903
-8
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2903
-8
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#
2+
# Copyright (c) 2021-2025 Red Hat, Inc.
3+
# This program and the accompanying materials are made
4+
# available under the terms of the Eclipse Public License 2.0
5+
# which is available at https://www.eclipse.org/legal/epl-2.0/
6+
#
7+
# SPDX-License-Identifier: EPL-2.0
8+
#
9+
10+
name: License Check
11+
12+
# Trigger the workflow on pull request
13+
on: [pull_request]
14+
15+
jobs:
16+
check-che-extensions-licenses:
17+
runs-on: ubuntu-22.04
18+
if: ${{ github.base_ref == 'main' }}
19+
steps:
20+
- name: Checkout che-code source code
21+
uses: actions/checkout@v4
22+
- name: Check che-activity-tracker dependencies usage restrictions
23+
run: |
24+
docker run --rm -t \
25+
-v $PWD/code/extensions/che-activity-tracker:/workspace/project \
26+
quay.io/che-incubator/dash-licenses:next --check
27+
- name: Check che-api dependencies usage restrictions
28+
run: |
29+
docker run --rm -t \
30+
-v $PWD/code/extensions/che-api:/workspace/project \
31+
quay.io/che-incubator/dash-licenses:next --check
32+
- name: Check che-commands dependencies usage restrictions
33+
run: |
34+
docker run --rm -t \
35+
-v $PWD/code/extensions/che-commands:/workspace/project \
36+
quay.io/che-incubator/dash-licenses:next --check
37+
- name: Check che-github-authentication dependencies usage restrictions
38+
run: |
39+
docker run --rm -t \
40+
-v $PWD/code/extensions/che-github-authentication:/workspace/project \
41+
quay.io/che-incubator/dash-licenses:next --check
42+
- name: Check che-port dependencies usage restrictions
43+
run: |
44+
docker run --rm -t \
45+
-v $PWD/code/extensions/che-port:/workspace/project \
46+
quay.io/che-incubator/dash-licenses:next --check
47+
- name: Check che-remote dependencies usage restrictions
48+
run: |
49+
docker run --rm -t \
50+
-v $PWD/code/extensions/che-remote:/workspace/project \
51+
quay.io/che-incubator/dash-licenses:next --check
52+
- name: Check che-resource-monitor dependencies usage restrictions
53+
run: |
54+
docker run --rm -t \
55+
-v $PWD/code/extensions/che-resource-monitor:/workspace/project \
56+
quay.io/che-incubator/dash-licenses:next --check
57+
- name: Check che-terminal dependencies usage restrictions
58+
run: |
59+
docker run --rm -t \
60+
-v $PWD/code/extensions/che-terminal:/workspace/project \
61+
quay.io/che-incubator/dash-licenses:next --check

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,32 @@ For a main branch:
8686
$ git diff upstream-code/main main:code
8787
```
8888

89+
## License Check for Eclipse Che extensions
90+
License check tools work for the next extensions:
91+
1. `che-activity-tracker`
92+
2. `che-api`
93+
3. `che-commands`
94+
4. `che-github-authentication`
95+
5. `che-port`
96+
6. `che-remote`
97+
7. `che-resource-monitor`
98+
8. `che-terminal`
99+
100+
Dependencies usage restrictions could be checked with the `license:check` command. Example for `che-api`:
101+
102+
```bash
103+
$ npm --prefix code/extensions/che-api run license:generate
104+
```
105+
This command will check the dependencies used in the `che-api` extension and generate a report with the following files:
106+
- `prod.md` with the list of production dependencies;
107+
- `dev.md` which contains only build and test dependencies;
108+
- `problems.md` will be created if some dependencies are not covered with the referenced IP request(CQ).
109+
110+
These files wil be in the `code/extensions/che-api/.deps` directory.
111+
112+
**Note**: Detailed information on how to create the required CQs with
113+
[clearlydefined](https://clearlydefined.io/) can be found [here](https://docs.clearlydefined.io/docs/get-involved/adding-sources).
114+
89115
## Fixing the [`rebase-insiders`](https://github.com/che-incubator/che-code/actions/workflows/rebase-insiders.yml) Workflow?
90116
Upstream VS Code changes may bring a breakage to Che-Code. In this case, the [`rebase-insiders`](https://github.com/che-incubator/che-code/actions/workflows/rebase-insiders.yml) Workflow run is failed. To fix it, follow the steps below:
91117
1. Checkout to a new branch, e.g.`fix-rebase`.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
This file contains a manual contribution to .deps/dev.md and it's needed because eclipse/dash-licenses does not deal with work-with CQs (more see https://github.com/eclipse/dash-licenses/issues/13)
2+
3+
| Packages | Resolved CQs |
4+
| --- | --- |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
This file lists dependencies that do not need CQs or auto-detection does not work due to a bug in https://github.com/eclipse/dash-licenses
2+
3+
| Packages | Resolved CQs |
4+
| --- | --- |
5+

0 commit comments

Comments
 (0)