# Backport
This will backport the following commits from `main` to `8.12`:
- [[ML] Data Frame Analytics: ensure job can be deleted from analytics
map (#174212)](https://github.com/elastic/kibana/pull/174212)
<!--- Backport version: 9.4.3 -->
### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)
<!--BACKPORT [{"author":{"name":"Melissa
Alvarez","email":"melissa.alvarez@elastic.co"},"sourceCommit":{"committedDate":"2024-01-08T18:48:19Z","message":"[ML]
Data Frame Analytics: ensure job can be deleted from analytics map
(#174212)\n\n## Summary\r\n\r\nFixes
https://github.com/elastic/kibana/issues/174131\r\n\r\nThis PR removes
the failed job check - `stats` being undefined sometimes\r\nwas causing
the issue.\r\nThe need for stats is removed when we default to using the
`force=true`\r\noption in the delete endpoint.\r\nUsing that option
removes the need to first try and stop the job, as\r\nthat is handled by
the endpoint when using that option. This works\r\nregardless of the
job's
state.\r\n\r\n\r\n823580f2-3a09-4ed5-8641-9b2055a7051c\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] Any UI touched in this PR is
usable by keyboard only (learn more\r\nabout [keyboard
accessibility](https://webaim.org/techniques/keyboard/))\r\n- [ ] This
was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"96a9c8abe24bdd3258047ea0aecc2be108c37e72","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","Feature:Data
Frame Analytics","v8.12.0","v8.13.0"],"title":"[ML] Data Frame
Analytics: ensure job can be deleted from analytics
map","number":174212,"url":"https://github.com/elastic/kibana/pull/174212","mergeCommit":{"message":"[ML]
Data Frame Analytics: ensure job can be deleted from analytics map
(#174212)\n\n## Summary\r\n\r\nFixes
https://github.com/elastic/kibana/issues/174131\r\n\r\nThis PR removes
the failed job check - `stats` being undefined sometimes\r\nwas causing
the issue.\r\nThe need for stats is removed when we default to using the
`force=true`\r\noption in the delete endpoint.\r\nUsing that option
removes the need to first try and stop the job, as\r\nthat is handled by
the endpoint when using that option. This works\r\nregardless of the
job's
state.\r\n\r\n\r\n823580f2-3a09-4ed5-8641-9b2055a7051c\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] Any UI touched in this PR is
usable by keyboard only (learn more\r\nabout [keyboard
accessibility](https://webaim.org/techniques/keyboard/))\r\n- [ ] This
was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"96a9c8abe24bdd3258047ea0aecc2be108c37e72"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","branchLabelMappingKey":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/174212","number":174212,"mergeCommit":{"message":"[ML]
Data Frame Analytics: ensure job can be deleted from analytics map
(#174212)\n\n## Summary\r\n\r\nFixes
https://github.com/elastic/kibana/issues/174131\r\n\r\nThis PR removes
the failed job check - `stats` being undefined sometimes\r\nwas causing
the issue.\r\nThe need for stats is removed when we default to using the
`force=true`\r\noption in the delete endpoint.\r\nUsing that option
removes the need to first try and stop the job, as\r\nthat is handled by
the endpoint when using that option. This works\r\nregardless of the
job's
state.\r\n\r\n\r\n823580f2-3a09-4ed5-8641-9b2055a7051c\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n- [ ] [Flaky
Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\r\nused on any tests changed\r\n- [ ] Any UI touched in this PR is
usable by keyboard only (learn more\r\nabout [keyboard
accessibility](https://webaim.org/techniques/keyboard/))\r\n- [ ] This
was checked for
[cross-browser\r\ncompatibility](https://www.elastic.co/support/matrix#matrix_browsers)\r\n\r\n---------\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"96a9c8abe24bdd3258047ea0aecc2be108c37e72"}}]}]
BACKPORT-->
Co-authored-by: Melissa Alvarez <melissa.alvarez@elastic.co>
Each route handler requires apidoc-markdown annotations in order
to generate documentation.
There are custom parser and worker (x-pack/plugins/ml/server/routes/apidoc_scripts) to process api schemas for each documentation entry. It's written with typescript so make sure all the scripts in the folder are compiled before executing apidoc command.
Make sure you have run yarn kbn bootstrap to get all requires dev dependencies. Then execute the following command from the ml plugin folder:
yarn run apiDocs
It compiles all the required scripts and generates the documentation both in HTML and Markdown formats.
It will create a new directory routes_doc (next to the routes folder) which contains the documentation in HTML format
as well as ML_API.md file.