-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: added @grpc/grpc-js 1.10 and skipped mali
refs INSTA-744 refs malijs/mali#376
- Loading branch information
Showing
7 changed files
with
309 additions
and
262 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,7 +91,8 @@ | |
"@elastic/elasticsearch-v7.9.0": "npm:@elastic/[email protected]", | ||
"@google-cloud/pubsub": "^4.3.3", | ||
"@google-cloud/storage": "^7.9.0", | ||
"@grpc/grpc-js": "1.9.4", | ||
"@grpc/grpc-js": "1.10.6", | ||
"@grpc/grpc-js-v1": "npm:@grpc/[email protected]", | ||
"@grpc/proto-loader": "^0.7.10", | ||
"@hapi/hapi": "^21.3.7", | ||
"@ibm/tekton-lint": "^1.0.0-beta.9", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
packages/collector/test/tracing/protocols/grpc-js/mockVersion.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* (c) Copyright IBM Corp. 2024 | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const mock = require('mock-require'); | ||
const requireHook = require('../../../../../core/src/util/requireHook'); | ||
|
||
const INSTANA_GRPC_VERSION = process.env.INSTANA_GRPC_VERSION; | ||
const GRPC_REQUIRE = | ||
process.env.INSTANA_GRPC_VERSION === 'latest' ? '@grpc/grpc-js' : `@grpc/grpc-js-${INSTANA_GRPC_VERSION}`; | ||
|
||
if (GRPC_REQUIRE !== '@grpc/grpc-js') { | ||
mock('@grpc/grpc-js', GRPC_REQUIRE); | ||
} | ||
|
||
const originalOnFileLoad = requireHook.onFileLoad; | ||
requireHook.onFileLoad = function onFileLoad() { | ||
if ( | ||
arguments[0].source === '\\/@grpc\\/grpc-js\\/build\\/src\\/server\\.js' || | ||
arguments[0].source === '\\/@grpc\\/grpc-js\\/build\\/src\\/client\\.js' | ||
) { | ||
const str = arguments[0].source.replace('@grpc\\/grpc-js', GRPC_REQUIRE); | ||
const reg = new RegExp(str, ''); | ||
arguments[0] = reg; | ||
return originalOnFileLoad.apply(this, arguments); | ||
} | ||
|
||
return originalOnFileLoad.apply(this, arguments); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.