Skip to content

Commit

Permalink
[9.0] [Fleet] fix latest_executed_state error (#212935) (#212969)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `9.0`:
- [[Fleet] fix `latest_executed_state` error
(#212935)](#212935)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Julia
Bardi","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-03-03T18:07:28Z","message":"[Fleet]
fix `latest_executed_state` error (#212935)\n\nFix schema validation
error when `latest_executed_state: {}`.\n\nThe logic sets an empty
object
here:\nhttps://github.com/elastic/kibana/blob/63394e6bfdedf8c8e76a457673d662d57afdc2a0/x-pack/platform/plugins/shared/fleet/server/services/epm/packages/install_state_machine/steps/update_latest_executed_state.ts#L63\nThis
caused an error on the Integration Details page:\n\n`Failed output
validation:
[response\nbody.items.4.installationInfo.latest_executed_state.name]:
expected\nvalue of type [string] but got [undefined]`\n\nTested locally
by manually updating `latest_executed_state` to `{}`, now\nthe
`/epm/packages` API works as expected.\n\n<img width=\"1459\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/bbee7787-93a7-4099-ba9b-ff5d031f7637\"\n/>","sha":"d2913395afd2d2a1e740663e9546fd94a569be64","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","backport:prev-minor","backport:prev-major","v9.1.0"],"title":"[Fleet]
fix `latest_executed_state`
error","number":212935,"url":"https://github.com/elastic/kibana/pull/212935","mergeCommit":{"message":"[Fleet]
fix `latest_executed_state` error (#212935)\n\nFix schema validation
error when `latest_executed_state: {}`.\n\nThe logic sets an empty
object
here:\nhttps://github.com/elastic/kibana/blob/63394e6bfdedf8c8e76a457673d662d57afdc2a0/x-pack/platform/plugins/shared/fleet/server/services/epm/packages/install_state_machine/steps/update_latest_executed_state.ts#L63\nThis
caused an error on the Integration Details page:\n\n`Failed output
validation:
[response\nbody.items.4.installationInfo.latest_executed_state.name]:
expected\nvalue of type [string] but got [undefined]`\n\nTested locally
by manually updating `latest_executed_state` to `{}`, now\nthe
`/epm/packages` API works as expected.\n\n<img width=\"1459\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/bbee7787-93a7-4099-ba9b-ff5d031f7637\"\n/>","sha":"d2913395afd2d2a1e740663e9546fd94a569be64"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212935","number":212935,"mergeCommit":{"message":"[Fleet]
fix `latest_executed_state` error (#212935)\n\nFix schema validation
error when `latest_executed_state: {}`.\n\nThe logic sets an empty
object
here:\nhttps://github.com/elastic/kibana/blob/63394e6bfdedf8c8e76a457673d662d57afdc2a0/x-pack/platform/plugins/shared/fleet/server/services/epm/packages/install_state_machine/steps/update_latest_executed_state.ts#L63\nThis
caused an error on the Integration Details page:\n\n`Failed output
validation:
[response\nbody.items.4.installationInfo.latest_executed_state.name]:
expected\nvalue of type [string] but got [undefined]`\n\nTested locally
by manually updating `latest_executed_state` to `{}`, now\nthe
`/epm/packages` API works as expected.\n\n<img width=\"1459\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/bbee7787-93a7-4099-ba9b-ff5d031f7637\"\n/>","sha":"d2913395afd2d2a1e740663e9546fd94a569be64"}}]}]
BACKPORT-->

Co-authored-by: Julia Bardi <[email protected]>
  • Loading branch information
kibanamachine and juliaElastic authored Mar 4, 2025
1 parent df0f9bb commit 4d0c442
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 44 deletions.
12 changes: 0 additions & 12 deletions oas_docs/bundle.json
Original file line number Diff line number Diff line change
Expand Up @@ -22440,10 +22440,6 @@
"type": "string"
}
},
"required": [
"name",
"started_at"
],
"type": "object"
},
"latest_install_failed_attempts": {
Expand Down Expand Up @@ -24085,10 +24081,6 @@
"type": "string"
}
},
"required": [
"name",
"started_at"
],
"type": "object"
},
"latest_install_failed_attempts": {
Expand Down Expand Up @@ -25008,10 +25000,6 @@
"type": "string"
}
},
"required": [
"name",
"started_at"
],
"type": "object"
},
"latest_install_failed_attempts": {
Expand Down
12 changes: 0 additions & 12 deletions oas_docs/bundle.serverless.json
Original file line number Diff line number Diff line change
Expand Up @@ -22440,10 +22440,6 @@
"type": "string"
}
},
"required": [
"name",
"started_at"
],
"type": "object"
},
"latest_install_failed_attempts": {
Expand Down Expand Up @@ -24085,10 +24081,6 @@
"type": "string"
}
},
"required": [
"name",
"started_at"
],
"type": "object"
},
"latest_install_failed_attempts": {
Expand Down Expand Up @@ -25008,10 +25000,6 @@
"type": "string"
}
},
"required": [
"name",
"started_at"
],
"type": "object"
},
"latest_install_failed_attempts": {
Expand Down
9 changes: 0 additions & 9 deletions oas_docs/output/kibana.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22202,9 +22202,6 @@ paths:
type: string
started_at:
type: string
required:
- name
- started_at
latest_install_failed_attempts:
items:
additionalProperties: true
Expand Down Expand Up @@ -23062,9 +23059,6 @@ paths:
type: string
started_at:
type: string
required:
- name
- started_at
latest_install_failed_attempts:
items:
additionalProperties: true
Expand Down Expand Up @@ -23687,9 +23681,6 @@ paths:
type: string
started_at:
type: string
required:
- name
- started_at
latest_install_failed_attempts:
items:
additionalProperties: true
Expand Down
9 changes: 0 additions & 9 deletions oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24289,9 +24289,6 @@ paths:
type: string
started_at:
type: string
required:
- name
- started_at
latest_install_failed_attempts:
items:
additionalProperties: true
Expand Down Expand Up @@ -25145,9 +25142,6 @@ paths:
type: string
started_at:
type: string
required:
- name
- started_at
latest_install_failed_attempts:
items:
additionalProperties: true
Expand Down Expand Up @@ -25768,9 +25762,6 @@ paths:
type: string
started_at:
type: string
required:
- name
- started_at
latest_install_failed_attempts:
items:
additionalProperties: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ export const InstallationInfoSchema = schema.object({
),
latest_executed_state: schema.maybe(
schema.object({
name: schema.string(),
started_at: schema.string(),
name: schema.maybe(schema.string()),
started_at: schema.maybe(schema.string()),
error: schema.maybe(schema.string()),
})
),
Expand Down

0 comments on commit 4d0c442

Please sign in to comment.