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

Move prerelease compatibility code to common place, add unit tests #892

Merged
merged 1 commit into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions categories.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,6 @@ func newCategoriesFilterFromQuery(query url.Values) (*packages.Filter, error) {
if err != nil {
return nil, fmt.Errorf("invalid 'experimental' query param: '%s'", v)
}

// For compatibility with older versions of Kibana.
if filter.Experimental {
filter.Prerelease = true
}
}

if v := query.Get("prerelease"); v != "" {
Expand Down
7 changes: 4 additions & 3 deletions packages/packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,14 @@ func (f *Filter) Apply(ctx context.Context, packages Packages) Packages {
// Checks that only the most recent version of an integration is added to the list
var packagesList Packages
for _, p := range packages {
// Skip experimental packages if flag is not specified
// Skip experimental packages if flag is not specified.
if p.Release == ReleaseExperimental && !f.Experimental {
continue
}

// Skip prerelease packages by default
if p.IsPrerelease() && !f.Prerelease {
// Skip prerelease packages by default.
// Ignore condition if experimental flag is used (older Kibanas).
if !f.Experimental && p.IsPrerelease() && !f.Prerelease {
continue
}

Expand Down
Loading