Skip to content

Commit f0d181b

Browse files
[9.3] [ResponseOps][MaintenanceWindows] Fix mw internal client by passing hidden SO type (#248132) (#248219)
# Backport This will backport the following commits from `main` to `9.3`: - [[ResponseOps][MaintenanceWindows] Fix mw internal client by passing hidden SO type (#248132)](#248132) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Janki Salvi","email":"117571355+js-jankisalvi@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-01-08T09:07:03Z","message":"[ResponseOps][MaintenanceWindows] Fix mw internal client by passing hidden SO type (#248132)\n\n## Summary\n\nInternal MW client using internal repository was introduced in\nhttps://github.com//pull/247390.\nIt created problems while fetching MWs using all spaces in synthetics\nplugin.\n\nThis PR fixes the issue.\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"345ec13b123cf9b880b5e2a71e8630aa464bd403","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","backport:version","Feature:Maintenance Window","v9.3.0","v9.4.0"],"title":"[ResponseOps][MaintenanceWindows] Fix mw internal client by passing hidden SO type","number":248132,"url":"https://github.com/elastic/kibana/pull/248132","mergeCommit":{"message":"[ResponseOps][MaintenanceWindows] Fix mw internal client by passing hidden SO type (#248132)\n\n## Summary\n\nInternal MW client using internal repository was introduced in\nhttps://github.com//pull/247390.\nIt created problems while fetching MWs using all spaces in synthetics\nplugin.\n\nThis PR fixes the issue.\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"345ec13b123cf9b880b5e2a71e8630aa464bd403"}},"sourceBranch":"main","suggestedTargetBranches":["9.3"],"targetPullRequestStates":[{"branch":"9.3","label":"v9.3.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/248132","number":248132,"mergeCommit":{"message":"[ResponseOps][MaintenanceWindows] Fix mw internal client by passing hidden SO type (#248132)\n\n## Summary\n\nInternal MW client using internal repository was introduced in\nhttps://github.com//pull/247390.\nIt created problems while fetching MWs using all spaces in synthetics\nplugin.\n\nThis PR fixes the issue.\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] Review the [backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand apply applicable `backport:*` labels.","sha":"345ec13b123cf9b880b5e2a71e8630aa464bd403"}}]}] BACKPORT--> Co-authored-by: Janki Salvi <117571355+js-jankisalvi@users.noreply.github.com>
1 parent 34a4a7d commit f0d181b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

x-pack/platform/plugins/shared/maintenance_windows/server/maintenance_window_client_factory.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,16 @@ test('creates an internal maintenance window client', async () => {
107107
const factory = new MaintenanceWindowClientFactory();
108108
factory.initialize(maintenanceWindowClientFactoryParams);
109109
const request = mockRouter.createKibanaRequest();
110-
const mockRepository = savedObjectsService.createInternalRepository();
110+
const mockRepository = savedObjectsService.createInternalRepository([
111+
MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE,
112+
]);
111113
savedObjectsService.createInternalRepository.mockReturnValue(mockRepository);
112114

113115
factory.createInternal(request);
114116

115-
expect(savedObjectsService.createInternalRepository).toHaveBeenCalledWith();
117+
expect(savedObjectsService.createInternalRepository).toHaveBeenCalledWith([
118+
MAINTENANCE_WINDOW_SAVED_OBJECT_TYPE,
119+
]);
116120

117121
const { MaintenanceWindowClient } = jest.requireMock('./client');
118122

0 commit comments

Comments
 (0)