Skip to content

Commit b4c59fa

Browse files
committed
[QA] Generate Code Owners
Record to codeowners. Types fixup Not done yet, but so far I've got a sorta-solution for just the files, not the excludeFiles. The rub is that one of my expressions breaks when I use the real rule set. There's something in the real rule set that I'm not considering. But, I'm sleepy lol Meh, for codeowners, this is done.
1 parent 4c810be commit b4c59fa

File tree

9 files changed

+900
-22
lines changed

9 files changed

+900
-22
lines changed

.ci/Jenkinsfile_coverage

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ kibanaPipeline(timeoutMinutes: 240) {
1212
]) {
1313
workers.base(name: 'coverage-worker', size: 'l', ramDisk: false, bootstrapped: false) {
1414
catchError {
15-
kibanaCoverage.runTests()
16-
kibanaTeamAssign.load('team_assignment', "### Upload Team Assignment JSON")
17-
handleIngestion(TIME_STAMP)
15+
// kibanaCoverage.runTests()
16+
// kibanaTeamAssign.load('team_assignment', "### Upload Team Assignment JSON")
17+
// handleIngestion(TIME_STAMP)
18+
kibanaTeamAssign.generateCodeOwners('.github/CODEOWNERS', "### Generate CODEOWNERS")
1819
}
1920
handleFail()
2021
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { createFlagError, run, RunContext } from '../run';
21+
import { rules } from './ownership_config';
22+
import { record } from './record';
23+
24+
const description = `
25+
26+
Create .github/CODEOWNERS file from authoritative source
27+
28+
`;
29+
30+
export const generateCodeOwners = () => {
31+
run(
32+
({ flags, log }: RunContext) => {
33+
if (flags.codeOwnersPath === '')
34+
throw createFlagError('please provide a single --codeOwnersPath flag');
35+
36+
record(flags.codeOwnersPath as string, log, rules);
37+
},
38+
{
39+
description,
40+
flags: {
41+
string: ['codeOwnersPath'],
42+
help: `
43+
--codeOwnersPath Required, path to CODEOWNERS file.
44+
`,
45+
},
46+
}
47+
);
48+
};

0 commit comments

Comments
 (0)