-
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
Using re2 for Timelion regular expressions #67416
Conversation
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.
LGTM
@elasticmachine merge upstream |
'node' is in the defaults, not sure why we aren't using the defaults... https://jestjs.io/docs/en/configuration#modulefileextensions-arraystring
@@ -78,7 +78,7 @@ export default { | |||
], | |||
coverageDirectory: '<rootDir>/target/kibana-coverage/jest', | |||
coverageReporters: !!process.env.CODE_COVERAGE ? ['json'] : ['html', 'text'], | |||
moduleFileExtensions: ['js', 'json', 'ts', 'tsx'], | |||
moduleFileExtensions: ['js', 'json', 'ts', 'tsx', 'node'], |
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.
Without this change, the build was failing with the following error:
Cannot find module './build/Release/re2' from 're2.js'
However, Jest was able to find: 'build/Release/re2.node' You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'json', 'ts', 'tsx']. See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string
'node' is already in the defaults, and I'm not sure why we're overriding the defaults. @elastic/kibana-operations mind double-checking this?
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.
I expect the defaults have changed over the years to include ts
/tsx
, but didn't originally, which is probably why we're overriding them. LGTM, though I'm not opposed to just deleting the override and using the defaults either (in this and other files too).
@@ -9,7 +9,7 @@ export function createJestConfig({ kibanaDirectory, xPackKibanaDirectory }) { | |||
return { | |||
rootDir: xPackKibanaDirectory, | |||
roots: ['<rootDir>/plugins', '<rootDir>/legacy/plugins', '<rootDir>/legacy/server'], | |||
moduleFileExtensions: ['js', 'json', 'ts', 'tsx'], | |||
moduleFileExtensions: ['js', 'json', 'ts', 'tsx', 'node'], |
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.
I updated this to be consistent with src/dev/jest/config.js
, this change isn't needed at this time.
@@ -28,7 +28,7 @@ export default { | |||
], | |||
coverageDirectory: '<rootDir>/../target/kibana-coverage/jest', | |||
coverageReporters: ['html'], | |||
moduleFileExtensions: ['js', 'json', 'ts', 'tsx'], | |||
moduleFileExtensions: ['js', 'json', 'ts', 'tsx', 'node'], |
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.
I updated this to be consistent with src/dev/jest/config.js
, this change isn't needed at this time.
retest |
2 similar comments
retest |
retest |
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.
LGTM
@@ -78,7 +78,7 @@ export default { | |||
], | |||
coverageDirectory: '<rootDir>/target/kibana-coverage/jest', | |||
coverageReporters: !!process.env.CODE_COVERAGE ? ['json'] : ['html', 'text'], | |||
moduleFileExtensions: ['js', 'json', 'ts', 'tsx'], | |||
moduleFileExtensions: ['js', 'json', 'ts', 'tsx', 'node'], |
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.
I expect the defaults have changed over the years to include ts
/tsx
, but didn't originally, which is probably why we're overriding them. LGTM, though I'm not opposed to just deleting the override and using the defaults either (in this and other files too).
@elasticmachine merge upstream |
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.
LGTM, tested locally
@kobelb I thought re2 wanted to implement this solution upstream and that we, therefore, wanted to wait for that? |
@watson |
Ah ok, I missed that 👍 I'm used to - when shipping pre-built binaries - that they are all included inside the npm package instead of relying on a post-install script that downloads them from a 3rd party website. I'm not really sure I like this approach, but I guess in this case we will have to deal with it as you do here 👍 |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
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.
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* Revert "Revert "Using re2 for Timelion regular expressions (elastic#55208)"" This reverts commit c90293d. * Updating re2 to 1.14.0. Still need to update build patching * Extract the gzip to the destination, supporting multiple extract methods * Adding 'node' to jest's moduleFileExtensions 'node' is in the defaults, not sure why we aren't using the defaults... https://jestjs.io/docs/en/configuration#modulefileextensions-arraystring Co-authored-by: Elastic Machine <[email protected]>
* Revert "Revert "Using re2 for Timelion regular expressions (elastic#55208)"" This reverts commit c90293d. * Updating re2 to 1.14.0. Still need to update build patching * Extract the gzip to the destination, supporting multiple extract methods * Adding 'node' to jest's moduleFileExtensions 'node' is in the defaults, not sure why we aren't using the defaults... https://jestjs.io/docs/en/configuration#modulefileextensions-arraystring Co-authored-by: Elastic Machine <[email protected]>
* Revert "Revert "Using re2 for Timelion regular expressions (#55208)"" This reverts commit c90293d. * Updating re2 to 1.14.0. Still need to update build patching * Extract the gzip to the destination, supporting multiple extract methods * Adding 'node' to jest's moduleFileExtensions 'node' is in the defaults, not sure why we aren't using the defaults... https://jestjs.io/docs/en/configuration#modulefileextensions-arraystring Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
2 similar comments
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
* Revert "Revert "Using re2 for Timelion regular expressions (#55208)"" This reverts commit c90293d. * Updating re2 to 1.14.0. Still need to update build patching * Extract the gzip to the destination, supporting multiple extract methods * Adding 'node' to jest's moduleFileExtensions 'node' is in the defaults, not sure why we aren't using the defaults... https://jestjs.io/docs/en/configuration#modulefileextensions-arraystring Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
* Revert "Revert "Using re2 for Timelion regular expressions (#55208)"" This reverts commit c90293d. * Updating re2 to 1.14.0. Still need to update build patching * Extract the gzip to the destination, supporting multiple extract methods * Adding 'node' to jest's moduleFileExtensions 'node' is in the defaults, not sure why we aren't using the defaults... https://jestjs.io/docs/en/configuration#modulefileextensions-arraystring Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
No description provided.