-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Cases] Migrate user actions connector ID #108272
[Cases] Migrate user actions connector ID #108272
Conversation
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested migration and functionality locally! LGTM! 🚀
* Making progress * Fleshing out the extraction logic * Finishing migration logic and starting more tests * Finishing migration unit tests * Making progress on services * Finishing transform to es schema * Finishing transform functionality and unit tests * reverting migration data updates * Cleaning up type errors * fixing test error * Working migration tests * Refactoring retrieval of connector fields * Refactoring connector id in and tests in frontend * Fixing tests and finished refactoring parse string * Fixing integration test * Fixing integration tests * Removing some duplicate code and updating test name * Fixing create connector user action bug * Addressing feedback and logging error * Moving parsing function to common * Fixing type errors * Fixing type errors * Addressing feedback * Fixing lint errors Co-authored-by: Kibana Machine <[email protected]>
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
This reverts commit 10ac814.
@jonathan-buttner, apologies, this PR needed to be reverted as it failed when it hit master. I have also closed the backport.
|
Background: #105677
Initial PR: #104221
This is a follow on PR for the work to migrate references to saved objects that are stored in fields outside of the
references
field for user actions. The connector ID can be stored in a few types of user actions:Creation of a case user action
Updating the connector within a case
Pushing a case
User actions holds a JSON encoded version of the above objects in the fields named
oldValue
andnewValue
to indicate what the original value was and what it is being changed to.Performance Concern
The easiest solution would be to have the backend decode the user actions
oldValue
andnewValue
fields and place the connector ID back into them and re-encode the fields before they are returned to the UI. This would have avoiding needing to change any code in the UI. We had some performance concerns with doing that approach for every user action when the case detail view is requested.Instead the approach we took was to move the ids to
new_val_connector_id
andold_val_connector_id
. This required a number of changes in the UI to look for that field instead of using the encoded values for the id.Notable Changes
references
fieldreferences
fieldnew_val_connector_id
andold_val_connector_id
fields to correspond with thenewValue
andoldValue
*_val_connector_id
parseString
on the encoded valueTesting
I added unit tests for the transformation and migration code in the backend and frontend where I could. I also added integration tests that run the migration on older 7.13 data.
To test this PR: