Skip to content

Commit

Permalink
[FTR] Fixup code owners check script (elastic#192453)
Browse files Browse the repository at this point in the history
## Summary

Ensure paths with empty owner annotations are included in the scripts
output for missing code owners

## Notes

With this change, the output of the script goes from this:
```
succ All test files have a code owner (checked 8243 test files in 6.78 s)
```
to this:
```
...
       - x-pack/test_serverless/functional/test_suites/security/cypress/tasks/navigation.ts
       - x-pack/test_serverless/functional/test_suites/security/index.feature_flags.ts
       - x-pack/test_serverless/functional/test_suites/security/index.ts
       - x-pack/test_serverless/functional/test_suites/security/screenshot_creation/index.ts
       - x-pack/test_serverless/kibana.jsonc
       - x-pack/test_serverless/tsconfig.json
ERROR Found 2594 test files without code owner (checked 8243 test files in 7.48 s)
```

Eventually, this script will be included in checks on ci, such that when
it returns an error, the checks will fail and report back to a given PR
owner.
  • Loading branch information
wayneseymour committed Sep 10, 2024
1 parent 65e53eb commit 3610dee
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export async function runCheckFtrCodeOwnersCli() {
const testFiles = await getRepoFiles(TEST_DIRECTORIES);
for (const { repoRel } of testFiles) {
const owners = getCodeOwnersForFile(repoRel, reversedCodeowners);
if (owners === undefined) {
if (owners === undefined || owners === '') {
missingOwners.add(repoRel);
}
}
Expand Down

0 comments on commit 3610dee

Please sign in to comment.