Commit graph

2 commits

Author SHA1 Message Date
David Olaru
0dabc52fef
[kbn-code-owners] General improvements (#204023)
## Summary
The following improvements have been made:
- Added `--json` flag to CLI command to output result as JSON
- Terminology updated to more accurately reflect object contents
- Code owner teams are always returned as an array
- Search path validation (is under repo root, exists)
- Proper handling of inline comments
- Better logging for `scripts/check_ftr_code_owners.js`

Existing usage of the `@kbn/code-owners` package has been updated
accordingly, without modifying outcomes.
2024-12-12 12:05:01 -06:00
Tre
8a79173c4e
[Test Owners] Add script to get owners for files (#193277)
## Summary

Node script to report ownership of a given file in our repo.

The script's source of truth is `.github/CODEOWNERS`, which is generated
by `@kbn/generate`

In order to reach the goal of have zero files without code ownership,
this is one small step along the way.

### To Test

#### Happy Path
`node scripts/get_owners_for_file.js --file
packages/kbn-ace/src/ace/modes/index.ts`
```
 succ elastic/kibana-management
```

#### Unknown Path
`node scripts/get_owners_for_file.js --file some-file.txt`
```
ERROR Ownership of file [some-file.txt] is UNKNOWN
```

#### Error Path
`node scripts/get_owners_for_file.js`
```
ERROR Missing --flag argument

  node scripts/get_owners_for_file.js

  Report file ownership from GitHub CODEOWNERS file.

  Options:
    --file             Required, path to the file to report owners for.
    --verbose, -v      Log verbosely
    --debug            Log debug messages (less than verbose)
    --quiet            Only log errors
    --silent           Don't log anything
    --help             Show this message
```

### Notes

Along with this small pr, next will be to ensure owners are assigned to
all ES and KBN Archives. See more info in the link below:

Contributes to: https://github.com/elastic/kibana/issues/192979

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-09-20 14:16:08 +01:00