[9.0] Removed switchToModelVersionAt from SO API definition (#219029)#219329
Merged
TinaHeiligers merged 4 commits intoelastic:9.0from Apr 29, 2025
Merged
[9.0] Removed switchToModelVersionAt from SO API definition (#219029)#219329TinaHeiligers merged 4 commits intoelastic:9.0from
TinaHeiligers merged 4 commits intoelastic:9.0from
Conversation
## Summary Part of elastic#201807 **Strategy**: This PR assumes that `switchToModelVersionAt` has done it’s job and all SO type owners now use `modelVersions` instead of `migrations`. It takes the approach of trusting that this is fine™ **Changes in this PR:** - `switchToModelVersionAt` removed from all registered saved objects, so their mapping hash had to be updated. - Implements `globalSwitchToModelVersionAt` directly in `version_map` - Updates logic to prioritize `modelVersions` over `migrations` in `getLatestMappingsModelVersion`, that previously relied on `switchToModelVersionAt` being set - Updates unit tests to match the refactored logic - Updates snapshots - Adapts SO types registered in the **cases**, **SLO** and **encrypted saved objects** plugins. - Updates docs **Risks**: - Plugin developers disregard the deprecated status of `migrations` and introduce new versions, which will not be BWC. Saved object type hash changes will notify the core team for a code owner review. The core team needs to investigate the related changes and provide feedback. ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] [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 - [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) --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
3 tasks
… src/core/server/integration_tests/ci_checks'
Contributor
|
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
Contributor
Author
|
@elasticmachine merge upstream |
Contributor
💚 Build Succeeded
Metrics [docs]Unknown metric groupsAPI count
References to deprecated APIs
History
|
delanni
approved these changes
Apr 29, 2025
gsoldevila
added a commit
that referenced
this pull request
Jun 20, 2025
…20985) ## Summary * Address #217145 - Put in place a check to ensure we're upgrading from Kibana 8.18.0 or newer. * Address #220521 - New attempt at removing the `switchToModelVersionAt` property, inspired on #219029. The previous attempt caused a regression: index meta information started storing _modelVersions_ that were older than the previously stored ones, which were defaulting to 10.0.0 for SO types that did NOT define `modelVersions`. This was due to the removal of the applyTypeDefaults, which was ensuring all SOs had the `switchToModelVersionAt` property set. This flag was then used by `src/core/packages/saved-objects/base-server-internal/src/model_version/version_map.ts` to determine whether to use `modelVersions` or the legacy `migrations` property in order to determine the latest model version for a given type. When removing the `switchToModelVersionAt` flag (and its default backfill), the logic started defaulting to the latest `migrations` version for those SO types that were not defining any `modelVersion`, resulting in older versions that those stored in the SO indices. This caused incident https://elasticco.atlassian.net/browse/INC-3818. This regression has been shipped in 9.0.0 (the PR was [backported](#219329)), so in top of the cleanup, we now need to address #220521 to ensure a smooth transition _OnPrem => Serverless_. --------- Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
akowalska622
pushed a commit
to akowalska622/kibana
that referenced
this pull request
Jun 25, 2025
…astic#220985) ## Summary * Address elastic#217145 - Put in place a check to ensure we're upgrading from Kibana 8.18.0 or newer. * Address elastic#220521 - New attempt at removing the `switchToModelVersionAt` property, inspired on elastic#219029. The previous attempt caused a regression: index meta information started storing _modelVersions_ that were older than the previously stored ones, which were defaulting to 10.0.0 for SO types that did NOT define `modelVersions`. This was due to the removal of the applyTypeDefaults, which was ensuring all SOs had the `switchToModelVersionAt` property set. This flag was then used by `src/core/packages/saved-objects/base-server-internal/src/model_version/version_map.ts` to determine whether to use `modelVersions` or the legacy `migrations` property in order to determine the latest model version for a given type. When removing the `switchToModelVersionAt` flag (and its default backfill), the logic started defaulting to the latest `migrations` version for those SO types that were not defining any `modelVersion`, resulting in older versions that those stored in the SO indices. This caused incident https://elasticco.atlassian.net/browse/INC-3818. This regression has been shipped in 9.0.0 (the PR was [backported](elastic#219329)), so in top of the cleanup, we now need to address elastic#220521 to ensure a smooth transition _OnPrem => Serverless_. --------- Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto9.0:Questions ?
Please refer to the Backport tool documentation