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

Prerelease toggle #143853

Merged
merged 46 commits into from
Nov 2, 2022
Merged

Conversation

juliaElastic
Copy link
Contributor

@juliaElastic juliaElastic commented Oct 24, 2022

Summary

Closes #122973

  • Added prerelease toggle to Integrations list, disabled by default (meaning that prerelease version packages are filtered out)
  • On changing the toggle, the setting is saved to the backend in Fleet Settings SO.
  • On subsequent reloads, the value of the toggle value is read from the settings.
  • On navigating to a package with prerelease version, a callout is displayed with a button to navigate to latest GA version
  • When the latest prerelease version is newer than a GA version, a version select is displayed on the Integration page.

Pending functionality:

  • Verify the display of Upgrade available button
  • Update unit and functional tests
  • Update OpenAPI spec
  • Fix scenario when package latest GA is installed, and the newer prerelease version is not showing up as latest

Test instructions

Option 1: use v2 dev registry which has some prerelease packages

  • Add this to your kibana config:
xpack.fleet.registryUrl: https://epr-v2.ea-web.elastic.dev/
  • Test with endpoint package, which has endpoint-8.6.0-dev.0 prerelease version.

Option 2: setup local registry

docker run -p 8080:8080 -v <path to unzipped dir>/input-packages/packages:/packages/test-packages -v <path to unzipped dir>/input-packages/package_registry_config.yml:/package-registry/config.yml docker.elastic.co/package-registry/package-registry:main
  • Add this to your kibana config:
xpack.fleet.registryUrl: http://localhost:8080
  • The test registry contains 2 versions of elastic_agent package: 1.3.5 (GA) and 1.3.6-preview (beta).
  • The toggle can be verified by searching on the elastic_agent package. The GA version should be displayed when the toggle is off, and the newer Beta version when the toggle is on.

image

image

image

image

Checklist

@juliaElastic juliaElastic added Team:Fleet Team label for Observability Data Collection Fleet team release_note:feature Makes this part of the condensed release notes v8.6.0 labels Oct 24, 2022
@juliaElastic juliaElastic self-assigned this Oct 24, 2022
@juliaElastic
Copy link
Contributor Author

@elasticmachine merge upstream

@juliaElastic juliaElastic changed the title WIP: prerelease toggle Prerelease toggle Oct 26, 2022
@juliaElastic juliaElastic marked this pull request as ready for review October 26, 2022 11:00
@juliaElastic juliaElastic requested review from a team as code owners October 26, 2022 11:00
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@nchaulet
Copy link
Member

Should we allow the user to set that settings programatically in their kibana config file?

@juliaElastic
Copy link
Contributor Author

Should we allow the user to set that settings programatically in their kibana config file?

Discussed this with @kpollich and decided not to add to kibana config for now, as it would complicate things - we would have to disable the setting on the UI to avoid getting in inconsistent state with the config.

@juliaElastic juliaElastic requested a review from a team as a code owner October 26, 2022 12:28
@nchaulet nchaulet self-requested a review October 28, 2022 13:37
@@ -57,7 +57,7 @@ async function deletePackage(name: string, version: string) {

async function getAllPackages() {
const res = await fetch(
`${REGISTRY_URL}/search?experimental=true&kibana.version=${KIBANA_VERSION}`,
`${REGISTRY_URL}/search?prerelease=true&kibana.version=${KIBANA_VERSION}`,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should we try to install the prerelease version of packages here or only the GA ones?

Copy link
Member

Choose a reason for hiding this comment

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

I think we may want to make this configurable but that can probably be done later.

@juliaElastic
Copy link
Contributor Author

@elasticmachine merge upstream

@juliaElastic
Copy link
Contributor Author

@elasticmachine merge upstream

@juliaElastic juliaElastic requested review from nchaulet and a team November 1, 2022 07:16
@@ -35,16 +34,13 @@ export async function bulkInstallPackages({
}: BulkInstallPackagesParams): Promise<BulkInstallResponse[]> {
const logger = appContextService.getLogger();

// auto upgrade to prerelease versions only if the setting is enabled
const prerelease = await getPrereleaseFromSettings(savedObjectsClient);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed using the settings after discussing here #122973 (comment)

@@ -100,7 +108,7 @@ export const mapToCard = ({
fromIntegrations: selectedCategory,
integration: 'integration' in item ? item.integration || '' : '',
name: 'name' in item ? item.name : item.id,
version: 'version' in item ? item.version || '' : '',
version,
Copy link
Contributor Author

@juliaElastic juliaElastic Nov 1, 2022

Choose a reason for hiding this comment

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

Fixing a bug when a GA version is installed (e.g. endpoint-8.5.0), the release badge on Installed integrations tab was showing Beta. I think this was misleading and the badge should show the installed version's release.

Also, on Browse integrations tab, changed the integration card to link to the latest version of the integration, not the installed one as currently. Though I am not sure if the intention here was to show the latest or installed version. In main branch, the card shows a link to the installed version, but the version and release badge is based on the latest version, so it is inconsistent.

Copy link
Member

Choose a reason for hiding this comment

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

Also, on Browse integrations tab, changed the integration card to link to the latest version of the integration, not the installed one as currently. Though I am not sure if the intention here was to show the latest or installed version. In main branch, the card shows a link to the installed version, but the version and release badge is based on the latest version, so it is inconsistent.

Should we browse to the installed version from the installed tab and to the latest from the browse all, or it is odd?

Copy link
Contributor Author

@juliaElastic juliaElastic Nov 1, 2022

Choose a reason for hiding this comment

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

Should we browse to the installed version from the installed tab and to the latest from the browse all, or it is odd?

Yeah, this was the most intuitive to me too, this is how it works in the pr currently.

Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

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

Tested locally and it looks good to me 🚀

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
fleet 729 732 +3

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
fleet 896 897 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fleet 851.1KB 854.9KB +3.8KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
fleet 17 18 +1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
fleet 114.1KB 114.5KB +418.0B

Saved Objects .kibana field count

Every field in each saved object type adds overhead to Elasticsearch. Kibana needs to keep the total field count below Elasticsearch's default limit of 1000 fields. Only specify field mappings for the fields you wish to search on or query. See https://www.elastic.co/guide/en/kibana/master/saved-objects-service.html#_mappings

id before after diff
ingest_manager_settings 3 4 +1
Unknown metric groups

API count

id before after diff
fleet 999 1000 +1

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 57 63 +6
osquery 103 108 +5
securitySolution 439 445 +6
total +19

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 65 71 +6
osquery 104 110 +6
securitySolution 516 522 +6
total +20

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @juliaElastic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:feature Makes this part of the condensed release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fleet] Add option to toggle search of prerelease packages
8 participants