mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
## Summary - Updates `scripts/dependency_ownership` to use the `@kbn/dev-cli-runner` for consistency with other CI-related CLIs. - Adds a new `failIfUnowned` flag to exit with an error code if any dependencies are unowned. - Adds a new dependency ownership check to `quick_checks` and `renovate` CI steps. From a CI run, the additional quick check executes successfully in 3 seconds: ```sh info [quick-checks] Passed check: /opt/buildkite-agent/builds/bk-agent-prod-gcp-abc123/elastic/kibana-pull-request/kibana/.buildkite/scripts/steps/checks/dependencies_missing_owner.sh in 3s ``` --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> |
||
---|---|---|
.. | ||
bin | ||
src | ||
jest.config.js | ||
kibana.jsonc | ||
package.json | ||
README.md | ||
tsconfig.json |
@kbn/dependency-ownership
A CLI tool for analyzing package ownership.
Table of Contents
- Show all packages owned by a specific team
- Show who owns specific dependency
- List all dependencies with without owner
- Generate dependency ownership report
1. Show all packages owned by a specific team
Use this command to list all packages or plugins within a directory that use a specified dependency.
node scripts/dependency_ownership -o <owner>
or
node scripts/dependency_ownership --owner <owner>
Example:
node scripts/dependency_ownership -o @elastic/kibana-core
-o @elastic/kibana-core
: Specifies the team.
Output: Lists dev and prod dependencies.
{
"prodDependencies": [
"<dependency_1>",
"<dependency_2>",
"<dependency_3>",
//...
],
"devDependencies": [
"<dependency_1>",
"<dependency_2>",
//...
]
}
2. Show who owns specific dependency
Get the owner for a specific dependency.
node scripts/dependency_ownership -d <dependency>
or
node scripts/dependency_ownership --dependency <dependency>
Example:
node scripts/dependency_ownership -d rxjs
-d rxjs
: Specifies the dependency.
Output: Lists owners for rxjs
.
[
"@elastic/kibana-core"
]
3. List all dependencies with without owner
To display all dependencies that do not have owner defined.
node scripts/dependency_ownership --missing-owner
Example:
node scripts/dependency_ownership --missing-owner
Output: Lists all dev and prod dependencies without owner.
{
"prodDependencies": [
"<dependency_1>",
"<dependency_2>",
//...
],
"devDependencies": [
"<dependency_1>",
"<dependency_2>",
//...
]
}
4. Generate dependency ownership report
Generates a comprehensive report with all dependencies with and without owner.
node scripts/dependency_ownership --missing-owner
Example:
node scripts/dependency_ownership --missing-owner
Output: Lists all covered dev and prod dependencies, uncovered dev and prod dependencies, dependencies aggregated by owner.
{
"coveredProdDependencies": [ // Prod dependencies with owner
"<dependency_1>",
"<dependency_2>",
//...
],
"coveredDevDependencies": [ // Dev dependencies with owner
"<dependency_1>",
"<dependency_2>",
//...
],
"uncoveredProdDependencies": [ // Prod dependencies without owner
"<dependency_1>",
"<dependency_2>",
//...
],
"uncoveredDevDependencies": [ // Dev dependencies without owner
"<dependency_1>",
"<dependency_2>",
//...
],
"prodDependenciesByOwner": { // Prod dependencies aggregated by owner
"@elastic/team_1": ["<dependency_1>"],
"@elastic/team_2": ["<dependency_1>"],
},
"devDependenciesByOwner": { // Dev dependencies aggregated by owner
"@elastic/team_1": ["<dependency_1>"],
"@elastic/team_2": ["<dependency_1>"],
},
}
For further information on additional flags and options, refer to the script's help command.