-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Reverse dependency of home plugin and apm/ml/cloud #52883
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
df78b66
Apply linting rule and start fixing errors
flash1293 1bf487c
extend code ownership
flash1293 22fab28
also validate exports of shimmed plugins
flash1293 a23d8b3
change import paths
flash1293 87ac45b
Merge remote-tracking branch 'upstream/master' into lint-import-paths
flash1293 5173e7a
fix imports
flash1293 5659695
fix tests
flash1293 527bef4
fix import paths
flash1293 5a59b5d
Merge remote-tracking branch 'upstream/master' into lint-import-paths
flash1293 2f3f5f5
resolve conflicts in ml and fix broken references
flash1293 625b1a8
fix src import
flash1293 95f9474
reverse dependency between home and xpack plugins
flash1293 2c9afe8
move back resources and fix dashboard listing bug
flash1293 dc8ed1e
Merge remote-tracking branch 'upstream/master' into lint-import-paths
flash1293 3237ab0
Merge branch 'lint-import-paths' into home-cloud-contract
flash1293 5db54c1
Merge remote-tracking branch 'upstream/master' into home-cloud-contract
flash1293 b4b6774
fix merge issues
flash1293 b75d59c
Merge remote-tracking branch 'upstream/master' into home-cloud-contract
flash1293 bb09ea9
fix tests and make registration in legacy platform possible
flash1293 889a06b
Merge remote-tracking branch 'upstream/master' into home-cloud-contract
flash1293 372ac82
fix duplicate feature registration and revert timelion change
flash1293 a6cdda2
Merge branch 'master' into home-cloud-contract
elasticmachine ed7a06a
Merge remote-tracking branch 'upstream/master' into home-cloud-contract
flash1293 9316f29
add explicit test condition
flash1293 a7cdd6d
remove home ui export dependency from visualize embeddable
flash1293 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
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
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
54 changes: 54 additions & 0 deletions
54
src/plugins/home/public/services/environment/environment.mock.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,54 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { | ||
EnvironmentService, | ||
EnvironmentServiceSetup, | ||
EnvironmentServiceStart, | ||
} from './environment'; | ||
|
||
const createSetupMock = (): jest.Mocked<EnvironmentServiceSetup> => { | ||
const setup = { | ||
update: jest.fn(), | ||
}; | ||
return setup; | ||
}; | ||
|
||
const createStartMock = (): jest.Mocked<EnvironmentServiceStart> => { | ||
const start = { | ||
get: jest.fn(), | ||
}; | ||
return start; | ||
}; | ||
|
||
const createMock = (): jest.Mocked<PublicMethodsOf<EnvironmentService>> => { | ||
const service = { | ||
setup: jest.fn(), | ||
start: jest.fn(), | ||
}; | ||
service.setup.mockImplementation(createSetupMock); | ||
service.start.mockImplementation(createStartMock); | ||
return service; | ||
}; | ||
|
||
export const environmentServiceMock = { | ||
createSetup: createSetupMock, | ||
createStart: createStartMock, | ||
create: createMock, | ||
}; |
47 changes: 47 additions & 0 deletions
47
src/plugins/home/public/services/environment/environment.test.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,47 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { EnvironmentService } from './environment'; | ||
|
||
describe('EnvironmentService', () => { | ||
describe('setup', () => { | ||
test('allows multiple update calls', () => { | ||
const setup = new EnvironmentService().setup(); | ||
expect(() => { | ||
setup.update({ ml: true }); | ||
setup.update({ apmUi: true }); | ||
}).not.toThrow(); | ||
}); | ||
}); | ||
|
||
describe('start', () => { | ||
test('returns default values', () => { | ||
const service = new EnvironmentService(); | ||
expect(service.start().get()).toEqual({ ml: false, cloud: false, apmUi: false }); | ||
}); | ||
|
||
test('returns last state of update calls', () => { | ||
const service = new EnvironmentService(); | ||
const setup = service.setup(); | ||
setup.update({ ml: true, cloud: true }); | ||
setup.update({ ml: false, apmUi: true }); | ||
expect(service.start().get()).toEqual({ ml: false, cloud: true, apmUi: true }); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.
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.
@maryia-lapata this caused all home ui export entrypoints to be included in all bundles (because the visualize embeddable is loaded as a "hack" entrypoint). Could you confirm that it's not actually needed to render visualizations?
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 don't think that I'm a right person to confirm that. I just removed these exports during centralizing dependancies and then returned it back during Visualize shimming.
I also found that these exports were introduced in https://github.com/elastic/kibana/pull/39126/files#diff-53ca92fe2de1ead9193e8c05dc91d415R29. Maybe it helps.
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.
Sorry, just looked one level deep in the git blame :) @stacey-gammon is there a dependency of the visualize embeddable code to the home exports you know of? I'm only seeing feature registrations but maybe I'm missing something.
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 don't think it's needed, I was probably over-zealous in my copy/pasting that ended that line up here.