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

Deprecates SavedObjectType migrations and schemas in favor of modelVersions #176970

Conversation

TinaHeiligers
Copy link
Contributor

fix #176776

Saved objects modelVersions support BWC and ZDT and replace SavedObjectsType.schemas and SavedObjectsType.migrations properties.

This PR marks these two properties as deprecated.

The public facing docs have also been updated to the "new" way of implementing saved object changes.

Checklist

Delete any items that are not applicable to this PR.

@TinaHeiligers TinaHeiligers added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting docs v8.14.0 labels Feb 14, 2024
Copy link
Contributor

A documentation preview will be available soon.

Request a new doc build by commenting
  • Rebuild this PR: run docs-build
  • Rebuild this PR and all Elastic docs: run docs-build rebuild

run docs-build is much faster than run docs-build rebuild. A rebuild should only be needed in rare situations.

If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status here.

@TinaHeiligers
Copy link
Contributor Author

/ci

@TinaHeiligers TinaHeiligers marked this pull request as ready for review February 14, 2024 23:38
@TinaHeiligers TinaHeiligers requested a review from a team as a code owner February 14, 2024 23:38
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

otherwise there will be no validating when importing objects_

For implementation examples, refer to <<saved-objects-service-use-case-examples, Use-case examples>>.
=== Use-case examples
Copy link
Contributor

Choose a reason for hiding this comment

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

I think if you want to link to this section, you need an anchor, for example:

Suggested change
=== Use-case examples
[[saved-objects-service-use-case-examples]]
=== Use-case examples

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops,
Thanks!

@@ -0,0 +1,761 @@
[[saved-objects-service-use-case-examples]]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These should be on a different page but we can't nest off of a nested page.

@@ -0,0 +1,761 @@
[[saved-objects-service-use-case-examples]]
=== Use-case examples
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These examples come from the modelVersions.md doc

@@ -70,6 +70,7 @@ export interface SavedObjectsType<Attributes = any> {
mappings: SavedObjectsTypeMappingDefinition;
/**
* An optional map of {@link SavedObjectMigrationFn | migrations} or a function returning a map of {@link SavedObjectMigrationFn | migrations} to be used to migrate the type.
* @deprecated Use {@link SavedObjectsType.modelVersions | modelVersions} instead.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deprecates legacy properties to make it clear that going forward, changes have to be defined with new model versions.

@@ -177,7 +179,7 @@ export interface SavedObjectsType<Attributes = any> {
modelVersions?: SavedObjectsModelVersionMap | SavedObjectsModelVersionMapProvider;

/**
* Allows to opt-in to the new model version API.
* Allows to opt-in to the model version API.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The model version API won't be "new" for long.

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

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

Great work @TinaHeiligers ! I did not do a deep review of the documented content also not very familiar with all asciidoc features but this LGTM! Thanks for addressing this issue!

modelVersions: { ... },
// ...other optional properties
};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If above suggestion is accepted, also do this and de-indent content

Suggested change
}

@TinaHeiligers TinaHeiligers enabled auto-merge (squash) February 15, 2024 19:01
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

References to deprecated APIs

id before after diff
@kbn/core-saved-objects-api-server-internal 13 25 +12
@kbn/core-saved-objects-base-server-internal 0 18 +18
@kbn/core-saved-objects-migration-server-internal 28 100 +72
@kbn/core-saved-objects-migration-server-mocks 0 1 +1
@kbn/core-saved-objects-server-internal 9 10 +1
@kbn/core-test-helpers-so-type-serializer 4 33 +29
@kbn/core-ui-settings-server-internal 3 4 +1
@kbn/core-usage-data-server-internal 0 1 +1
actions 28 30 +2
alerting 118 119 +1
apm 29 30 +1
apmDataAccess 0 1 +1
canvas 80 83 +3
cases 19 24 +5
cloudSecurityPosture 4 7 +3
dashboard 30 32 +2
data 24 31 +7
dataViews 25 26 +1
eventAnnotation 5 6 +1
fleet 80 85 +5
graph 67 68 +1
infra 7 8 +1
lens 107 108 +1
links 2 3 +1
lists 38 40 +2
logsShared 0 1 +1
maps 30 31 +1
ml 27 30 +3
observability 5 6 +1
savedObjectsManagement 7 8 +1
savedSearch 9 11 +2
securitySolution 522 527 +5
share 3 6 +3
spaces 19 22 +3
synthetics 24 25 +1
taskManager 6 7 +1
uptime 12 13 +1
visualizations 79 81 +2
total +198

History

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

@TinaHeiligers TinaHeiligers merged commit cec949e into elastic:main Feb 15, 2024
16 checks passed
fkanout pushed a commit to fkanout/kibana that referenced this pull request Mar 4, 2024
…rsions (elastic#176970)

fix elastic#176776

Saved objects `modelVersions` support BWC and ZDT and replace
`SavedObjectsType.schemas` and `SavedObjectsType.migrations` properties.

This PR marks these two properties as deprecated.

The public facing docs have also been updated to the "new" way of
implementing saved object changes.

### Checklist

Delete any items that are not applicable to this PR.

- [x] 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/packages/kbn-i18n/README.md)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
TinaHeiligers added a commit that referenced this pull request Mar 7, 2024
fix [#178060](#178060)
Updates the internal developer docs for transitions to new model
versions.
The end-user docs were updated in
#176970

---------

Co-authored-by: Jean-Louis Leysens <[email protected]>
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 docs release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mark SavedObjectsType.schemas and SavedObjectsType.migrations as deprecated
5 participants