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

[Fleet] Allow to specify kibana.version when fetching categories #695

Merged
merged 2 commits into from
May 11, 2021

Conversation

nchaulet
Copy link
Member

@nchaulet nchaulet commented May 10, 2021

Description

Related to elastic/kibana#94582

The categories count in Kibana is sometimes invalid has some package could not exists depending on the kibana version.

This PR fix it by allowing to pass the kibana.version (same parameter name used in the search handler) query params to the category handler, and filtering package that have the correct kibana version.

Examples

➜  ~ http http://localhost:8080/categories\?experimental\=true\&kibana.version\=7.11.0 | jq '.[] | select(.id =="elastic_stack")'
{
  "id": "elastic_stack",
  "title": "Elastic Stack",
  "count": 1
}
➜  ~ http http://localhost:8080/categories\?experimental\=true | jq '.[] | select(.id =="elastic_stack")'
{
  "id": "elastic_stack",
  "title": "Elastic Stack",
  "count": 3
}
``

@nchaulet nchaulet self-assigned this May 10, 2021
@elasticmachine
Copy link

elasticmachine commented May 10, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #695 updated

  • Start Time: 2021-05-11T12:40:00.971+0000

  • Duration: 7 min 42 sec

  • Commit: 1db74ed

Test stats 🧪

Test Results
Failed 0
Passed 179
Skipped 0
Total 179

Trends 🧪

Image of Build Times

Image of Tests

@nchaulet nchaulet force-pushed the feature-categories-kibana-version branch from a469ae8 to c2670e1 Compare May 10, 2021 15:44
@jen-huang jen-huang requested a review from a team May 10, 2021 22:10
Copy link
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

Thank you for working on the fix, nice finding BTW.

Would you mind covering relevant endpoints with unit tests? See: https://github.com/elastic/package-registry/blob/master/main_test.go#L32

Please also update the CHANGELOG file.

@nchaulet nchaulet requested a review from mtojek May 11, 2021 12:40
Copy link
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

LGTM!

Speaking of releasing this change, here is the guide: https://github.com/elastic/package-registry/#release

@nchaulet nchaulet merged commit 3efceb2 into elastic:master May 11, 2021
@nchaulet nchaulet deleted the feature-categories-kibana-version branch May 11, 2021 20:23
@nchaulet nchaulet mentioned this pull request May 12, 2021
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.

3 participants