Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.13] [MGMTEX] Fix action data override when adding a second action (#181604) #181721

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

jcger
Copy link
Contributor

@jcger jcger commented Apr 25, 2024

Backport

This will backport the following commits from main to 8.13:

Questions ?

Please refer to the Backport tool documentation

\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n\n\nCo-authored-by: Julian Gernun <17549662+jcger@users.noreply.github.com>"}},{"branch":"main","label":"v8.15.0","labelRegex":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com//pull/181604","number":181604,"mergeCommit":{"message":"[MGMTEX] Fix action data override when adding a second action (#181604)\n\n## Summary\r\n\r\nWe were overwriting the `actionTypeId` of the first action in the\r\n\"create connector\" callback. The value assigned was the `actionTypeId`\r\nof the newly created action, meaning that we would have converted the\r\nfirst action to be the same as the second one. This fix changes the\r\n`actionTypeId` not for the first option but for all current\r\n`activeActionItem.indices`.\r\n\r\nPreviously, we did add that override to fix a bug related to the slack\r\nconnector https://github.com//issues/155722. Its test\r\nshould cover us from breaking it back again. I did test it manually just\r\nin case and it seems to be working still. Feel free to test it too.\r\n\r\nAlso, if you are wondering why `activeActionItems.indices` is an array\r\nof numbers. The user might be using the same connector in more than one\r\naction and then delete the connector. In case this happens, and the user\r\nclicks on \"edit rule\", they will be able to restore both actions by just\r\ncreating the connector once. In order to be able to restore all affected\r\nactions, their index is being stored as a number[]. More info here\r\nhttps://github.com//pull/86838\r\n\r\nCloses https://github.com//issues/181407\r\n\r\n---------\r\n\r\nCo-authored-by: Antonio ","sha":"60c6cdb9985570a6f58bbf3860539de64ace9aa6"}}]}] BACKPORT-->

…c#181604)

## Summary

We were overwriting the `actionTypeId` of the first action in the
"create connector" callback. The value assigned was the `actionTypeId`
of the newly created action, meaning that we would have converted the
first action to be the same as the second one. This fix changes the
`actionTypeId` not for the first option but for all current
`activeActionItem.indices`.

Previously, we did add that override to fix a bug related to the slack
connector elastic#155722. Its test
should cover us from breaking it back again. I did test it manually just
in case and it seems to be working still. Feel free to test it too.

Also, if you are wondering why `activeActionItems.indices` is an array
of numbers. The user might be using the same connector in more than one
action and then delete the connector. In case this happens, and the user
clicks on "edit rule", they will be able to restore both actions by just
creating the connector once. In order to be able to restore all affected
actions, their index is being stored as a number[]. More info here
elastic#86838

Closes elastic#181407

---------

Co-authored-by: Antonio <antoniodcoelho@gmail.com>
(cherry picked from commit 60c6cdb)

# Conflicts:
#	x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alert_create_flyout.ts
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
triggersActionsUi 1.6MB 1.6MB +26.0B

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@jcger jcger merged commit ebf4bf2 into elastic:8.13 Apr 25, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants