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

[Maintenance] Bumps re2 and supertest #3018

Merged
merged 1 commit into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Removes `minimatch` manual resolution ([#3019](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3019))
- Remove `github-checks-reporter`, an unused dependency ([#3126](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3126))
- Upgrade `vega-lite` dependency to ^5.6.0 ([#3076](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3076))
- Bumps `re2` and `supertest` ([3018](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3018))

### 🪛 Refactoring

Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
"**/loader-utils": "^2.0.4",
"**/node-jose": "^2.1.0",
"**/nth-check": "^2.0.1",
"**/qs": "^6.10.3",
"**/trim": "^0.0.3",
"**/typescript": "4.0.2",
"**/unset-value": "^2.0.1",
Expand Down Expand Up @@ -197,7 +196,7 @@
"pegjs": "0.10.0",
"proxy-from-env": "1.0.0",
"query-string": "^6.13.2",
"re2": "^1.15.4",
"re2": "1.17.4",
"react": "^16.14.0",
"react-dom": "^16.12.0",
"react-input-range": "^1.3.0",
Expand Down Expand Up @@ -320,7 +319,7 @@
"@types/sinon": "^7.0.13",
"@types/strip-ansi": "^5.2.1",
"@types/styled-components": "^5.1.19",
"@types/supertest": "^2.0.11",
"@types/supertest": "^2.0.12",
"@types/supertest-as-promised": "^2.0.38",
"@types/tapable": "^1.0.6",
"@types/tar": "^4.0.3",
Expand Down Expand Up @@ -446,7 +445,7 @@
"strip-ansi": "^6.0.0",
"stylelint": "^14.5.2",
"stylelint-config-standard-scss": "^3.0.0",
"supertest": "^6.2.2",
"supertest": "^6.3.3",
"supertest-as-promised": "^4.0.2",
"tape": "^5.0.1",
"topojson-client": "3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/dev/build/tasks/patch_native_modules_task.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ it('patch native modules task downloads the correct platform package', async ()
"destination": <absolute path>/.native_modules/re2/linux-arm64-83.tar.gz,
"log": <ToolingLog>,
"retries": 3,
"sha256": "f25124adc64d269a513b99abd4a5eed8d7a929db565207f8ece1f3b7b7931668",
"url": "https://d1v1sj258etie.cloudfront.net/node-re2/releases/download/1.15.4/linux-arm64-83.tar.gz",
"sha256": "d86ced75b794fbf518b90908847b3c09a50f3ff5a2815aa30f53080f926a2873",
"url": "https://d1v1sj258etie.cloudfront.net/node-re2/releases/download/1.17.4/linux-arm64-83.tar.gz",
},
],
]
Expand Down
29 changes: 20 additions & 9 deletions src/dev/build/tasks/patch_native_modules_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,42 @@ interface Package {
>;
}

// Process for updating urls and checksums after bumping the version of `re2`:
// 1. Match `version` with the version in the yarn.lock file.
// 2. Update the url to match the version.
// 2a. If a Node.js update occurs, the node module version must match as
// well (i.e. '83'). See https://nodejs.org/en/download/releases/#ref-1.
// 3. Generate the new checksum by executing the following commands:
// 3a. `wget {url}`
// 3b. `sha256sum {downloaded file name}`
// 3c. For `linux-arm64`, the sha256 can also be found by replacing
// "linux-arm64-83.tar.gz" in the url with "sha256sum.txt.asc"
// and copying the sha256 from that file.
Comment on lines +55 to +65
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding these steps @tmarkley. Tangential question, why do we need this patching process?

Copy link
Contributor Author

@tmarkley tmarkley Dec 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. This patch existed before the fork, but I know @ananzh did the work to bring the ARM build of re2 in (#660). I haven't done a ton of digging in to why this exists, but I'd love to find an alternative approach.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installing re2 produces a binary for the specific platform architecture it was installed on. However, yarn build-platform can be used to create distributables for platforms other than the one the command is being executed on and for this, it downloads NodeJS executable and any binaries needed for the platforms.

ananzh marked this conversation as resolved.
Show resolved Hide resolved
const packages: Package[] = [
{
name: 're2',
version: '1.15.4',
version: '1.17.4',
destinationPath: 'node_modules/re2/build/Release/re2.node',
extractMethod: 'gunzip',
archives: {
'darwin-x64': {
url: 'https://github.com/uhop/node-re2/releases/download/1.15.4/darwin-x64-83.gz',
sha256: 'b45cd8296fd6eb2a091399c20111af43093ba30c99ed9e5d969278f5ff69ba8f',
url: 'https://github.com/uhop/node-re2/releases/download/1.17.4/darwin-x64-83.gz',
sha256: '9112ed93c1544ecc6397f7ff20bd2b28f3b04c7fbb54024e10f9a376a132a87d',
},
'linux-x64': {
url: 'https://github.com/uhop/node-re2/releases/download/1.15.4/linux-x64-83.gz',
sha256: '1bbc3f90f0ba105772b37c04e3a718f69544b4df01dda00435c2b8e50b2ad0d9',
url: 'https://github.com/uhop/node-re2/releases/download/1.17.4/linux-x64-83.gz',
sha256: '86e03540783a18c41f81df0aec320b1f64aca6cbd3a87fc1b7a9b4109c5f5986',
},
'linux-arm64': {
url:
'https://d1v1sj258etie.cloudfront.net/node-re2/releases/download/1.15.4/linux-arm64-83.tar.gz',
sha256: 'f25124adc64d269a513b99abd4a5eed8d7a929db565207f8ece1f3b7b7931668',
'https://d1v1sj258etie.cloudfront.net/node-re2/releases/download/1.17.4/linux-arm64-83.tar.gz',
sha256: 'd86ced75b794fbf518b90908847b3c09a50f3ff5a2815aa30f53080f926a2873',
overriddenExtractMethod: 'untar',
overriddenDestinationPath: 'node_modules/re2/build/Release',
},
'win32-x64': {
url: 'https://github.com/uhop/node-re2/releases/download/1.15.4/win32-x64-83.gz',
sha256: 'efe939d3cda1d64ee3ee3e60a20613b95166d55632e702c670763ea7e69fca06',
url: 'https://github.com/uhop/node-re2/releases/download/1.17.4/win32-x64-83.gz',
sha256: '2f842d9757288afd4bd5dec0e7b370a4c3e89ac98050598b17abb9e8e00e3294',
},
},
},
Expand Down
Loading