Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds some missing licenses to the CSV export #78719

Merged
merged 3 commits into from
Sep 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion tasks/licenses_csv_report.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import { writeFileSync } from 'fs';
import { resolve } from 'path';
import { getInstalledPackages } from '../src/dev/npm';
import { engines } from '../package';
import { LICENSE_OVERRIDES } from '../src/dev/license_checker';

import { isNull, isUndefined } from 'lodash';
Expand Down Expand Up @@ -51,7 +52,7 @@ function formatCsvValues(fields, values) {

export default function licensesCSVReport(grunt) {
grunt.registerTask('licenses:csv_report', 'Report of 3rd party dependencies', async function () {
const fields = ['name', 'version', 'url', 'license'];
const fields = ['name', 'version', 'url', 'license', 'sourceURL'];
const done = this.async();

try {
Expand All @@ -65,13 +66,33 @@ export default function licensesCSVReport(grunt) {
dev,
});

packages.unshift(
{
name: 'Node.js',
version: engines.node,
repository: 'https://nodejs.org',
licenses: ['MIT'],
},
{
name: 'Red Hat Universal Base Image minimal',
version: '8',
repository:
'https://catalog.redhat.com/software/containers/ubi8/ubi-minimal/5c359a62bed8bd75a2c3fba8',
licenses: [
'Custom;https://www.redhat.com/licenses/EULA_Red_Hat_Universal_Base_Image_English_20190422.pdf',
],
sourceURL: 'https://oss-dependencies.elastic.co/redhat/ubi/ubi-minimal-8-source.tar.gz',
}
);

const csv = packages
.map((pkg) => {
const data = {
name: pkg.name,
version: pkg.version,
url: pkg.repository || `https://www.npmjs.com/package/${pkg.name}`,
license: pkg.licenses.join(','),
sourceURL: pkg.sourceURL,
};

return formatCsvValues(fields, data);
Expand Down