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

Fix sharing saved objects phase 2 CI #89056

Merged

Conversation

jportner
Copy link
Contributor

In #80945 we implemented the second phase of Sharing Saved Objects.

When backporting that PR to 7.x in #88917, CI failed because the Kibana version in the CI run is 7.12.0-SNAPSHOT. The DocumentMigrator threw errors because migrations existed for saved objects in 7.12.0, and the Semver library evaluates Semver.gt('7.12.0', '7.12.0-SNAPSHOT') === true. So I submitted this PR to coerce strings such as 7.12.0-SNAPSHOT to a regular semver, which will allow CI to pass.

This is required for CI runs when the Kibana version is a snapshot.
@jportner jportner added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.12.0 labels Jan 22, 2021
@jportner jportner requested a review from a team as a code owner January 22, 2021 04:04
minimumConvertVersion = DEFAULT_MINIMUM_CONVERT_VERSION,
log,
}: DocumentMigratorOptions) {
const kibanaVersion = rawKibanaVersion.split('-')[0]; // coerce a semver-like string (x.y.z-SNAPSHOT) or prerelease version (x.y.z-alpha) to a regular semver (x.y.z)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I first attempted to use the Semver.coerce function, which would coerce a prerelease version such as 7.12.0-alpha to a regular semver 7.12.0. However, this only appears to work for actual prerelease tags such as -alpha, not non-standard tags such as -SNAPSHOT. So I used a simple split which will work just as well.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

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

Copy link
Contributor

@rudolf rudolf left a comment

Choose a reason for hiding this comment

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

I actually ran into a similar problem when using kibanaVersion in the index name for v2 migrations. We can merge this to unblock your backport, but then I'll move this logic up one layer.

@jportner jportner merged commit 8263d47 into elastic:master Jan 22, 2021
@jportner jportner deleted the fix-sharing-saved-objects-phase-2-ci branch January 22, 2021 19:19
jportner added a commit to jportner/kibana that referenced this pull request Jan 22, 2021
@rudolf rudolf mentioned this pull request Jan 28, 2021
9 tasks
rudolf added a commit to rudolf/kibana that referenced this pull request Jan 28, 2021
rudolf added a commit that referenced this pull request Jan 28, 2021
* migrations v2: fix snapshot builds

* Revert "Fix sharing saved objects phase 2 CI (#89056)"

This reverts commit 8263d47.
rudolf added a commit to rudolf/kibana that referenced this pull request Feb 1, 2021
* migrations v2: fix snapshot builds

* Revert "Fix sharing saved objects phase 2 CI (elastic#89056)"

This reverts commit 8263d47.
rudolf added a commit to rudolf/kibana that referenced this pull request Feb 8, 2021
* migrations v2: fix snapshot builds

* Revert "Fix sharing saved objects phase 2 CI (elastic#89056)"

This reverts commit 8263d47.
rudolf added a commit that referenced this pull request Feb 9, 2021
* Enable v2 so migrations, disable in FTR tests (#89297)

* Enable v2 so migrations, disable in FTR tests

* Disable v2 migrations for ui_settings integration tests

* Disable v2 migrations for reporting without serucity api integration test
# Conflicts:
#	test/common/config.js

* migrations v2: fix snapshot builds (#89541)

* migrations v2: fix snapshot builds

* Revert "Fix sharing saved objects phase 2 CI (#89056)"

This reverts commit 8263d47.

* Fix documentMigrator for snapshot releases (#89936)

Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported release_note:skip Skip the PR/issue when compiling release notes v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants