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

Make task manager index configurable again #42394

Merged
merged 8 commits into from
Aug 6, 2019

Conversation

mikecote
Copy link
Contributor

@mikecote mikecote commented Jul 31, 2019

In this PR, I'm making the task manager index configurable again. This was changed to static in this PR #39829 and will be configurable again once this PR merges.

Some of the core changes required:

  • Make indexPattern in savedObjectsSchemas string | (config) => string instead of only being a string. This allows to pull values from the server config.
  • Make createIndexMap constructor args a single destructured argument
  • Make createIndexMap take an instance of SavedObjectsSchema instead of the raw savedObjectsSchemas to avoid code duplication.

@mikecote mikecote self-assigned this Jul 31, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-stack-services

@elasticmachine

This comment has been minimized.

@mikecote mikecote force-pushed the task-manager/custom-index branch from 1869b3d to a2b4fe5 Compare August 1, 2019 13:00
@elasticmachine

This comment has been minimized.

@elasticmachine

This comment has been minimized.

@mikecote mikecote marked this pull request as ready for review August 1, 2019 18:16
@mikecote mikecote requested a review from a team as a code owner August 1, 2019 18:16
@mikecote mikecote requested a review from a team August 1, 2019 18:16
@mikecote mikecote added the review label Aug 1, 2019
@mikecote mikecote requested a review from a team August 1, 2019 18:16
Copy link
Contributor

@eliperelman eliperelman left a comment

Choose a reason for hiding this comment

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

LGTM

src/core/server/saved_objects/schema/schema.ts Outdated Show resolved Hide resolved
@mikecote mikecote requested a review from bmcconaghy August 1, 2019 19:30
convertToAliasScript: `ctx._id = ctx._source.type + ':' + ctx._id`,
indexPattern(config) {
return config.get('xpack.task_manager.index');
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I was expecting the entire savedObjectSchema to be a function to be more similar to other uiExports. If you're confident there's no use case for that, then this is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I can't think of any yet. I believe if we make a function at the savedObjectSchema level and use reducers, I don't think the config object is available at that time. But so far this is the only configurable property I can think of.

@mikecote

This comment has been minimized.

@elasticmachine

This comment has been minimized.

@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@bmcconaghy bmcconaghy left a comment

Choose a reason for hiding this comment

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

Code LGTM

Copy link
Contributor

@bmcconaghy bmcconaghy left a comment

Choose a reason for hiding this comment

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

Code LGTM

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

LGTM

@mikecote mikecote merged commit ef02bf9 into elastic:master Aug 6, 2019
mikecote added a commit to mikecote/kibana that referenced this pull request Aug 6, 2019
* Initial work

* Fix type check

* Accept core API changes

* Fix broken tests

* Destructure index pattern
mikecote added a commit that referenced this pull request Aug 6, 2019
* Initial work

* Fix type check

* Accept core API changes

* Fix broken tests

* Destructure index pattern
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants