-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Ingest Manager] Do not await in start. Return a Promise #69505
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
e30cfb2
WIP. Pushing for CI
911ded9
Don't throw. Use Promise.reject
8e8f42f
Merge branch 'master' into no-await-setup-return-promise
elasticmachine afe7767
Reject with an Error; not a string
f594be3
WIP. Pushing for CI
2c29cd7
Don't throw. Use Promise.reject
e61e7ec
Reject with an Error; not a string
ab0217e
Merge branch 'no-await-setup-return-promise' of github.com:jfsiii/kib…
e10df84
Add Ingest setup to Endpoint FTR tests.
214ef3d
Keep promise variable inside try block
b47c3b7
Be consistent with other services in this test
87e293c
Remove displayToast b/c error instance is required
e2d705c
Refactor to a single return & add more error types
a80d63d
Update x-pack/plugins/ingest_manager/public/plugin.ts
jfsiii a23d5ca
Fix whitespace issue
8da8797
Undo changes to endpoint api_integration tests
a26c8cf
Update x-pack/test/api_integration/apis/endpoint/policy.ts
jfsiii 608f97e
Merge branch 'master' into do-not-await-in-im-setup
elasticmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
9 changes: 9 additions & 0 deletions
9
x-pack/plugins/ingest_manager/common/types/rest_spec/ingest_setup.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export interface PostIngestSetupResponse { | ||
isInitialized: boolean; | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,13 @@ | |
*/ | ||
import { FtrProviderContext } from '../../ftr_provider_context'; | ||
|
||
export default function ({ loadTestFile }: FtrProviderContext) { | ||
export default function ({ loadTestFile, getService }: FtrProviderContext) { | ||
describe('endpoint', function () { | ||
this.tags('ciGroup7'); | ||
|
||
const ingestManager = getService('ingestManager'); | ||
before(async () => { | ||
await ingestManager.setup(); | ||
}); | ||
Comment on lines
+11
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! |
||
loadTestFile(require.resolve('./endpoint_list')); | ||
loadTestFile(require.resolve('./policy_list')); | ||
loadTestFile(require.resolve('./policy_details')); | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,12 @@ | |
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { services as apiIntegrationServices } from '../../api_integration/services'; | ||
import { services as xPackFunctionalServices } from '../../functional/services'; | ||
import { EndpointPolicyTestResourcesProvider } from './endpoint_policy'; | ||
|
||
export const services = { | ||
...xPackFunctionalServices, | ||
ingestManager: apiIntegrationServices.ingestManager, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 nice |
||
policyTestResources: EndpointPolicyTestResourcesProvider, | ||
}; |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found the naming a little confusing, what do you thing to have something like
initializationPromise
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reminder. I agree that the name could be improved. Perhaps we could use the
isInitialized
orisReady
names we use in the setup responses[1]?I was initially trying to make smallest external change but we already made it a breaking change by making it a promise so I guess we might as well name it what we want.
[1] I should file a ticket to make these consistent