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

[Cases] Fix remark stringify version to match remark parse #119995

Merged
merged 12 commits into from
Dec 8, 2021

Conversation

semd
Copy link
Contributor

@semd semd commented Nov 30, 2021

Fixes #119509

This PR fixes an issue where github style tables within a case cause an upgrade migration to 7.15 to fail and blocks the upgrade from completing. The issue is that remark-stringify was initially added at version 9.x which uses a newer version of remark such that the github style tables are removed from remark and placed in a separate plugin called remark-gfm. To fix this issue we are downgrading remark-stringify to match the version of remark-parse which is 8.0.3.

In additional to this we are also wrapping the parsing logic in a try/catch to prevent any future errors from preventing and upgrade from completing.

Release Notes

Fixes a bug in the Cases upgrade migration that was preventing upgrades from completing. This was due to Github Flavored Markdown not being supported in the Cases comments.

@jonathan-buttner jonathan-buttner added release_note:fix v7.15.3 v7.16.1 v8.0.0 v8.1.0 Team:Threat Hunting Security Solution Threat Hunting Team Team:Threat Hunting:Cases auto-backport Deprecated - use backport:version if exact versions are needed labels Nov 30, 2021
@semd semd marked this pull request as ready for review December 1, 2021 15:28
@semd semd requested a review from a team as a code owner December 1, 2021 15:28
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting-cases (Team:Threat Hunting:Cases)

@cnasikas
Copy link
Member

cnasikas commented Dec 3, 2021

@elasticmachine merge upstream

@cnasikas
Copy link
Member

cnasikas commented Dec 6, 2021

@elasticmachine merge upstream

@cnasikas
Copy link
Member

cnasikas commented Dec 8, 2021

@elasticmachine merge upstream

@jonathan-buttner
Copy link
Contributor

@elasticmachine merge upstream

@jonathan-buttner
Copy link
Contributor

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
cases 353 356 +3

Async chunks

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

id before after diff
cases 297.5KB 302.2KB +4.6KB

History

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

cc @semd @jonathan-buttner

@jonathan-buttner jonathan-buttner merged commit a57a7d5 into elastic:main Dec 8, 2021
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Dec 8, 2021
…19995)

* match parse and stringify version. try/catch added

* Adding tests and refactoring logError

* Adding relative path to core and kibana utils

* remark curstom serializers adapted to version 8

* add error logging to comments  migration

* Adding tests for mergeMigrationFunctionMap logging

Co-authored-by: Jonathan Buttner <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
@kibanamachine
Copy link
Contributor

💔 Backport failed

Status Branch Result
8.0
7.16 Commit could not be cherrypicked due to conflicts
7.15 Commit could not be cherrypicked due to conflicts
7.17 The branch "7.17" is invalid or doesn't exist

Successful backport PRs will be merged automatically after passing CI.

To backport manually run:
node scripts/backport --pr 119995

kibanamachine added a commit that referenced this pull request Dec 8, 2021
…120843)

* match parse and stringify version. try/catch added

* Adding tests and refactoring logError

* Adding relative path to core and kibana utils

* remark curstom serializers adapted to version 8

* add error logging to comments  migration

* Adding tests for mergeMigrationFunctionMap logging

Co-authored-by: Jonathan Buttner <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: Sergi Massaneda <[email protected]>
Co-authored-by: Jonathan Buttner <[email protected]>
jonathan-buttner added a commit that referenced this pull request Dec 8, 2021
…120849)

* match parse and stringify version. try/catch added

* Adding tests and refactoring logError

* Adding relative path to core and kibana utils

* remark curstom serializers adapted to version 8

* add error logging to comments  migration

* Adding tests for mergeMigrationFunctionMap logging

Co-authored-by: Jonathan Buttner <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
# Conflicts:
#	x-pack/plugins/cases/server/saved_object_types/migrations/comments.ts

Co-authored-by: Sergi Massaneda <[email protected]>
jonathan-buttner pushed a commit to jonathan-buttner/kibana that referenced this pull request Dec 9, 2021
…19995)

* match parse and stringify version. try/catch added

* Adding tests and refactoring logError

* Adding relative path to core and kibana utils

* remark curstom serializers adapted to version 8

* add error logging to comments  migration

* Adding tests for mergeMigrationFunctionMap logging

Co-authored-by: Jonathan Buttner <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
# Conflicts:
#	package.json
#	x-pack/plugins/cases/common/utils/markdown_plugins/utils.test.ts
#	x-pack/plugins/cases/server/saved_object_types/migrations/comments.test.ts
#	x-pack/plugins/cases/server/saved_object_types/migrations/comments.ts
#	x-pack/plugins/cases/server/saved_object_types/migrations/user_actions.test.ts
#	x-pack/plugins/cases/server/saved_object_types/migrations/user_actions.ts
#	x-pack/plugins/cases/server/saved_object_types/migrations/utils.test.ts
#	x-pack/plugins/cases/server/saved_object_types/migrations/utils.ts
#	yarn.lock
jonathan-buttner added a commit that referenced this pull request Dec 13, 2021
…19995) (#120916)

* [Cases] Fix remark stringify version to match remark parse (#119995)

* match parse and stringify version. try/catch added

* Adding tests and refactoring logError

* Adding relative path to core and kibana utils

* remark curstom serializers adapted to version 8

* add error logging to comments  migration

* Adding tests for mergeMigrationFunctionMap logging

Co-authored-by: Jonathan Buttner <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
# Conflicts:
#	package.json
#	x-pack/plugins/cases/common/utils/markdown_plugins/utils.test.ts
#	x-pack/plugins/cases/server/saved_object_types/migrations/comments.test.ts
#	x-pack/plugins/cases/server/saved_object_types/migrations/comments.ts
#	x-pack/plugins/cases/server/saved_object_types/migrations/user_actions.test.ts
#	x-pack/plugins/cases/server/saved_object_types/migrations/user_actions.ts
#	x-pack/plugins/cases/server/saved_object_types/migrations/utils.test.ts
#	x-pack/plugins/cases/server/saved_object_types/migrations/utils.ts
#	yarn.lock

* Adding tests and fixing yarn lock

* Using correct migration

* fixing eslint issues

* Removing redudent tests

Co-authored-by: Sergi Massaneda <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
TinLe pushed a commit to TinLe/kibana that referenced this pull request Dec 22, 2021
…19995)

* match parse and stringify version. try/catch added

* Adding tests and refactoring logError

* Adding relative path to core and kibana utils

* remark curstom serializers adapted to version 8

* add error logging to comments  migration

* Adding tests for mergeMigrationFunctionMap logging

Co-authored-by: Jonathan Buttner <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:fix Team:Threat Hunting Security Solution Threat Hunting Team v7.15.3 v7.16.1 v7.17.0 v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Case] Markdown table is not correctly migrated to newer version of Kibana after 7.14
7 participants