-
Notifications
You must be signed in to change notification settings - Fork 67
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
Add experimental releases for packages and datasets #382
Conversation
So far the available release types were beta and ga. In this PR experimental is added to the list and set as default. Having experimental around for packages provides some interesting options. Experimental packages are not shown in the search endpoint by default. To query for the experimental package the flag `experimental=true` has to be added. This allows to publish some packages without directly making it available to everyone. The idea is that we introduce in EPM a setting "Experimental" that users can enable to also see and install experimental packages. On the dataset level also experimental datasets exist. My expectation here is that these would not be shown by the Config Builder as long as Experimental:true is not enabled.
@mtojek If we go forward with this, my thinking would be that soon we switch the generator to have experimental as default, but first we need the setting in Kibana |
For EPM I think we can pass the flag if the user provide it in the query string for example.
Do you mean we can have experimental dataset inside a package that is not experimental? Also regarding name what do you think of using |
|
CHANGELOG.md
Outdated
@@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
* Add `removable` flag to package manifest. Default is true. [#359](https://github.com/elastic/integrations-registry/pull/359) | |||
* Add stream template to package json. [#335](https://github.com/elastic/integrations-registry/pull/335) | |||
* Add support for multiple inputs per dataset. [#346](https://github.com/elastic/integrations-registry/pull/346) | |||
* Add experimental releases for packages and datasets. [#](https://github.com/elastic/integrations-registry/pull/) |
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.
nit: missing PR reference
query := r.URL.Query() | ||
var experimental bool | ||
// Read query filter params which can affect the output | ||
if len(query) > 0 { |
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.
I think you can extract this block to a separate method.
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.
you mean to reuse it for categories and search?
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 and try to adjust the production code to be as concise as possible (SRP, KISS).
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.
The query part between search and categories is not identical, the part that could be reused is the check around the flag. I can extract that part if you prefer.
Side note: I don't consider copying code as a fundamentally bad thing ;-)
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.
Don't need to spend time right now, we can refactor it later on.
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, we have to.
if v := query.Get("experimental"); v != "" { | ||
if v != "" { | ||
// In case of error, keep it false | ||
experimental, _ = strconv.ParseBool(v) |
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.
I'm not fan of swallowing errors... this should reflect in HTTP 400 Bad Request.
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.
You are right, if wrong params are submitted, we should just error and not assume defaults like we do here. As this applies to also the other api params, ok if I follow up with it?
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.
Sounds good!
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.
@nchaulet At Elastic we often use the 3 stages of a product: experimental, beta, ga. I tried to align it to this.
query := r.URL.Query() | ||
var experimental bool | ||
// Read query filter params which can affect the output | ||
if len(query) > 0 { |
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.
you mean to reuse it for categories and search?
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.
@mtojek Thanks for the 👍 Will merge as soon as green (pushed the changelog) but then we have to follow up with the error fixes and simplifying the code.
query := r.URL.Query() | ||
var experimental bool | ||
// Read query filter params which can affect the output | ||
if len(query) > 0 { |
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, we have to.
I filed elastic/kibana#64869 as a follow up for Kibana. |
I missed this initially, but this reads like there would be 3 or N flags (experimental, beta, ga). Is that correct? Can multiple values be supplied? e.g. ?experimental=true&ga=true&beta=true Since these all correspond to a single release field, I'd expect a single param, like release=experimental. Multiple could be ? release=experimental,ga,beta or ?release=experimental&release=ga&release=beta |
Currently it is 3, I could see a 4th one coming which is Lets assume we go with the I'm now wondering if both flags can be come useful. |
So far the available release types were beta and ga. In this PR experimental is added to the list and set as default.
Having experimental around for packages provides some interesting options. Experimental packages are not shown in the search endpoint by default. To query for the experimental package the flag
experimental=true
has to be added. This allows to publish some packages without directly making it available to everyone.The idea is that we introduce in EPM a setting "Experimental" that users can enable to also see and install experimental packages.
On the dataset level also experimental datasets exist. My expectation here is that these would not be shown by the Config Builder as long as Experimental:true is not enabled.