Skip to content

Commit 3d6b2f6

Browse files
opensearch-trigger-bot[bot]github-actions[bot]tmarkleyananzhzhongnansu
authored
[Manual backport 1.x] Updates NOTICE file, adds validation to GitHub CI & Corrects NOTICE f… (#3453) (#3596)
* Updates NOTICE file, adds validation to GitHub CI (#3051) * Aligns NOTICE with rules outlined in opensearch-project/.github#21. * Adds NOTICE validation to the build and test workflow. * Fixes product name discrepancies between repository NOTICE file and the generated NOTICE file for the build. * Skips template-izing the build and test workflow since that's being worked on in #2991. Resolves #765 * Corrects NOTICE file copyright date range (#3308) * Corrects NOTICE file copyright date range * Follow-up on #3051 Resolves #765 * Update CHANGELOG.md --------- (cherry picked from commit bf1c65f) Signed-off-by: Tommy Markley <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Tommy Markley <[email protected]> Co-authored-by: Anan Zhuang <[email protected]> Co-authored-by: Zhongnan Su <[email protected]> Co-authored-by: Miki <[email protected]> Co-authored-by: Ashwin P Chandran <[email protected]>
1 parent d74e0a6 commit 3d6b2f6

File tree

6 files changed

+42
-130
lines changed

6 files changed

+42
-130
lines changed

.github/workflows/build_and_test_workflow.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ jobs:
6565
id: linter
6666
run: yarn lint
6767

68+
- name: Validate NOTICE file
69+
id: notice-validate
70+
run: yarn notice:validate
71+
6872
- name: Run unit tests with coverage
6973
id: unit-tests
7074
run: yarn test:jest:ci:coverage
@@ -138,6 +142,10 @@ jobs:
138142
id: linter
139143
run: yarn lint
140144

145+
- name: Validate NOTICE file
146+
id: notice-validate
147+
run: yarn notice:validate
148+
141149
- name: Run unit tests with coverage
142150
id: unit-tests
143151
run: yarn test:jest:ci:coverage

NOTICE.txt

Lines changed: 12 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
OpenSearch
2-
Copyright 2021 OpenSearch Contributors
3-
This product includes software, including Kibana source code, developed by Elasticsearch (http://www.elastic.co).
4-
Copyright 2012-2021 Elasticsearch B.V.
1+
OpenSearch (https://opensearch.org/)
2+
Copyright OpenSearch Contributors
3+
4+
This product includes software, including Kibana source code,
5+
developed by Elasticsearch (http://www.elastic.co).
6+
Copyright 2009-2021 Elasticsearch B.V.
7+
8+
This product includes software developed by The Apache Software
9+
Foundation (http://www.apache.org/)
10+
11+
This product includes software developed by
12+
Joda.org (http://www.joda.org/).
513
---
614
Pretty handling of logarithmic axes.
715
Copyright (c) 2007-2014 IOLA and Ole Laursen.
@@ -115,10 +123,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
115123
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
116124
THE SOFTWARE.
117125

118-
---
119-
This product uses Noto fonts that are licensed under the SIL Open
120-
Font License, Version 1.1.
121-
122126
---
123127
Based on the scroll-into-view-if-necessary module from npm
124128
https://github.com/stipsan/compute-scroll-into-view/blob/master/src/index.ts#L269-L340
@@ -145,70 +149,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
145149
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
146150
SOFTWARE.
147151

148-
---
149-
Detection Rules
150-
Copyright 2020 Elasticsearch B.V.
151-
152-
---
153-
This product bundles rules based on https://github.com/BlueTeamLabs/sentinel-attack
154-
which is available under a "MIT" license. The files based on this license are:
155-
156-
- defense_evasion_via_filter_manager
157-
- discovery_process_discovery_via_tasklist_command
158-
- persistence_priv_escalation_via_accessibility_features
159-
- persistence_via_application_shimming
160-
- defense_evasion_execution_via_trusted_developer_utilities
161-
162-
MIT License
163-
164-
Copyright (c) 2019 Edoardo Gerosa, Olaf Hartong
165-
166-
Permission is hereby granted, free of charge, to any person obtaining a copy of
167-
this software and associated documentation files (the "Software"), to deal in
168-
the Software without restriction, including without limitation the rights to
169-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
170-
of the Software, and to permit persons to whom the Software is furnished to do
171-
so, subject to the following conditions:
172-
173-
The above copyright notice and this permission notice shall be included in all
174-
copies or substantial portions of the Software.
175-
176-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
177-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
178-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
179-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
180-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
181-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
182-
SOFTWARE.
183-
184-
---
185-
This product bundles rules based on https://github.com/FSecureLABS/leonidas
186-
which is available under a "MIT" license. The files based on this license are:
187-
188-
- credential_access_secretsmanager_getsecretvalue.toml
189-
190-
MIT License
191-
192-
Copyright (c) 2020 F-Secure LABS
193-
194-
Permission is hereby granted, free of charge, to any person obtaining a copy
195-
of this software and associated documentation files (the "Software"), to deal
196-
in the Software without restriction, including without limitation the rights
197-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
198-
copies of the Software, and to permit persons to whom the Software is
199-
furnished to do so, subject to the following conditions:
200-
201-
The above copyright notice and this permission notice shall be included in all
202-
copies or substantial portions of the Software.
203-
204-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
205-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
206-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
207-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
208-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
209-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
210-
SOFTWARE.
211-
212152
---
213153
MIT License
214154

@@ -306,43 +246,3 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
306246
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
307247
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
308248

309-
---
310-
This product includes code in the function applyCubicBezierStyles that was
311-
inspired by a public Codepen, which was available under a "MIT" license.
312-
313-
Copyright (c) 2020 by Guillaume (https://codepen.io/guillaumethomas/pen/xxbbBKO)
314-
MIT License http://www.opensource.org/licenses/mit-license
315-
316-
---
317-
This product includes code that is adapted from mapbox-gl-js, which is
318-
available under a "BSD-3-Clause" license.
319-
https://github.com/mapbox/mapbox-gl-js/blob/master/src/util/image.js
320-
321-
Copyright (c) 2016, Mapbox
322-
323-
All rights reserved.
324-
325-
Redistribution and use in source and binary forms, with or without modification,
326-
are permitted provided that the following conditions are met:
327-
328-
* Redistributions of source code must retain the above copyright notice,
329-
this list of conditions and the following disclaimer.
330-
* Redistributions in binary form must reproduce the above copyright notice,
331-
this list of conditions and the following disclaimer in the documentation
332-
and/or other materials provided with the distribution.
333-
* Neither the name of Mapbox GL JS nor the names of its contributors
334-
may be used to endorse or promote products derived from this software
335-
without specific prior written permission.
336-
337-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
338-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
339-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
340-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
341-
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
342-
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
343-
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
344-
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
345-
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
346-
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
347-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
348-

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
"test:ftr:server": "node scripts/functional_tests_server",
5757
"test:ftr:runner": "node scripts/functional_test_runner",
5858
"checkLicenses": "node scripts/check_licenses --dev",
59+
"notice:validate": "node scripts/notice --validate",
60+
"notice:generate": "node scripts/notice",
5961
"build-platform": "node scripts/build",
6062
"build": "node scripts/build --all-platforms",
6163
"start": "node scripts/opensearch_dashboards --dev",

src/dev/build/tasks/notice_file_task.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const CreateNoticeFile: Task = {
3939
log.info('Generating notice from source');
4040
log.indent(4);
4141
const noticeFromSource = await generateNoticeFromSource({
42-
productName: 'OpenSearch',
42+
productName: 'OpenSearch (https://opensearch.org/)',
4343
directory: build.resolvePath(),
4444
log,
4545
});

src/dev/notice/cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ if (opts.help) {
8282
(async function run() {
8383
const path = resolve(REPO_ROOT, 'NOTICE.txt');
8484
const newContent = await generateNoticeFromSource({
85-
productName: 'OpenSearch Dashboards source code',
85+
productName: 'OpenSearch (https://opensearch.org/)',
8686
directory: REPO_ROOT,
8787
log,
8888
});

src/dev/notice/generate_notice_from_source.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ import { ToolingLog } from '@osd/dev-utils';
3535

3636
const NOTICE_COMMENT_RE = /\/\*[\s\n\*]*@notice([\w\W]+?)\*\//g;
3737
const NEWLINE_RE = /\r?\n/g;
38+
const NOTICE_TEXT = `Copyright OpenSearch Contributors
39+
40+
This product includes software, including Kibana source code,
41+
developed by Elasticsearch (http://www.elastic.co).
42+
Copyright 2009-2021 Elasticsearch B.V.
43+
44+
This product includes software developed by The Apache Software
45+
Foundation (http://www.apache.org/)
46+
47+
This product includes software developed by
48+
Joda.org (http://www.joda.org/).`;
3849

3950
interface Options {
4051
/**
@@ -91,17 +102,10 @@ export async function generateNoticeFromSource({ productName, directory, log }:
91102
.on('end', resolve);
92103
});
93104

94-
let noticeText = '';
95-
noticeText += `${productName}\n`;
96-
noticeText += `Copyright ${new Date().getUTCFullYear()} OpenSearch Contributors\n\n`;
97-
noticeText += `This product includes software developed by Elasticsearch (http://www.elastic.co).\n`;
98-
noticeText += `Copyright 2009-2018 Elasticsearch\n\n`;
99-
noticeText += `This product includes software developed by The Apache Software Foundation (http://www.apache.org/)\n\n`;
100-
noticeText += `This product includes software developed by Joda.org (http://www.joda.org/).\n`;
101-
105+
let notice = `${productName}\n` + NOTICE_TEXT;
102106
for (const comment of noticeComments.sort()) {
103-
noticeText += '\n---\n';
104-
noticeText += comment
107+
notice += '\n---\n';
108+
notice += comment
105109
.split(NEWLINE_RE)
106110
.map((line) =>
107111
line
@@ -112,11 +116,9 @@ export async function generateNoticeFromSource({ productName, directory, log }:
112116
)
113117
.join('\n')
114118
.trim();
115-
noticeText += '\n';
119+
notice += '\n';
116120
}
117-
118-
noticeText += '\n';
119-
120-
log.debug(`notice text:\n\n${noticeText}`);
121-
return noticeText;
121+
notice += '\n';
122+
log.debug(`notice text:\n\n${notice}`);
123+
return notice;
122124
}

0 commit comments

Comments
 (0)