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

[so-migrationsv2] Use named arguments in migrationsv2 actions #100964

Conversation

TinaHeiligers
Copy link
Contributor

@TinaHeiligers TinaHeiligers commented May 29, 2021

Summary

Resolves #99242
Uses named arguments in saved object migrations v2 actions.

Naming is hard™ and the refactor uses the same argument names as the those used in the actions' function.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@TinaHeiligers TinaHeiligers added enhancement New value added to drive a business result v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.14.0 project:ResilientSavedObjectMigrations Reduce Kibana upgrade failures by making saved object migrations more resilient labels May 29, 2021
@TinaHeiligers TinaHeiligers marked this pull request as ready for review May 30, 2021 02:37
@TinaHeiligers TinaHeiligers requested a review from a team as a code owner May 30, 2021 02:37
/** @internal */
export interface FetchIndicesParams {
client: ElasticsearchClient;
indicesToFetch: string[];
Copy link
Contributor

Choose a reason for hiding this comment

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

optional: in sake of consistency: index: string[] or indices: string[]

/**
* Since we don't run a search against the target index, we disable "refresh" to speed up
* the migration process.
* Although any further step must run "refresh" for the target index
* before we reach out to the MARK_VERSION_INDEX_READY step.
* Right now, it's performed during OUTDATED_DOCUMENTS_REFRESH step.
*/
false
),
refresh: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

optional: maybe we can make it optional with false default?

sourceIndex: state.legacyIndex,
targetIndex: state.sourceIndex.value,
reindexScript: state.preMigrationScript,
requireAlias: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

optional: I can't find whether it's used with other values. Maybe we should remove the parameter? The same for 60s in waitForReindexTask and waitForPickupUpdatedMappingsTask

@TinaHeiligers TinaHeiligers enabled auto-merge (squash) May 31, 2021 21:22
@TinaHeiligers TinaHeiligers added the auto-backport Deprecated - use backport:version if exact versions are needed label May 31, 2021
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

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
osquery 10 - -10
Unknown metric groups

API count

id before after diff
osquery 10 - -10

History

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

@TinaHeiligers TinaHeiligers merged commit d6828a2 into elastic:master May 31, 2021
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 31, 2021
…c#100964)

* Use named arguments in migrationsv2 actions

* Addresses some optional review feedback
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Jun 1, 2021
… (#101023)

* Use named arguments in migrationsv2 actions

* Addresses some optional review feedback

Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
@TinaHeiligers TinaHeiligers deleted the so-migrationsv2/actions_use_named_args branch June 1, 2021 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed enhancement New value added to drive a business result project:ResilientSavedObjectMigrations Reduce Kibana upgrade failures by making saved object migrations more resilient release_note:skip Skip the PR/issue when compiling release notes v7.14.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use named arguments in Migration actions
4 participants