[Search] serverless: add in_trial config value#232703
[Search] serverless: add in_trial config value#232703TattdCodeMonkey merged 7 commits intoelastic:mainfrom
in_trial config value#232703Conversation
in_trial config valuein_trial config value
Adding an explicit boolean in_trial config value for serverless projects to set. This will be used for the context of the feature flag service in lieu of the trial_end_date used for cloud hosted.
94c314d to
da6cb59
Compare
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
There was a problem hiding this comment.
Serverless projects do not currently have config values to determine trialEndDate.
For ECH, trialEndDate is set by adding the org trial length to the organization creation date, neither of which are currently available in the serverless controllers.
trialEndDate is used in Kibana to determine if inTrial should be set for Feature Flag context, and some other things like usage collection.
This work aims to provide a way to know if a serverless project is in trial.
We need to test if trial is set on the controllers:
- create a trial org
- create a project
- check the kubernetes cluster to see if trial is set on the controllers.
There was a problem hiding this comment.
Pull Request Overview
This PR adds an explicit boolean in_trial configuration value for serverless projects to indicate whether the organization is currently in trial. This provides an alternative to using trial_end_date for determining trial status in serverless environments, specifically for use with the feature flag service.
- Adds new
in_trialboolean configuration option to the cloud plugin's serverless config schema - Updates cloud plugin interfaces and implementations to expose
organizationInTrialproperty - Modifies cloud usage collector to prioritize
organizationInTrialover date-based trial detection
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| x-pack/platform/plugins/shared/cloud/server/config.ts | Adds in_trial schema definition and exposes it in the allowlist |
| x-pack/platform/plugins/shared/cloud/server/plugin.ts | Updates CloudSetup interface and plugin implementation to include organizationInTrial |
| x-pack/platform/plugins/shared/cloud/public/types.ts | Adds organizationInTrial to public CloudStart and CloudSetup interfaces |
| x-pack/platform/plugins/shared/cloud/public/plugin.tsx | Updates public plugin to expose organizationInTrial from config |
| x-pack/platform/plugins/shared/cloud/server/collectors/cloud_usage_collector.ts | Modifies usage collector to prioritize organizationInTrial over date-based trial detection |
| x-pack/platform/plugins/shared/cloud/server/collectors/cloud_usage_collector.test.ts | Adds test coverage for the new organizationInTrial functionality |
| x-pack/platform/plugins/private/cloud_integrations/cloud_experiments/common/metadata_service/initialize_metadata.ts | Updates metadata initialization to include in_trial from serverless config |
| x-pack/platform/plugins/private/cloud_integrations/cloud_experiments/common/metadata_service/metadata_service.test.ts | Adds test for in_trial metadata handling |
| x-pack/platform/plugins/shared/cloud/server/snapshots/plugin.test.ts.snap | Updates snapshot to include new organizationInTrial property |
| src/platform/test/plugin_functional/test_suites/core_plugins/rendering.ts | Adds functional test coverage for the new config option |
|
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Page load bundle
History
|
| organizationId, | ||
| trialEndDate, | ||
| ...(trialEndDateMs ? { inTrial: Date.now() <= trialEndDateMs } : {}), | ||
| ...(organizationInTrial |
There was a problem hiding this comment.
nit: extract to a helper
There was a problem hiding this comment.
+1, I'd actually like to add a helper to the plugin contract as well so that date check doesn't have to be done outside of the cloud plugin either.
But I'll see about handling all of that in another PR.
## Summary Adding an explicit boolean `in_trial` config value for serverless projects to set. This will be used for the context of the feature flag service in lieu of the `trial_end_date` used for cloud hosted. ### Checklist - [ ] ~Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)~ - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary Adding an explicit boolean `in_trial` config value for serverless projects to set. This will be used for the context of the feature flag service in lieu of the `trial_end_date` used for cloud hosted. ### Checklist - [ ] ~Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)~ - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary Adding an explicit boolean `in_trial` config value for serverless projects to set. This will be used for the context of the feature flag service in lieu of the `trial_end_date` used for cloud hosted. ### Checklist - [ ] ~Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)~ - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary Adding an explicit boolean `in_trial` config value for serverless projects to set. This will be used for the context of the feature flag service in lieu of the `trial_end_date` used for cloud hosted. ### Checklist - [ ] ~Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)~ - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary Adding an explicit boolean `in_trial` config value for serverless projects to set. This will be used for the context of the feature flag service in lieu of the `trial_end_date` used for cloud hosted. ### Checklist - [ ] ~Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)~ - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary Added the isInTrial helper function to the cloud plugin setup & start interfaces that allow checking if the deployment or serverless project are in trial based on either the trial_end_date or serverless.in_trial config values being set. Adding a function allows the date comparison to be handled by the cloud plugin and possibly updated in the future without consumers needing to know the details of how we verify if the cluster is within a trial cloud organization. This is a follow-up to [#232703](#232703) where I added the `serverless.in_trial` config value. In subsequent PRs it was discussed we should have a helper on the cloud function to give uniform way to access "in trial". ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] ~Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)~ - [ ] ~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials~ - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] ~If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~ - [ ] ~This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations.~ - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] ~The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)~ - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels.
## Summary Added the isInTrial helper function to the cloud plugin setup & start interfaces that allow checking if the deployment or serverless project are in trial based on either the trial_end_date or serverless.in_trial config values being set. Adding a function allows the date comparison to be handled by the cloud plugin and possibly updated in the future without consumers needing to know the details of how we verify if the cluster is within a trial cloud organization. This is a follow-up to [elastic#232703](elastic#232703) where I added the `serverless.in_trial` config value. In subsequent PRs it was discussed we should have a helper on the cloud function to give uniform way to access "in trial". ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] ~Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)~ - [ ] ~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials~ - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] ~If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~ - [ ] ~This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations.~ - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] ~The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)~ - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels.
## Summary Added the isInTrial helper function to the cloud plugin setup & start interfaces that allow checking if the deployment or serverless project are in trial based on either the trial_end_date or serverless.in_trial config values being set. Adding a function allows the date comparison to be handled by the cloud plugin and possibly updated in the future without consumers needing to know the details of how we verify if the cluster is within a trial cloud organization. This is a follow-up to [elastic#232703](elastic#232703) where I added the `serverless.in_trial` config value. In subsequent PRs it was discussed we should have a helper on the cloud function to give uniform way to access "in trial". ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] ~Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)~ - [ ] ~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials~ - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] ~If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~ - [ ] ~This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations.~ - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] ~The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)~ - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels.
## Summary Added the isInTrial helper function to the cloud plugin setup & start interfaces that allow checking if the deployment or serverless project are in trial based on either the trial_end_date or serverless.in_trial config values being set. Adding a function allows the date comparison to be handled by the cloud plugin and possibly updated in the future without consumers needing to know the details of how we verify if the cluster is within a trial cloud organization. This is a follow-up to [elastic#232703](elastic#232703) where I added the `serverless.in_trial` config value. In subsequent PRs it was discussed we should have a helper on the cloud function to give uniform way to access "in trial". ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [ ] ~Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)~ - [ ] ~[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials~ - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] ~If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~ - [ ] ~This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations.~ - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] ~The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)~ - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels.
Summary
Adding an explicit boolean
in_trialconfig value for serverless projects to set. This will be used for the context of the feature flag service in lieu of thetrial_end_dateused for cloud hosted.Checklist
Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n supportrelease_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesbackport:*labels.