Skip to content

Commit e9328ab

Browse files
legendecasdyladan
andauthored
chore: track package-lock.json (#4238)
* chore: track package-lock.json * Pin to old versions for node 14 * Use version range * Remove unused cached directories * Temporarily disable other tests * Temporarily enable only api test * Enable only some packages * Test only api packages * Test trace exporters * Fix line ordering * Test all packages except otlp exporters * Add trace http exporter * Add trace proto exporter * Test all but grpc exporters * chore: use npm workspaces and degrade lerna to v6 * chore: get rid of lerna bootstrap * chore: use npx * chore: allow install scripts to setup buf * chore: fix w3c-integration-test cache key * chore: fix cache key * chore: disable resource compat test * chore: fix node_modules assumptions * chore: fix hoisted karma issue * chore: fix markdown linter complaints * chore: lock @grpc/grpc-js to v1.8.21 * Break caches * chore: remove cache * chore: fixup inline commands --------- Co-authored-by: Daniel Dyla <[email protected]>
1 parent 1c7d7a3 commit e9328ab

File tree

62 files changed

+63743
-258
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+63743
-258
lines changed

.github/workflows/benchmark.yml

+2-18
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,11 @@ jobs:
2525

2626
- run: npm install -g npm@latest
2727

28-
- name: restore lerna
29-
id: cache
30-
uses: actions/cache@v3
31-
with:
32-
path: |
33-
node_modules
34-
package-lock.json
35-
packages/*/node_modules
36-
packages/*/package-lock.json
37-
experimental/packages/*/node_modules
38-
experimental/packages/*/package-lock.json
39-
key: node-tests-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}-04292022
40-
4128
- name: Bootstrap
42-
run: |
43-
npm install --ignore-scripts
44-
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js' --ignore @opentelemetry/selenium-tests
29+
run: npm ci
4530

4631
- name: Build 🔧
47-
run: |
48-
npm run compile
32+
run: npm run compile
4933

5034
- name: Benchmark tests
5135
run: |

.github/workflows/docs.yaml

+2-24
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,9 @@ jobs:
1515
with:
1616
node-version: '18'
1717

18-
- name: restore lock files
19-
uses: actions/cache@master # must use unreleased master to cache multiple paths
20-
id: cache
21-
with:
22-
# must be done before bootstrap to not include node_modules files in the cache paths
23-
path: |
24-
package-lock.json
25-
packages/*/package-lock.json
26-
backwards-compatibility/*/package-lock.json
27-
metapackages/*/package-lock.json
28-
packages/*/package-lock.json
29-
integration-tests/*/package-lock.json
30-
key: ${{ runner.os }}-unit_test-${{ matrix.node_version }}-${{ hashFiles('**/package.json') }}
31-
- name: Install and Build (cache miss) 🔧
32-
if: steps.cache.outputs.cache-hit != 'true'
33-
run: |
34-
npm install --ignore-scripts
35-
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js'
36-
npm run compile
37-
38-
- name: Install and Build (cache hit) 🔧
39-
if: steps.cache.outputs.cache-hit == 'true'
18+
- name: Install and Build 🔧
4019
run: |
41-
npm ci --ignore-scripts
42-
npx lerna bootstrap --hoist --nohoist='zone.js'
20+
npm ci
4321
npm run compile
4422
4523
- name: Build Docs

.github/workflows/lint.yml

+1-17
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,8 @@ jobs:
3434
args: "./**/*.md"
3535
ignore: './CHANGELOG.md ./experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/protos ./experimental/packages/opentelemetry-exporter-metrics-otlp-proto/protos ./packages/exporter-trace-otlp-grpc/protos ./packages/exporter-trace-otlp-proto/protos'
3636

37-
- name: restore lerna
38-
id: cache
39-
uses: actions/cache@v3
40-
with:
41-
path: |
42-
node_modules
43-
package-lock.json
44-
packages/*/node_modules
45-
packages/*/package-lock.json
46-
experimental/packages/*/node_modules
47-
experimental/packages/*/package-lock.json
48-
key: lint-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}-04142022
49-
50-
# On a cache miss, install dependencies
5137
- name: Bootstrap
52-
run: |
53-
npm install --ignore-scripts
54-
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js'
38+
run: npm ci
5539

5640
- name: Lint
5741
run: |

.github/workflows/peer-api.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: actions/checkout@v4
1818

1919
- name: Install lerna
20-
run: npm install -g lerna
20+
run: npm install -g lerna@6.6.2
2121

2222
- name: Install semver
2323
run: npm install semver

.github/workflows/unit-test.yml

+7-74
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,11 @@ jobs:
3333
- run: npm install -g npm@"<10.0.0"
3434
if: ${{ matrix.node_version == '14' || matrix.node_version == '16' }}
3535

36-
- name: restore lerna
37-
id: cache
38-
uses: actions/cache@v3
39-
with:
40-
path: |
41-
node_modules
42-
package-lock.json
43-
packages/*/node_modules
44-
packages/*/package-lock.json
45-
experimental/packages/*/node_modules
46-
experimental/packages/*/package-lock.json
47-
key: node-tests-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}-04292022
48-
49-
# temporary fix for https://github.com/nrwl/nx/issues/19022
50-
- run: npm install --save-dev [email protected] @nx/[email protected]
51-
if: ${{ matrix.node_version == '14' }}
52-
5336
- name: Bootstrap
54-
run: |
55-
npm install --ignore-scripts
56-
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js' --ignore @opentelemetry/selenium-tests
37+
run: npm ci
5738

5839
- name: Build 🔧
59-
run: |
60-
npm run compile
40+
run: npm run compile
6141

6242
- name: Unit tests
6343
run: |
@@ -83,23 +63,8 @@ jobs:
8363

8464
- run: npm install -g npm@latest
8565

86-
- name: restore lerna
87-
id: cache
88-
uses: actions/cache@v3
89-
with:
90-
path: |
91-
node_modules
92-
package-lock.json
93-
packages/*/node_modules
94-
packages/*/package-lock.json
95-
experimental/packages/*/node_modules
96-
experimental/packages/*/package-lock.json
97-
key: node-windows-tests-${{ runner.os }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}
98-
9966
- name: Bootstrap
100-
run: |
101-
npm install --ignore-scripts
102-
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js' --ignore @opentelemetry/selenium-tests
67+
run: npm ci
10368

10469
- name: Build 🔧
10570
run: |
@@ -122,27 +87,11 @@ jobs:
12287
with:
12388
node-version: 16
12489

125-
- name: restore lerna
126-
id: cache
127-
uses: actions/cache@v3
128-
with:
129-
path: |
130-
node_modules
131-
package-lock.json
132-
packages/*/node_modules
133-
packages/*/package-lock.json
134-
experimental/packages/*/node_modules
135-
experimental/packages/*/package-lock.json
136-
key: browser-tests-${{ runner.os }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}-04292022
137-
13890
- name: Bootstrap
139-
run: |
140-
npm install --ignore-scripts
141-
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js' --ignore @opentelemetry/selenium-tests
91+
run: npm ci
14292

14393
- name: Build 🔧
144-
run: |
145-
npm run compile
94+
run: npm run compile
14695

14796
- name: Unit tests
14897
run: npm run test:browser
@@ -159,27 +108,11 @@ jobs:
159108
with:
160109
node-version: 16
161110

162-
- name: restore lerna
163-
id: cache
164-
uses: actions/cache@v3
165-
with:
166-
path: |
167-
node_modules
168-
package-lock.json
169-
packages/*/node_modules
170-
packages/*/package-lock.json
171-
experimental/packages/*/node_modules
172-
experimental/packages/*/package-lock.json
173-
key: webworker-tests-${{ runner.os }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}-04292022
174-
175111
- name: Bootstrap
176-
run: |
177-
npm install --ignore-scripts
178-
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js'
112+
run: npm ci
179113

180114
- name: Build 🔧
181-
run: |
182-
npm run compile
115+
run: npm run compile
183116

184117
- name: Unit tests
185118
run: npm run test:webworker

.github/workflows/w3c-integration-test.yml

+3-25
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,11 @@ jobs:
1818
with:
1919
node-version: '16'
2020

21-
- name: restore lock files
22-
uses: actions/cache@master # must use unreleased master to cache multiple paths
23-
id: cache
24-
with:
25-
# must be done before bootstrap to not include node_modules files in the cache paths
26-
path: |
27-
package-lock.json
28-
packages/*/package-lock.json
29-
metapackages/*/package-lock.json
30-
packages/*/package-lock.json
31-
integration-tests/*/package-lock.json
32-
key: ${{ runner.os }}-w3c_integration-${{ hashFiles('**/package.json') }}
33-
34-
- name: Install and Bootstrap (cache miss) 🔧
35-
if: steps.cache.outputs.cache-hit != 'true'
36-
run: |
37-
npm install --ignore-scripts
38-
npx lerna bootstrap --no-ci --hoist --scope=propagation-validation-server --include-dependencies
39-
40-
- name: Install and Bootstrap (cache hit) 🔧
41-
if: steps.cache.outputs.cache-hit == 'true'
42-
run: |
43-
npm ci --ignore-scripts
44-
npx lerna bootstrap --hoist --scope=propagation-validation-server --include-dependencies
21+
- name: Install and Bootstrap 🔧
22+
run: npm ci
4523

4624
- name: Generate version.ts files
47-
run: lerna run version
25+
run: npm run version:update
4826

4927
- name: Build 🔧
5028
run: npm run compile

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ typings/
6666

6767
# lock files
6868
yarn.lock
69-
package-lock.json
7069

7170
# docs files
7271
docs

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/
1919

2020
### :house: (Internal)
2121

22+
* chore: track package-lock.json [#4238](https://github.com/open-telemetry/opentelemetry-js/pull/4238) @legendecas
23+
* Switched to npm workspaces to bootstrap dependencies.
24+
2225
## 1.17.1
2326

2427
### :bug: (Bug Fix)

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Most of the commands needed for development are accessed as [npm scripts](https:
161161

162162
### Install dependencies
163163

164-
This will install all dependencies for the root project and all modules managed by `lerna`. By default, a `postinstall` script will run `lerna bootstrap` automatically after an install. This can be avoided using the `--ignore-scripts` option if desired.
164+
This will install all dependencies for the root project and all modules managed by `npm workspaces`.
165165

166166
```sh
167167
npm install

api/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"karma-mocha-webworker": "1.3.0",
7878
"karma-spec-reporter": "0.0.36",
7979
"karma-webpack": "4.0.2",
80-
"lerna": "7.1.5",
80+
"lerna": "6.6.2",
8181
"memfs": "3.5.3",
8282
"mocha": "10.2.0",
8383
"nyc": "15.1.0",

api/test/tree-shaking/tree-shaking.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ describe('tree-shaking', () => {
9595
if (err) {
9696
return reject(err);
9797
}
98-
resolve(stats);
98+
resolve(stats!);
9999
});
100100
});
101101
assert.deepStrictEqual(stats.compilation.errors, []);

experimental/examples/logs/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
},
88
"dependencies": {
99
"@opentelemetry/api": "^1.6.0",
10-
"@opentelemetry/api-logs": "0.41.0",
11-
"@opentelemetry/sdk-logs": "0.41.0"
10+
"@opentelemetry/api-logs": "0.44.0",
11+
"@opentelemetry/sdk-logs": "0.44.0"
1212
},
1313
"devDependencies": {
1414
"@types/node": "18.6.5",

experimental/packages/api-events/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"karma-mocha": "2.0.1",
7777
"karma-spec-reporter": "0.0.36",
7878
"karma-webpack": "4.0.2",
79-
"lerna": "7.1.5",
79+
"lerna": "6.6.2",
8080
"mocha": "10.2.0",
8181
"nyc": "15.1.0",
8282
"ts-loader": "8.4.0",

experimental/packages/api-logs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"karma-mocha": "2.0.1",
7777
"karma-spec-reporter": "0.0.36",
7878
"karma-webpack": "4.0.2",
79-
"lerna": "7.1.5",
79+
"lerna": "6.6.2",
8080
"mocha": "10.2.0",
8181
"nyc": "15.1.0",
8282
"ts-loader": "8.4.0",

experimental/packages/exporter-logs-otlp-grpc/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"codecov": "3.8.3",
6161
"cpx": "1.5.0",
6262
"cross-var": "1.1.0",
63-
"lerna": "7.1.5",
63+
"lerna": "6.6.2",
6464
"mocha": "10.2.0",
6565
"nyc": "15.1.0",
6666
"sinon": "15.1.2",

experimental/packages/exporter-logs-otlp-http/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"karma-mocha": "2.0.1",
9090
"karma-spec-reporter": "0.0.36",
9191
"karma-webpack": "4.0.2",
92-
"lerna": "7.1.5",
92+
"lerna": "6.6.2",
9393
"mocha": "10.2.0",
9494
"nyc": "15.1.0",
9595
"sinon": "15.1.2",

experimental/packages/exporter-logs-otlp-proto/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"karma-mocha": "2.0.1",
7979
"karma-spec-reporter": "0.0.36",
8080
"karma-webpack": "4.0.2",
81-
"lerna": "7.1.5",
81+
"lerna": "6.6.2",
8282
"mocha": "10.2.0",
8383
"nyc": "15.1.0",
8484
"sinon": "15.1.2",

experimental/packages/exporter-trace-otlp-grpc/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"codecov": "3.8.3",
5858
"cpx": "1.5.0",
5959
"cross-var": "1.1.0",
60-
"lerna": "7.1.5",
60+
"lerna": "6.6.2",
6161
"mocha": "10.2.0",
6262
"nyc": "15.1.0",
6363
"sinon": "15.1.2",

experimental/packages/exporter-trace-otlp-http/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"karma-mocha": "2.0.1",
8181
"karma-spec-reporter": "0.0.36",
8282
"karma-webpack": "4.0.2",
83-
"lerna": "7.1.5",
83+
"lerna": "6.6.2",
8484
"mocha": "10.2.0",
8585
"nyc": "15.1.0",
8686
"sinon": "15.1.2",

experimental/packages/exporter-trace-otlp-proto/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"karma-mocha": "2.0.1",
7878
"karma-spec-reporter": "0.0.36",
7979
"karma-webpack": "4.0.2",
80-
"lerna": "7.1.5",
80+
"lerna": "6.6.2",
8181
"mocha": "10.2.0",
8282
"nyc": "15.1.0",
8383
"sinon": "15.1.2",

experimental/packages/opentelemetry-browser-detector/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"karma-mocha": "2.0.1",
6868
"karma-spec-reporter": "0.0.36",
6969
"karma-webpack": "4.0.2",
70-
"lerna": "7.1.5",
70+
"lerna": "6.6.2",
7171
"mocha": "10.2.0",
7272
"nyc": "15.1.0",
7373
"sinon": "15.1.2",

0 commit comments

Comments
 (0)