elastic / elastic/elastic-package
Add subcommand to query information of packages
- Dominant language
- Go
- Stars
- 72
- Forks
- 141
- Avg merge
- 19h 42m
- Merged PRs (30d)
- 55
Description
Add a subcommand that can serve as framework to query properties of packages. This command would be used to quickly interpret certain features, what could be reused in scripts.
The kind of features that could be queried could be things such as the minimum supported stack version, the subscription level, if it includes agentless configurations and so on.
For example in https://github.com/elastic/integrations/pull/13377 we added a mage target to get the subscription level of a package. This logic could be part of this framework, so it can be more easily reused.
The framework could be quite open, and not intended to be ortogonal. For example supporting the extraction of information from `elastic.subscription` doesn't mean that we should be able to extract information from the `kibana.constraint`.
Values should be strings, ready to use by other scripts without additional parsing. Some examples of exposed data could be:
- `min_supported_stack_version`: To help in CI to start the oldest supported stack, something we do in PRs in the integrations repository.
- `min_stack_version_for_logsdb_testing`: When testing with logsdb, we use the oldest version between the oldest supported stack version, and the first GA version with logsdb, 8.17. This logic could be included in this command.
- `includes_agentless_policies`: To query if it has any configuration related to agentless.
- `min_stack_elastic_subscription`: To query the minimum subscription level, as expected by the `stack.elastic_subscription` variable.
In general this framework should be the place to go when we find ourselves needing to parse information from packages to be used in other tools that have access to `elastic-package`.
Some example subcommands could be:
- `elastic-package inspect all`: prints all variables in some human friendly format.
- `elastic-package inspect all --format json`: prints all variables and their values in json format.
- `elastic-package inspect all --format env`: prints all variables as environment variables that can be evaluated.
- `elastic-package inspect raw min_supported_stack_version`: prints the raw value of the `min_supported_stack_version` variable.
- `elastic-package stack up -v -d --version ${elastic-package inspect raw min_supported_stack_version}` could be combined to start a stack with the oldest supported version.
- `elastic-package stack up -v -d -U stack.elastic_subscription=${elastic-package inspect raw min_stack_elastic_subscription}` could be combined to start a stack with the minimum supported subscription level.
Contributor guide
No contributing guide indexed for this repository
Research direction
No files, tests, or existing entry points are named. Start by reviewing the current elastic-package subcommand structure and the package metadata used by the integrations example; then define the inspect subcommands, supported output formats, and exposed variables before implementing and validating the proposed script-oriented behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100