Skip to content

Commit

Permalink
[CI] [license check] Always specify project
Browse files Browse the repository at this point in the history
During CI we run `dash-licenses` to check that the project's 3PP dependencies are
approved by the Eclipse foundation. When a PR originates from the main repo, a
token is available that permits running the tool in "automated review mode",
which opens IP tickets automatically towards the Eclipse Foundation. When a
PR originates from elsewhere, that token is not available and so we fall-back
to reporting issues in the CI log.

Until now, the "-project" option of `dash-licenses` was only thought useful
in "automated review" mode, but it turns-out there is a rare case where we
benefit providing this information all the time: when a 3PP dependency was
narrowly approved, for use in Eclipse Theia only. Here is one such dependency:

https://gitlab.eclipse.org/eclipsefdn/emo-team/iplab/-/issues/2734

The dependency above is part of a recent PR from an outside contributor
(non-committer), that originated from a fork:

#12141

So far, for PRs originating from a fork, we would not provide the project when
running `dash-licenses` and so such dependency are incorrectly flagged as
unapproved:

https://github.com/eclipse-theia/theia/actions/runs/4075784869/jobs/7077702838#step:5:186

This commit provides the project all the time, so that such dependencies will
be correctly assessed, based on what's approved for our project, even for
non-committer contributors.

Signed-off-by: Marc Dumais <[email protected]>
  • Loading branch information
marcdumais-work committed Feb 6, 2023
1 parent d59d527 commit d0f8c8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/check_3pp_licenses.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ async function main() {
fs.renameSync(dashLicensesSummary, `${dashLicensesSummary}.old`);
}
info('Running dash-licenses...');
const args = ['-jar', dashLicensesJar, 'yarn.lock', '-batch', '50', '-timeout', '240', '-summary', dashLicensesSummary];
const args = ['-jar', dashLicensesJar, 'yarn.lock', '-batch', '50', '-timeout', '240', '-project', project, '-summary', dashLicensesSummary];
if (autoReviewMode && personalAccessToken) {
info(`Using "review" mode for project: ${project}`);
args.push('-review', '-token', personalAccessToken, '-project', project);
args.push('-review', '-token', personalAccessToken);
}
const dashError = getErrorFromStatus(spawn('java', args, {
stdio: ['ignore', 'ignore', 'inherit']
Expand Down

0 comments on commit d0f8c8c

Please sign in to comment.