Skip to content
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

Merged
merged 2 commits into from
Apr 27, 2020

Conversation

ruflin
Copy link
Member

@ruflin ruflin commented Apr 24, 2020

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.

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.
@ruflin ruflin self-assigned this Apr 24, 2020
@ruflin
Copy link
Member Author

ruflin commented Apr 24, 2020

@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
@neptunian @nchaulet Would be such a setting for EPM possible?
@jen-huang WDYT about the dataset part that is not shown if experimental?

@nchaulet
Copy link
Member

For EPM I think we can pass the flag if the user provide it in the query string for example.

On the dataset level also experimental datasets exist

Do you mean we can have experimental dataset inside a package that is not experimental?

Also regarding name what do you think of using alpha instead of experimental I think it sounds more a versioning concern.

@mtojek
Copy link
Contributor

mtojek commented Apr 27, 2020

@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

import-beats bases on the release tag in Beats. We can ignore the Beats tag at all and set everywhere "experimental" for every package.

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/)
Copy link
Contributor

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 {
Copy link
Contributor

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.

Copy link
Member Author

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?

Copy link
Contributor

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).

Copy link
Member Author

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 ;-)

Copy link
Contributor

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.

Copy link
Member Author

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)
Copy link
Contributor

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.

Copy link
Member Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good!

Copy link
Member Author

@ruflin ruflin left a 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 {
Copy link
Member Author

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?

@mtojek mtojek self-requested a review April 27, 2020 11:43
Copy link
Member Author

@ruflin ruflin left a 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 {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we have to.

@ruflin ruflin merged commit fb405e7 into elastic:master Apr 27, 2020
@ruflin ruflin deleted the experimental-flag branch April 27, 2020 11:52
@ruflin
Copy link
Member Author

ruflin commented Apr 30, 2020

I filed elastic/kibana#64869 as a follow up for Kibana.

@jfsiii
Copy link

jfsiii commented Apr 30, 2020

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

@ruflin
Copy link
Member Author

ruflin commented Apr 30, 2020

Currently it is 3, I could see a 4th one coming which is deprecated.

Lets assume we go with the release param. If no query is provided, it would return beta,ga by default. Now what happens if release=experimental is used, will it only return experimental ones or also beta,ga?

I'm now wondering if both flags can be come useful. release as you suggest it is a filter. experimental=true as a boolean is a shortcut for release=experimental,beta,ga.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants