Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code owners check - match files and directories #197805

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

pheyos
Copy link
Member

@pheyos pheyos commented Oct 25, 2024

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

@pheyos pheyos added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting v9.0.0 skip-ci labels Oct 25, 2024
@pheyos pheyos requested a review from wayneseymour October 25, 2024 11:31
@pheyos pheyos self-assigned this Oct 25, 2024
@pheyos pheyos requested a review from a team as a code owner October 25, 2024 11:31
@pheyos pheyos merged commit b680626 into elastic:main Oct 25, 2024
17 checks passed
@pheyos pheyos deleted the adjust_co_check_script branch October 25, 2024 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes skip-ci v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants