Skip to content

Commit 40abec0

Browse files
authored
chore: update license workflow and switch to nodejs wrapper (eclipse-theia#16456)
Resolves eclipse-theiaGH-13426 Resolves eclipse-theiaGH-16315 - add @eclipse-dash/nodejs-wrapper to dev dependencies - switch to dash-licenses - nodejs-wrapper - update workflow to run license check only for actual dependency updates (package-lock.json updates), manual trigger and daily cron job - add documentation for running license check in review mode for newly added dependencies - remove unused dependency-check-baseline file and update gitignore
1 parent 0307d53 commit 40abec0

File tree

8 files changed

+33
-290
lines changed

8 files changed

+33
-290
lines changed

.github/workflows/license-check.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@ on:
44
push:
55
branches:
66
- master
7+
paths:
8+
- 'package-lock.json'
79
workflow_dispatch:
810
pull_request:
911
branches:
1012
- master
13+
paths:
14+
- 'package-lock.json'
1115
schedule:
1216
- cron: '0 4 * * *' # Runs every day at 4am: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule
1317

1418
jobs:
15-
1619
License-check:
1720
name: 3PP License Check
1821

@@ -44,8 +47,8 @@ jobs:
4447
distribution: 'adopt'
4548
java-version: ${{ matrix.java }}
4649

47-
- name: Run dash-licenses
48-
if: matrix.tests != 'skip'
50+
- name: Run dash-licenses check
4951
shell: bash
5052
run: |
53+
npm ci
5154
npm run license:check

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@ gh-pages
2828
dev-packages/electron/compile_commands.json
2929
*.tsbuildinfo
3030
.eslintcache
31-
scripts/download
32-
dependency-check-summary.txt*
3331
*-trace.json
3432
.tours
3533
/performance-result.json
3634
*.vsix
3735
/scripts/native-dependencies-*
3836
allure-results
3937
.claude
38+
license-check-summary.txt*

configs/license-check-config.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"project": "ecd.theia",
3+
"inputFile": "package-lock.json",
4+
"batch": 50,
5+
"timeout": 240,
6+
"summary": "license-check-summary.txt"
7+
}

dependency-check-baseline.json

Lines changed: 0 additions & 2 deletions
This file was deleted.

doc/pull-requests.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ If a rule causes distress during discussions itself, it has to be reviewed on [t
5353
- [3.](#checklist-breaking-changes) Breaking changes are justified and recorded in the [changelog](https://github.com/eclipse-theia/theia/blob/master/CHANGELOG.md).
5454
<a name="checklist-dependencies"></a>
5555
- [4.](#checklist-dependencies) New dependencies are justified and [verified](https://github.com/eclipse-theia/theia/wiki/Registering-CQs#wip---new-ecd-theia-intellectual-property-clearance-approach-experimental).
56+
- For newly added dependencies, we run the [license check workflow](../.github/workflows/license-check.yml), but not in review mode.
57+
- If the license check reveals that a review is needed for the new dependency (i.e., `ERROR: Found results that aren't part of the baseline! X some-dependency, some-license`), we need to run the license check in review mode (`npm run license:check:review`).
58+
- Since we have no PAT secret defined for the repo at the moment, the license check in review mode needs to be done locally, either by the contributor (if they are a Theia committer) or by the reviewer.
5659
<a name="checklist-copied-code"></a>
5760
- [5.](#checklist-copied-code) Copied code is justified and [approved via a CQ](https://github.com/eclipse-theia/theia/wiki/Registering-CQs#case-3rd-party-project-code-copiedforked-from-another-project-into-eclipse-theia-maintained-by-us).
5861
- Look closely at the GitHub actions running for your PR: the 3pp/dash license check should be green.

package-lock.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"@types/express": "^4.17.21"
1111
},
1212
"devDependencies": {
13+
"@eclipse-dash/nodejs-wrapper": "^0.0.1",
1314
"@types/chai": "4.3.0",
14-
"minimatch": "^10.0.3",
1515
"@types/chai-spies": "1.0.3",
1616
"@types/chai-string": "^1.4.0",
1717
"@types/jsdom": "^21.1.7",
@@ -41,6 +41,7 @@
4141
"ignore-styles": "^5.0.1",
4242
"jsdom": "^22.1.0",
4343
"lerna": "^7.1.1",
44+
"minimatch": "^10.0.3",
4445
"mkdirp": "^0.5.0",
4546
"nan": "2.23.0",
4647
"node-abi": "^4.12.0",
@@ -72,8 +73,8 @@
7273
"docs:packages": "node scripts/generate-typedoc-per-package.js",
7374
"docs:merge": "node scripts/merge-package-typedocs.js",
7475
"download:plugins": "theia download:plugins",
75-
"license:check": "node scripts/check_3pp_licenses.js",
76-
"license:check:review": "node scripts/check_3pp_licenses.js --review",
76+
"license:check": "npx dash-licenses-wrapper --configFile=./configs/license-check-config.json",
77+
"license:check:review": "npx dash-licenses-wrapper --configFile=./configs/license-check-config.json --review",
7778
"lint": "lerna run lint",
7879
"lint:clean": "rimraf .eslintcache",
7980
"lint:fix": "lerna run lint -- --fix",

0 commit comments

Comments
 (0)