You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In repositories with multiple packages, and in elastic-package development itself, it is usual to run actions on multiple packages. For this, the developer usually needs to craft some kind of shell pipeline.
It could be useful to introduce in elastic-package a subcommand that can discover packages under certain rules and run some other subcommand for the discovered packages. For example the following command would add a changelog to all the modified packages under the packages directory.
The subcommand would contain a set of flags used to discover packages, that can be combined, for example:
--modified to select only packages with modified files.
--packages [glob] to select packages matching with a glob pattern.
--auto to walk the repository looking for compatible manifest files.
--constraint [constraint] to filter packages based on their constraints (like --constraint kibana.version=8.17.0).
Not all these flags would be needed in a first MVP, they could be added later, as well as other flags.
Technically, the foreach subcommand would call the specified subcommand for each one of the discovered packages, setting for the called subcommands the -C flag.
Other flags
There could be support for other flags that control execution of subcommands, for example --parallel 4 would allow the execution of four subcommands in parallel.
Available subcommands
In principle all subcommands would be supported, we would need to investigate what is the best implementation so the --help makes sense and avoid loops between subcommands.
Additionally, we could add some kind of query subcommand that could help in shell pipelines or just listing info from packages. For example the following to list the name of modified packages:
In repositories with multiple packages, and in elastic-package development itself, it is usual to run actions on multiple packages. For this, the developer usually needs to craft some kind of shell pipeline.
It could be useful to introduce in elastic-package a subcommand that can discover packages under certain rules and run some other subcommand for the discovered packages. For example the following command would add a changelog to all the modified packages under the packages directory.
Or to test elastic-package while development with a set of packages:
In general, its usage would be like this:
Discovery flags
The subcommand would contain a set of flags used to discover packages, that can be combined, for example:
--modified
to select only packages with modified files.--packages [glob]
to select packages matching with a glob pattern.--auto
to walk the repository looking for compatible manifest files.--constraint [constraint]
to filter packages based on their constraints (like--constraint kibana.version=8.17.0
).Not all these flags would be needed in a first MVP, they could be added later, as well as other flags.
Technically, the
foreach
subcommand would call the specified subcommand for each one of the discovered packages, setting for the called subcommands the-C
flag.Other flags
There could be support for other flags that control execution of subcommands, for example
--parallel 4
would allow the execution of four subcommands in parallel.Available subcommands
In principle all subcommands would be supported, we would need to investigate what is the best implementation so the
--help
makes sense and avoid loops between subcommands.Additionally, we could add some kind of
query
subcommand that could help in shell pipelines or just listing info from packages. For example the following to list the name of modified packages:The text was updated successfully, but these errors were encountered: