Skip to content

Add subcommand to query information of packages #2528

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

Open
jsoriano opened this issue Apr 9, 2025 · 0 comments
Open

Add subcommand to query information of packages #2528

jsoriano opened this issue Apr 9, 2025 · 0 comments
Labels
Team:Ecosystem Label for the Packages Ecosystem team

Comments

@jsoriano
Copy link
Member

jsoriano commented Apr 9, 2025

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 elastic/integrations#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.
@mrodm mrodm added the Team:Ecosystem Label for the Packages Ecosystem team label Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Ecosystem Label for the Packages Ecosystem team
Projects
None yet
Development

No branches or pull requests

2 participants