-
Notifications
You must be signed in to change notification settings - Fork 78
Tool to help creating distributions of packages #1335
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
base: main
Are you sure you want to change the base?
Conversation
|
| Status | Scanner | Total (0) | ||||
|---|---|---|---|---|---|---|
| Open Source Security | 0 | 0 | 0 | 0 | See details | |
| Licenses | 0 | 0 | 0 | 0 | See details |
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.
mrodm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just take a quick look to this approach, and it looks nice!
This is a tool quite flexible allowing to set different queries to get the desired packages for different scenarios.
For instance it looks easy to create a distribution with just the packages available for Kibana 9.1.0.
The only consideration that I see is that it requires to know how the /search API works along with its query parameters. It will be needed to review the documentation to ensure that there is nothing missing.
| address: "https://epr.elastic.co" | ||
|
|
||
| # Queries are executed with each one of the parameters of the matrix. | ||
| matrix: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be similar to set the following matrix?
matrix:
- all: true
prereleaes: trueThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This configuration would be only getting the latest package that is compatible with each one of the versions, while using all: true would get all packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah got it, that's true. The example I wrote would download much more packages 👍
| - kibana.version: 8.18.0 | ||
| spec.max: 3.3 | ||
| - kibana.version: 8.18.1 | ||
| spec.max: 3.3 | ||
| - kibana.version: 8.18.2 | ||
| spec.max: 3.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As usually packages are defined, but it's true that not all of them, with Kibana constraints using ^ (e.g. ^8.18.0 || ^9.0.0), would this be equivalent to define it with just one for 8.18.x with the latest patch?
matrix:
...
- kibana.version: 8.18.2
spec.max: 3.3
...Just taking a look there are some packages using ~, for instance:
packages/aws/manifest.yml: version: "~8.16.6 || ~8.17.4 || ^8.18.0 || ^9.0.0"
And even there are packages using >=:
packages/cloud_asset_inventory/manifest.yml: version: ">=9.1.0"
cmd/distribution/main.go
Outdated
| "strings" | ||
|
|
||
| "github.com/google/go-querystring/query" | ||
| "golang.org/x/mod/semver" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use here github.com/Masterminds/semver/v3 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks.
💚 Build Succeeded
History
cc @jsoriano |
The tool makes queries to package registry to discover and download packages.
Users provide a configuration file that includes the set of queries to perform, each query receives parameters that map with query parameters. A matrix can be defined with parameters that should be included in all queries.
Actions can be also defined for each package.
Some small examples:
Download all available packages for 9.1.0, with format versions between 2.3 and 3.4.
Download all available packages for 9.1.0, with format versions between 2.3 and 3.4, including prereleases
A couple of more complex examples can be found in the PR:
lite.ymldownloads the latest version of the packages included in the lite distribution, for each one of the given versions of kibana.sample.ymldownloads the latest version of all packages, including their prereleases.