From 4803aa73dee29bcfb07ddc6da30d5f27bddcef7d Mon Sep 17 00:00:00 2001 From: Rauno Viskus Date: Mon, 31 May 2021 22:02:51 +0300 Subject: [PATCH 1/9] style: remove trailing whitespace --- .github/workflows/publish.yml | 2 +- .github/workflows/release-pr.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6353c4b200..68a4a776d9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,7 +3,7 @@ on: pull_request: branches: [main] types: [closed] - + jobs: publish_to_npm: name: Publish to NPM and GitHub diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 3e29aa3382..6bb8a18a33 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -10,7 +10,7 @@ jobs: create_release_pr: name: Create Release PR and Draft Release runs-on: ubuntu-latest - steps: + steps: - name: Checkout Repository uses: actions/checkout@v2 with: @@ -56,8 +56,8 @@ jobs: branch: release/${{ github.event.inputs.version }} commit-message: 'chore: ${{ github.event.inputs.version }} release proposal' title: 'chore: ${{ github.event.inputs.version }} release proposal' - body: | + body: | This is an auto-generated release PR. If additional changes need to be incorporated before the release, the CHANGELOG must be updated manually. - + Merging this PR will automatically release all packages to NPM. delete-branch: true From bfd587e36f72c0af6edfb1d9164d1619835015a1 Mon Sep 17 00:00:00 2001 From: Rauno Viskus Date: Mon, 31 May 2021 22:04:08 +0300 Subject: [PATCH 2/9] chore: add node:16 to the test matrix --- .github/workflows/unit-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 3eeac25e0e..a0278940f3 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - container: ["node:8", "node:10", "node:12", "node:14"] + container: ["node:8", "node:10", "node:12", "node:14", "node:16"] runs-on: ubuntu-latest container: image: ${{ matrix.container }} From 83c95f1032db6b884ccecc062a4fec2ed2ff5832 Mon Sep 17 00:00:00 2001 From: Rauno Viskus Date: Tue, 1 Jun 2021 13:04:54 +0300 Subject: [PATCH 3/9] fix: fix typo in workflows --- .github/workflows/unit-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index a0278940f3..3fa694742e 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -91,7 +91,7 @@ jobs: key: ${{ runner.os }}-${{ matrix.container }}-${{ hashFiles('**/package.json') }} - name: Install Root Dependencies run: npm install --ignore-scripts - - name: Boostrap Dependencies + - name: Bootstrap Dependencies run: npx lerna bootstrap --no-ci - name: Unit tests run: npm run test @@ -124,7 +124,7 @@ jobs: key: ${{ runner.os }}-node:12-${{ hashFiles('**/package.json') }} - name: Install Root Dependencies run: npm install --ignore-scripts - - name: Boostrap Dependencies + - name: Bootstrap Dependencies run: npx lerna bootstrap --no-ci - name: Unit tests run: npm run test:browser From 517d4289bb1ebbb6b2b45495bb4d397edda38994 Mon Sep 17 00:00:00 2001 From: Rauno Viskus Date: Tue, 1 Jun 2021 13:06:05 +0300 Subject: [PATCH 4/9] fix: fix npm cache permissions --- .github/workflows/unit-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 3fa694742e..c60700cfa8 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -91,6 +91,8 @@ jobs: key: ${{ runner.os }}-${{ matrix.container }}-${{ hashFiles('**/package.json') }} - name: Install Root Dependencies run: npm install --ignore-scripts + - name: Fix npm cache permissions + run: chown -R 1001:121 "/github/home/.npm" - name: Bootstrap Dependencies run: npx lerna bootstrap --no-ci - name: Unit tests From 3bfd71dda348de4812e70c405a7623439c40cc84 Mon Sep 17 00:00:00 2001 From: Rauno Viskus Date: Tue, 1 Jun 2021 13:25:20 +0300 Subject: [PATCH 5/9] fix: revert karma-webpack to v4 in aws packages --- packages/opentelemetry-id-generator-aws-xray/package.json | 2 +- propagators/opentelemetry-propagator-aws-xray/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/opentelemetry-id-generator-aws-xray/package.json b/packages/opentelemetry-id-generator-aws-xray/package.json index 09dd4b686b..b028bbd689 100644 --- a/packages/opentelemetry-id-generator-aws-xray/package.json +++ b/packages/opentelemetry-id-generator-aws-xray/package.json @@ -64,7 +64,7 @@ "karma-coverage-istanbul-reporter": "3.0.3", "karma-mocha": "2.0.1", "karma-spec-reporter": "0.0.32", - "karma-webpack": "5.0.0", + "karma-webpack": "^4.0.2", "mocha": "7.2.0", "nyc": "15.1.0", "rimraf": "3.0.2", diff --git a/propagators/opentelemetry-propagator-aws-xray/package.json b/propagators/opentelemetry-propagator-aws-xray/package.json index f5f83b6417..8ef41aa0ff 100644 --- a/propagators/opentelemetry-propagator-aws-xray/package.json +++ b/propagators/opentelemetry-propagator-aws-xray/package.json @@ -57,7 +57,7 @@ "karma-coverage-istanbul-reporter": "3.0.3", "karma-mocha": "2.0.1", "karma-spec-reporter": "0.0.32", - "karma-webpack": "5.0.0", + "karma-webpack": "^4.0.2", "mocha": "7.2.0", "nyc": "15.1.0", "rimraf": "3.0.2", From d5b7e6690f70441760bd96f0647af9a72254a073 Mon Sep 17 00:00:00 2001 From: Rauno Viskus Date: Tue, 1 Jun 2021 14:44:29 +0300 Subject: [PATCH 6/9] fix: remove tslint from router --- plugins/node/opentelemetry-instrumentation-router/package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/node/opentelemetry-instrumentation-router/package.json b/plugins/node/opentelemetry-instrumentation-router/package.json index 576c4972b7..26b40807df 100644 --- a/plugins/node/opentelemetry-instrumentation-router/package.json +++ b/plugins/node/opentelemetry-instrumentation-router/package.json @@ -53,8 +53,6 @@ "rimraf": "3.0.2", "router": "1.3.5", "ts-mocha": "8.0.0", - "tslint-consistent-codestyle": "1.16.0", - "tslint-microsoft-contrib": "6.2.0", "typescript": "4.2.4" }, "dependencies": { From f015e85ac9bcb5c7910afebf0e802cf495858d9f Mon Sep 17 00:00:00 2001 From: Rauno Viskus Date: Mon, 7 Jun 2021 22:18:01 +0300 Subject: [PATCH 7/9] test: fix net instrumentation tests for node 16 --- .../test/connect.test.ts | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/plugins/node/opentelemetry-instrumentation-net/test/connect.test.ts b/plugins/node/opentelemetry-instrumentation-net/test/connect.test.ts index 72182b024f..e954f25471 100644 --- a/plugins/node/opentelemetry-instrumentation-net/test/connect.test.ts +++ b/plugins/node/opentelemetry-instrumentation-net/test/connect.test.ts @@ -175,16 +175,29 @@ describe('NetInstrumentation', () => { }); it('should produce a generic span in case transport type can not be determined', done => { - socket.once(SocketEvent.CLOSE, () => { - const span = getSpan(); - assert.strictEqual( - span.attributes[SemanticAttributes.NET_TRANSPORT], - undefined - ); - assert.strictEqual(span.status.code, SpanStatusCode.ERROR); - done(); - }); - socket.connect(undefined as unknown as string); + const assertSpan = () => { + try { + const span = getSpan(); + assert.strictEqual( + span.attributes[SemanticAttributes.NET_TRANSPORT], + undefined + ); + assert.strictEqual(span.status.code, SpanStatusCode.ERROR); + done(); + } catch (e) { + done(e); + } + } + try { + // socket.connect() will not throw before node@16 only closes + socket.once(SocketEvent.CLOSE, assertSpan); + socket.connect(undefined as unknown as string); + } catch (e) { + // socket.connect() will throw in node@16 + socket.removeListener(SocketEvent.CLOSE, assertSpan); + assert.strictEqual(e.message, 'The "options" or "port" or "path" argument must be specified'); + assertSpan(); + } }); }); From 8c05f5d21bc62ac147c6b070c04d42138b0a900c Mon Sep 17 00:00:00 2001 From: Rauno Viskus Date: Tue, 8 Jun 2021 11:50:46 +0300 Subject: [PATCH 8/9] style: lint changed files --- .../test/connect.test.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/node/opentelemetry-instrumentation-net/test/connect.test.ts b/plugins/node/opentelemetry-instrumentation-net/test/connect.test.ts index e954f25471..32d52c0ad2 100644 --- a/plugins/node/opentelemetry-instrumentation-net/test/connect.test.ts +++ b/plugins/node/opentelemetry-instrumentation-net/test/connect.test.ts @@ -187,15 +187,18 @@ describe('NetInstrumentation', () => { } catch (e) { done(e); } - } + }; try { // socket.connect() will not throw before node@16 only closes socket.once(SocketEvent.CLOSE, assertSpan); - socket.connect(undefined as unknown as string); + socket.connect((undefined as unknown) as string); } catch (e) { // socket.connect() will throw in node@16 socket.removeListener(SocketEvent.CLOSE, assertSpan); - assert.strictEqual(e.message, 'The "options" or "port" or "path" argument must be specified'); + assert.strictEqual( + e.message, + 'The "options" or "port" or "path" argument must be specified' + ); assertSpan(); } }); From 20792a5aacc5754a426471e639f40cc2bbef12d5 Mon Sep 17 00:00:00 2001 From: Rauno Viskus Date: Tue, 8 Jun 2021 12:07:58 +0300 Subject: [PATCH 9/9] style: remove parentheses eslint --fix put there --- .../node/opentelemetry-instrumentation-net/test/connect.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/node/opentelemetry-instrumentation-net/test/connect.test.ts b/plugins/node/opentelemetry-instrumentation-net/test/connect.test.ts index 32d52c0ad2..eaacca2174 100644 --- a/plugins/node/opentelemetry-instrumentation-net/test/connect.test.ts +++ b/plugins/node/opentelemetry-instrumentation-net/test/connect.test.ts @@ -191,7 +191,7 @@ describe('NetInstrumentation', () => { try { // socket.connect() will not throw before node@16 only closes socket.once(SocketEvent.CLOSE, assertSpan); - socket.connect((undefined as unknown) as string); + socket.connect(undefined as unknown as string); } catch (e) { // socket.connect() will throw in node@16 socket.removeListener(SocketEvent.CLOSE, assertSpan);