[Automatic Migration] Introduce Last execution info for a migration#221635
[Automatic Migration] Introduce Last execution info for a migration#221635logeekal merged 25 commits intoelastic:mainfrom
Conversation
| if (lastExecution?.is_aborted) { | ||
| return SiemMigrationTaskStatus.ABORTED; | ||
| } | ||
| if (dataStats.pending === dataStats.total) { |
There was a problem hiding this comment.
Even if pending === total but the task was aborted, we would want to inform user that the task was aborted but can still be started.
|
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
...blic/siem_migrations/rules/components/migration_status_panels/migration_ready_panel.test.tsx
Outdated
Show resolved
Hide resolved
...rity_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_migration_client.ts
Outdated
Show resolved
Hide resolved
...rity_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_migration_client.ts
Outdated
Show resolved
Hide resolved
...lution_api_integration/test_suites/siem_migrations/rules/trial_license_complete_tier/stop.ts
Outdated
Show resolved
Hide resolved
...s/security/plugins/security_solution/common/siem_migrations/model/rule_migration.schema.yaml
Show resolved
Hide resolved
...rity_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_migration_client.ts
Outdated
Show resolved
Hide resolved
|
Starting backport for target branches: 8.19 https://github.com/elastic/kibana/actions/runs/15410758137 |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
|
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
…lastic#221635) ## Resolves - elastic/security-team#12681 - elastic/security-team#12682 ## Summary Please find the summary of all the changes below. ### Last Execution Info This Enhancement introduces `last_execution` object to the `migration` document. There is some information that we need to add for the last run migration ( eg. `error` occured or `connector_id` used ). This PR add that info. Below is how a sample `migration` document looks like with `last_execution` info and shape of `last_execution` object. ```ts export const RuleMigrationLastExecution = z.object({ /** * The moment the last execution started. */ started_at: z.string().optional(), /** * The moment the last execution ended. */ ended_at: z.string().optional(), /** * The connector ID used for the last execution, if applicable. */ connector_id: z.string().optional(), /** * The error message if the last execution failed. */ error: z.string().optional(), /** * Indicates if the last execution was aborted by the user. */ is_aborted: z.boolean().optional(), }); ``` ```json { "created_by": "u_v6jVi3qZ21kAEUwmbl-sfujRnwydrltycxyByl3jtIM_0", "created_at": "2025-05-28T06:10:37.638Z", "last_execution": { "connector_id": "azureOpenAiGPT4o", "started_at": "2025-05-28T06:10:48.030Z", "is_aborted": false, "error": "Failed to populate ELSER indices. Make sure the ELSER model is deployed and running at Machine Learning > Trained Models. Error: Exception when running inference id [.elser-2-elasticsearch] on field [elser_embedding]", "ended_at": "2025-05-28T06:11:31.464Z" } ``` ### Why `Last Execution` info was needed? - An automatic migration can run into an error and terminate. Today, we store that error in server state and do not persist. This can be a problem when server is restarted and user will not be able to see that error. - So, we need a way to persist the error for last execution. - Additionally, we do not have any details on when the last execution was started and finished. - We also need to store the connector_id so that we can re-use it when user is restarting a migration. In addition to resolving above issues, this Ticket makes some minor UI Changes to the Migration Ready Panel in different states of a Migration ### When Migration is Ready to be started. This remains exactly the same as before:  ### When Migration was Aborted |Before|After| |---|---| ||| ### When there was an error |Before|After| |---|---| ||| ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
4 similar comments
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Starting backport for target branches: 8.19 https://github.com/elastic/kibana/actions/runs/15581696693 |
…lastic#221635) ## Resolves - elastic/security-team#12681 - elastic/security-team#12682 ## Summary Please find the summary of all the changes below. ### Last Execution Info This Enhancement introduces `last_execution` object to the `migration` document. There is some information that we need to add for the last run migration ( eg. `error` occured or `connector_id` used ). This PR add that info. Below is how a sample `migration` document looks like with `last_execution` info and shape of `last_execution` object. ```ts export const RuleMigrationLastExecution = z.object({ /** * The moment the last execution started. */ started_at: z.string().optional(), /** * The moment the last execution ended. */ ended_at: z.string().optional(), /** * The connector ID used for the last execution, if applicable. */ connector_id: z.string().optional(), /** * The error message if the last execution failed. */ error: z.string().optional(), /** * Indicates if the last execution was aborted by the user. */ is_aborted: z.boolean().optional(), }); ``` ```json { "created_by": "u_v6jVi3qZ21kAEUwmbl-sfujRnwydrltycxyByl3jtIM_0", "created_at": "2025-05-28T06:10:37.638Z", "last_execution": { "connector_id": "azureOpenAiGPT4o", "started_at": "2025-05-28T06:10:48.030Z", "is_aborted": false, "error": "Failed to populate ELSER indices. Make sure the ELSER model is deployed and running at Machine Learning > Trained Models. Error: Exception when running inference id [.elser-2-elasticsearch] on field [elser_embedding]", "ended_at": "2025-05-28T06:11:31.464Z" } ``` ### Why `Last Execution` info was needed? - An automatic migration can run into an error and terminate. Today, we store that error in server state and do not persist. This can be a problem when server is restarted and user will not be able to see that error. - So, we need a way to persist the error for last execution. - Additionally, we do not have any details on when the last execution was started and finished. - We also need to store the connector_id so that we can re-use it when user is restarting a migration. In addition to resolving above issues, this Ticket makes some minor UI Changes to the Migration Ready Panel in different states of a Migration ### When Migration is Ready to be started. This remains exactly the same as before:  ### When Migration was Aborted |Before|After| |---|---| ||| ### When there was an error |Before|After| |---|---| ||| ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) (cherry picked from commit 6458650)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…ation (#221635) (#223379) # Backport This will backport the following commits from `main` to `8.19`: - [[Automatic Migration] Introduce Last execution info for a migration (#221635)](#221635) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Jatin Kathuria","email":"jatin.kathuria@elastic.co"},"sourceCommit":{"committedDate":"2025-06-03T07:05:43Z","message":"[Automatic Migration] Introduce Last execution info for a migration (#221635)\n\n## Resolves \n\n- https://github.com/elastic/security-team/issues/12681\n- https://github.com/elastic/security-team/issues/12682\n\n## Summary\n\nPlease find the summary of all the changes below.\n\n### Last Execution Info\n\nThis Enhancement introduces `last_execution` object to the `migration`\ndocument. There is some information that we need to add for the last run\nmigration ( eg. `error` occured or `connector_id` used ). This PR add\nthat info. Below is how a sample `migration` document looks like with\n`last_execution` info and shape of `last_execution` object.\n\n```ts\nexport const RuleMigrationLastExecution = z.object({\n /**\n * The moment the last execution started.\n */\n started_at: z.string().optional(),\n /**\n * The moment the last execution ended.\n */\n ended_at: z.string().optional(),\n /**\n * The connector ID used for the last execution, if applicable.\n */\n connector_id: z.string().optional(),\n /**\n * The error message if the last execution failed.\n */\n error: z.string().optional(),\n /**\n * Indicates if the last execution was aborted by the user.\n */\n is_aborted: z.boolean().optional(),\n});\n```\n```json\n{\n \"created_by\": \"u_v6jVi3qZ21kAEUwmbl-sfujRnwydrltycxyByl3jtIM_0\",\n \"created_at\": \"2025-05-28T06:10:37.638Z\",\n \"last_execution\": {\n \"connector_id\": \"azureOpenAiGPT4o\",\n \"started_at\": \"2025-05-28T06:10:48.030Z\",\n \"is_aborted\": false,\n \"error\": \"Failed to populate ELSER indices. Make sure the ELSER model is deployed and running at Machine Learning > Trained Models. Error: Exception when running inference id [.elser-2-elasticsearch] on field [elser_embedding]\",\n \"ended_at\": \"2025-05-28T06:11:31.464Z\"\n}\n\n```\n\n### Why `Last Execution` info was needed?\n\n\n\n- An automatic migration can run into an error and terminate. Today, we\nstore that error in server state and do not persist. This can be a\nproblem when server is restarted and user will not be able to see that\nerror.\n - So, we need a way to persist the error for last execution.\n- Additionally, we do not have any details on when the last execution\nwas started and finished.\n\n- We also need to store the connector_id so that we can re-use it when\nuser is restarting a migration.\n\n\nIn addition to resolving above issues, this Ticket makes some minor UI\nChanges to the Migration Ready Panel in different states of a Migration\n\n\n### When Migration is Ready to be started.\n\nThis remains exactly the same as before:\n\n\n\n\n### When Migration was Aborted\n\n|Before|After|\n|---|---|\n\n|||\n\n### When there was an error\n\n|Before|After|\n|---|---|\n\n|||\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [ ]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas added for features that require explanation or tutorials\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] If a plugin configuration key changed, check if it needs to be\nallowlisted in the cloud and added to the [docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n- [ ] This was checked for breaking HTTP API changes, and any breaking\nchanges have been approved by the breaking-change committee. The\n`release_note:breaking` label should be applied in these situations.\n- [ ] [Flaky Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\nused on any tests changed\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"645865097609a1e77ec0ec405494c46a08eaa8b2","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Threat Hunting","backport:version","v9.1.0","v8.19.0"],"title":"[Automatic Migration] Introduce Last execution info for a migration","number":221635,"url":"https://github.com/elastic/kibana/pull/221635","mergeCommit":{"message":"[Automatic Migration] Introduce Last execution info for a migration (#221635)\n\n## Resolves \n\n- https://github.com/elastic/security-team/issues/12681\n- https://github.com/elastic/security-team/issues/12682\n\n## Summary\n\nPlease find the summary of all the changes below.\n\n### Last Execution Info\n\nThis Enhancement introduces `last_execution` object to the `migration`\ndocument. There is some information that we need to add for the last run\nmigration ( eg. `error` occured or `connector_id` used ). This PR add\nthat info. Below is how a sample `migration` document looks like with\n`last_execution` info and shape of `last_execution` object.\n\n```ts\nexport const RuleMigrationLastExecution = z.object({\n /**\n * The moment the last execution started.\n */\n started_at: z.string().optional(),\n /**\n * The moment the last execution ended.\n */\n ended_at: z.string().optional(),\n /**\n * The connector ID used for the last execution, if applicable.\n */\n connector_id: z.string().optional(),\n /**\n * The error message if the last execution failed.\n */\n error: z.string().optional(),\n /**\n * Indicates if the last execution was aborted by the user.\n */\n is_aborted: z.boolean().optional(),\n});\n```\n```json\n{\n \"created_by\": \"u_v6jVi3qZ21kAEUwmbl-sfujRnwydrltycxyByl3jtIM_0\",\n \"created_at\": \"2025-05-28T06:10:37.638Z\",\n \"last_execution\": {\n \"connector_id\": \"azureOpenAiGPT4o\",\n \"started_at\": \"2025-05-28T06:10:48.030Z\",\n \"is_aborted\": false,\n \"error\": \"Failed to populate ELSER indices. Make sure the ELSER model is deployed and running at Machine Learning > Trained Models. Error: Exception when running inference id [.elser-2-elasticsearch] on field [elser_embedding]\",\n \"ended_at\": \"2025-05-28T06:11:31.464Z\"\n}\n\n```\n\n### Why `Last Execution` info was needed?\n\n\n\n- An automatic migration can run into an error and terminate. Today, we\nstore that error in server state and do not persist. This can be a\nproblem when server is restarted and user will not be able to see that\nerror.\n - So, we need a way to persist the error for last execution.\n- Additionally, we do not have any details on when the last execution\nwas started and finished.\n\n- We also need to store the connector_id so that we can re-use it when\nuser is restarting a migration.\n\n\nIn addition to resolving above issues, this Ticket makes some minor UI\nChanges to the Migration Ready Panel in different states of a Migration\n\n\n### When Migration is Ready to be started.\n\nThis remains exactly the same as before:\n\n\n\n\n### When Migration was Aborted\n\n|Before|After|\n|---|---|\n\n|||\n\n### When there was an error\n\n|Before|After|\n|---|---|\n\n|||\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [ ]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas added for features that require explanation or tutorials\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] If a plugin configuration key changed, check if it needs to be\nallowlisted in the cloud and added to the [docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n- [ ] This was checked for breaking HTTP API changes, and any breaking\nchanges have been approved by the breaking-change committee. The\n`release_note:breaking` label should be applied in these situations.\n- [ ] [Flaky Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\nused on any tests changed\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"645865097609a1e77ec0ec405494c46a08eaa8b2"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/221635","number":221635,"mergeCommit":{"message":"[Automatic Migration] Introduce Last execution info for a migration (#221635)\n\n## Resolves \n\n- https://github.com/elastic/security-team/issues/12681\n- https://github.com/elastic/security-team/issues/12682\n\n## Summary\n\nPlease find the summary of all the changes below.\n\n### Last Execution Info\n\nThis Enhancement introduces `last_execution` object to the `migration`\ndocument. There is some information that we need to add for the last run\nmigration ( eg. `error` occured or `connector_id` used ). This PR add\nthat info. Below is how a sample `migration` document looks like with\n`last_execution` info and shape of `last_execution` object.\n\n```ts\nexport const RuleMigrationLastExecution = z.object({\n /**\n * The moment the last execution started.\n */\n started_at: z.string().optional(),\n /**\n * The moment the last execution ended.\n */\n ended_at: z.string().optional(),\n /**\n * The connector ID used for the last execution, if applicable.\n */\n connector_id: z.string().optional(),\n /**\n * The error message if the last execution failed.\n */\n error: z.string().optional(),\n /**\n * Indicates if the last execution was aborted by the user.\n */\n is_aborted: z.boolean().optional(),\n});\n```\n```json\n{\n \"created_by\": \"u_v6jVi3qZ21kAEUwmbl-sfujRnwydrltycxyByl3jtIM_0\",\n \"created_at\": \"2025-05-28T06:10:37.638Z\",\n \"last_execution\": {\n \"connector_id\": \"azureOpenAiGPT4o\",\n \"started_at\": \"2025-05-28T06:10:48.030Z\",\n \"is_aborted\": false,\n \"error\": \"Failed to populate ELSER indices. Make sure the ELSER model is deployed and running at Machine Learning > Trained Models. Error: Exception when running inference id [.elser-2-elasticsearch] on field [elser_embedding]\",\n \"ended_at\": \"2025-05-28T06:11:31.464Z\"\n}\n\n```\n\n### Why `Last Execution` info was needed?\n\n\n\n- An automatic migration can run into an error and terminate. Today, we\nstore that error in server state and do not persist. This can be a\nproblem when server is restarted and user will not be able to see that\nerror.\n - So, we need a way to persist the error for last execution.\n- Additionally, we do not have any details on when the last execution\nwas started and finished.\n\n- We also need to store the connector_id so that we can re-use it when\nuser is restarting a migration.\n\n\nIn addition to resolving above issues, this Ticket makes some minor UI\nChanges to the Migration Ready Panel in different states of a Migration\n\n\n### When Migration is Ready to be started.\n\nThis remains exactly the same as before:\n\n\n\n\n### When Migration was Aborted\n\n|Before|After|\n|---|---|\n\n|||\n\n### When there was an error\n\n|Before|After|\n|---|---|\n\n|||\n\n\n\n### Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers should verify this PR satisfies this list as well.\n\n- [x] Any text added follows [EUI's writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\nsentence case text and includes [i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n- [ ]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas added for features that require explanation or tutorials\n- [x] [Unit or functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere updated or added to match the most common scenarios\n- [ ] If a plugin configuration key changed, check if it needs to be\nallowlisted in the cloud and added to the [docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n- [ ] This was checked for breaking HTTP API changes, and any breaking\nchanges have been approved by the breaking-change committee. The\n`release_note:breaking` label should be applied in these situations.\n- [ ] [Flaky Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\nused on any tests changed\n- [ ] The PR description includes the appropriate Release Notes section,\nand the correct `release_note:*` label is applied per the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"645865097609a1e77ec0ec405494c46a08eaa8b2"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jatin Kathuria <jatin.kathuria@elastic.co>
…lastic#221635) ## Resolves - elastic/security-team#12681 - elastic/security-team#12682 ## Summary Please find the summary of all the changes below. ### Last Execution Info This Enhancement introduces `last_execution` object to the `migration` document. There is some information that we need to add for the last run migration ( eg. `error` occured or `connector_id` used ). This PR add that info. Below is how a sample `migration` document looks like with `last_execution` info and shape of `last_execution` object. ```ts export const RuleMigrationLastExecution = z.object({ /** * The moment the last execution started. */ started_at: z.string().optional(), /** * The moment the last execution ended. */ ended_at: z.string().optional(), /** * The connector ID used for the last execution, if applicable. */ connector_id: z.string().optional(), /** * The error message if the last execution failed. */ error: z.string().optional(), /** * Indicates if the last execution was aborted by the user. */ is_aborted: z.boolean().optional(), }); ``` ```json { "created_by": "u_v6jVi3qZ21kAEUwmbl-sfujRnwydrltycxyByl3jtIM_0", "created_at": "2025-05-28T06:10:37.638Z", "last_execution": { "connector_id": "azureOpenAiGPT4o", "started_at": "2025-05-28T06:10:48.030Z", "is_aborted": false, "error": "Failed to populate ELSER indices. Make sure the ELSER model is deployed and running at Machine Learning > Trained Models. Error: Exception when running inference id [.elser-2-elasticsearch] on field [elser_embedding]", "ended_at": "2025-05-28T06:11:31.464Z" } ``` ### Why `Last Execution` info was needed? - An automatic migration can run into an error and terminate. Today, we store that error in server state and do not persist. This can be a problem when server is restarted and user will not be able to see that error. - So, we need a way to persist the error for last execution. - Additionally, we do not have any details on when the last execution was started and finished. - We also need to store the connector_id so that we can re-use it when user is restarting a migration. In addition to resolving above issues, this Ticket makes some minor UI Changes to the Migration Ready Panel in different states of a Migration ### When Migration is Ready to be started. This remains exactly the same as before:  ### When Migration was Aborted |Before|After| |---|---| ||| ### When there was an error |Before|After| |---|---| ||| ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Resolves
Summary
Please find the summary of all the changes below.
Last Execution Info
This Enhancement introduces
last_executionobject to themigrationdocument. There is some information that we need to add for the last run migration ( eg.erroroccured orconnector_idused ). This PR add that info. Below is how a samplemigrationdocument looks like withlast_executioninfo and shape oflast_executionobject.{ "created_by": "u_v6jVi3qZ21kAEUwmbl-sfujRnwydrltycxyByl3jtIM_0", "created_at": "2025-05-28T06:10:37.638Z", "last_execution": { "connector_id": "azureOpenAiGPT4o", "started_at": "2025-05-28T06:10:48.030Z", "is_aborted": false, "error": "Failed to populate ELSER indices. Make sure the ELSER model is deployed and running at Machine Learning > Trained Models. Error: Exception when running inference id [.elser-2-elasticsearch] on field [elser_embedding]", "ended_at": "2025-05-28T06:11:31.464Z" }Why
Last Executioninfo was needed?An automatic migration can run into an error and terminate. Today, we store that error in server state and do not persist. This can be a problem when server is restarted and user will not be able to see that error.
Additionally, we do not have any details on when the last execution was started and finished.
We also need to store the connector_id so that we can re-use it when user is restarting a migration.
In addition to resolving above issues, this Ticket makes some minor UI Changes to the Migration Ready Panel in different states of a Migration
When Migration is Ready to be started.
This remains exactly the same as before:
When Migration was Aborted
When there was an error
Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelines