Code owners - sort generated entries (#198901)

## Summary

This PR adds sorting by path to the code owners generation. This
improves readability and also avoid problems where ownership entries for
nested test plugins (e.g.
`x-pack/test/alerting_api_integration/common/plugins/alerts
@elastic/response-ops`) are overridden with the empty top level test
package entry (`x-pack/test`) when it's placed further down in the code
owners file.
This commit is contained in:
Robert Oskamp 2024-11-06 13:38:31 +01:00 committed by GitHub
parent 0e99a779e2
commit e9fd052ef1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 548 additions and 543 deletions

1086
.github/CODEOWNERS vendored

File diff suppressed because it is too large Load diff

View file

@ -62,6 +62,11 @@ export const CodeownersCommand: GenerateCommand = {
content = content.slice(0, ultStart);
}
// sort genarated entries by directory name
// this improves readability and makes sure that ownership for nested
// test plugins is not overriden by the parent package's entry
pkgs.sort((a, b) => a.directory.localeCompare(b.directory));
const newCodeowners = `${GENERATED_START}${pkgs
.map(
(pkg) =>