# Backport
This will backport the following commits from `main` to `8.x`:
- [Relocating module `@kbn/slo-plugin`
(#204265)](https://github.com/elastic/kibana/pull/204265)
<!--- Backport version: 8.9.8 -->
### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)
<!--BACKPORT
[{"author":{"name":"Shahzad","email":"shahzad31comp@gmail.com"},"sourceCommit":{"committedDate":"2024-12-16T16:35:31Z","message":"Relocating
module `@kbn/slo-plugin` (#204265)\n\n## Summary\r\n\r\nPR has been
generated with script `node scripts/relocate
--team\r\n\"@elastic/obs-ux-management-team\"`\r\n\r\nRelocating module
`@kbn/slo-plugin`\r\n\r\nWe are facing emotion issues that we need to
fix !!\r\n\r\nWe need to figure out why app is broken after relocating
with
following\r\nerror\r\n\r\n\r\n\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Kevin Delemme
<kevin.delemme@elastic.co>","sha":"984a059e67c774243adc77f6291a45eda9e8fd12","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor"],"number":204265,"url":"https://github.com/elastic/kibana/pull/204265","mergeCommit":{"message":"Relocating
module `@kbn/slo-plugin` (#204265)\n\n## Summary\r\n\r\nPR has been
generated with script `node scripts/relocate
--team\r\n\"@elastic/obs-ux-management-team\"`\r\n\r\nRelocating module
`@kbn/slo-plugin`\r\n\r\nWe are facing emotion issues that we need to
fix !!\r\n\r\nWe need to figure out why app is broken after relocating
with
following\r\nerror\r\n\r\n\r\n\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Kevin Delemme
<kevin.delemme@elastic.co>","sha":"984a059e67c774243adc77f6291a45eda9e8fd12"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/204265","number":204265,"mergeCommit":{"message":"Relocating
module `@kbn/slo-plugin` (#204265)\n\n## Summary\r\n\r\nPR has been
generated with script `node scripts/relocate
--team\r\n\"@elastic/obs-ux-management-team\"`\r\n\r\nRelocating module
`@kbn/slo-plugin`\r\n\r\nWe are facing emotion issues that we need to
fix !!\r\n\r\nWe need to figure out why app is broken after relocating
with
following\r\nerror\r\n\r\n\r\n\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Kevin Delemme
<kevin.delemme@elastic.co>","sha":"984a059e67c774243adc77f6291a45eda9e8fd12"}}]}]
BACKPORT-->
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Relates to https://github.com/elastic/kibana/pull/197455
Some of the staging and serverless OpenAPI files persist in 8.x and
earlier branches, so this PR removes them to hopefully reduce merge
conflicts.
# Backport
This will backport the following commits from `main` to `8.x`:
- [[HTTP/OAS] Include Security Solution domain OAS to production docs
(#194132)](https://github.com/elastic/kibana/pull/194132)
<!--- Backport version: 8.9.8 -->
### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)
<!--BACKPORT [{"author":{"name":"Maxim
Palenov","email":"maxim.palenov@elastic.co"},"sourceCommit":{"committedDate":"2024-10-04T19:34:25Z","message":"[HTTP/OAS]
Include Security Solution domain OAS to production docs
(#194132)\n\n*Epic:**
https://github.com/elastic/security-team/issues/9401
(internal)\r\n\r\n## Summary\r\n\r\nThis PR includes Security Solution
OpenAPI domain bundles into the production OpenAPI Kibana bundle. The
result Kibana bundler is expected to be published to Bump.sh manually by
@lcawl.","sha":"102297ca151d56c8a7da36c14c72386b4cd225ca","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","docs","Team:
SecuritySolution","backport:prev-minor","Feature:OAS","v8.16.0"],"number":194132,"url":"https://github.com/elastic/kibana/pull/194132","mergeCommit":{"message":"[HTTP/OAS]
Include Security Solution domain OAS to production docs
(#194132)\n\n*Epic:**
https://github.com/elastic/security-team/issues/9401
(internal)\r\n\r\n## Summary\r\n\r\nThis PR includes Security Solution
OpenAPI domain bundles into the production OpenAPI Kibana bundle. The
result Kibana bundler is expected to be published to Bump.sh manually by
@lcawl.","sha":"102297ca151d56c8a7da36c14c72386b4cd225ca"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194132","number":194132,"mergeCommit":{"message":"[HTTP/OAS]
Include Security Solution domain OAS to production docs
(#194132)\n\n*Epic:**
https://github.com/elastic/security-team/issues/9401
(internal)\r\n\r\n## Summary\r\n\r\nThis PR includes Security Solution
OpenAPI domain bundles into the production OpenAPI Kibana bundle. The
result Kibana bundler is expected to be published to Bump.sh manually by
@lcawl.","sha":"102297ca151d56c8a7da36c14c72386b4cd225ca"}},{"branch":"8.x","label":"v8.16.0","labelRegex":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
**Addresses:** https://github.com/elastic/kibana/issues/186356
**Relates to:** https://github.com/elastic/kibana/issues/184428
## Summary
This PR adds a merging JS script based on the utility implemented in https://github.com/elastic/kibana/issues/186356. Resulted OpenAPI bundle as committed in `oas_docs/output/kibana.serverless.bundled.yaml`.
## Details
https://github.com/elastic/kibana/pull/188110 implements and exposes `merge` utility design to merge source OpenAPI specs without processing. It's has only a programmatic API. To merge OpenAPI specs it's required to add a JS script like below
```js
const { merge } = require('@kbn/openapi-bundler');
(async () => {
await merge({
sourceGlobs: [/* a list of source globs goes here */],
outputFilePath: 'path/to/the/output/file.yaml',
});
})();
```
The JS script added in this PR includes source OpenAPI specs presented in `oas_docs/makefile` plus Security Solution OpenAPI specs based on https://github.com/elastic/kibana/issues/184428.
**To run** the script use the following command from Kibana root folder
```bash
node ./oas_docs/scripts/merge_serverless_oas.js
```
## Known linting issues with Security Solution OpenAPI specs
Running Spectral OpenAPI linter on the result bundle shows a number of errors caused by `no-$ref-siblings` rule. This caused by the current code generator implementation which requires `default` property to be set next to `$ref` though it's not correct for OpenAPI `3.0.3` while it's allowed in `3.1`. It seems that Bump.sh handles such cases properly though by properly showing a default value.
We need to analyze the problem and decide if/when we should fix it.
The rest of warnings look fixable and will be addressed in the next stage after setting up linter rules.
## Next steps
Since `@kbn/openapi-bundler` package is tailored specifically for Kibana it should replace Redocly currently used to merge OpenAPI specs. It also means `oas_docs/makefile` should be superseded by JS script(s) using `merge` utility form `@kbn/openapi-bundler` package.
`@kbn/openapi-bundler` SHOULD NOT replace OpenAPI linters since it doesn't perform thorough linting. It's good if we continue adopting `spectral-cli` for linting purposes.