Commit graph

6 commits

Author SHA1 Message Date
Jon
a26f5d8b61
[codeowners] Filter kibanamachine (#199404)
Currently we remove CODEOWNERS on backport branches to avoid review
assignments: reviews were already collected on the source pull request.
If there's a conflict, it will go through another round of review but
not require all the original assignees.

We want to re-add the file for our own tooling, and to avoid CODEOWNERS
merge conflicts on backports. To do this, we're going to add a global
override to code assignments on backport branches.

This updates our CODEOWNERS libraries to ignore assignments to
`kibanamachine`.

---------

Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
2024-11-12 12:39:17 -06:00
Robert Oskamp
b6806267cf
Code owners check - match files and directories (#197805)
## Summary

This PR modifies the code owners check to allow "file" matches for
"directory" entries.

### Details

Taking the code owner entry
`/x-pack/test_serverless/**/test_suites/**/ml/ @elastic/ml-ui` as an
example. Note the trailing slash in the path, indicating a directory.
Before this PR, if we asked the script for the code owner of
`x-pack/test_serverless/functional/test_suites/security/ml`, it would
not match, because this requested path doesn't have the trailing slash,
thus asking for the file `ml` and not the directory. While this is
technically correct, it's just too easy to overlook this detail and get
a false negative as a result.
This PR is removing trailing slashes from the code owners entries when
adding them to the lookup table, so they now match both, directory and
file requests (and requests for everything within the directory). So
going back to the example, all these owner requests would be matched and
return `@elastic/ml-ui` as the owner:
* `x-pack/test_serverless/functional/test_suites/security/ml`
* `x-pack/test_serverless/functional/test_suites/security/ml/`
* `x-pack/test_serverless/functional/test_suites/security/ml/index.ts`
2024-10-25 14:08:10 +02:00
Tre
4172226750
[FTR] Fixup err msg for scripts/get_owners_for_file.js (#193581)
## Summary

Follow up of [incorrect
wording](https://github.com/elastic/kibana/pull/193277#discussion_r1768630448)
2024-09-20 16:32:20 +01: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
Luke Elmers
b6287708f6
Adds AGPL 3.0 license (#192025)
Updates files outside of x-pack to be triple-licensed under Elastic
License 2.0, AGPL 3.0, or SSPL 1.0.
2024-09-06 19:02:41 -06:00
Robert Oskamp
6272d5af6f
Add script to check test file code ownership (#173411)
## Summary

This PR adds a script that determines GitHub code ownership for
functional test files in the Kibana repository.

### Why do we need this?

We want to be able to determine test ownership to allow teams to get a
better overview of their tests (number of tests, number of skipped
tests, number of failures in the last x days, etc).

### What does this PR bring?

This PR is a first step on closing the test ownership gaps. It adds
functionality to determine the GitHub code owner for a given file (in
the `@kbn/code-owners` package) and adds a script that makes use of this
to check if all functional test files have a code owner, reporting the
gaps.

### Future plans

The idea is to include the test ownership information in our ingested
test results, such that we can create dashboards, reports, etc based on
it.
At some point (once all ownership gaps are closed), we might consider
running this check on CI to prevent new test files without owners.

### How to run?

```
node scripts/check_ftr_code_owners.js
```
The script lists the functional test files that are not covered by code
owners and also gives a summary like this:
```
ERROR Found 2592 test files without code owner (checked 7550 test files in 12.73 s)
```
2023-12-18 17:41:39 +01:00