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

chore: track package-lock.json #4238

Merged
merged 28 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1c9205f
chore: track package-lock.json
legendecas Oct 30, 2023
de24a33
Pin to old versions for node 14
dyladan Oct 30, 2023
b96c3d9
Use version range
dyladan Oct 31, 2023
1dbf56d
Remove unused cached directories
dyladan Oct 31, 2023
6f7706a
Temporarily disable other tests
dyladan Oct 31, 2023
2edd213
Temporarily enable only api test
dyladan Oct 31, 2023
68931bf
Enable only some packages
dyladan Oct 31, 2023
0bb77a0
Test only api packages
dyladan Oct 31, 2023
7aaa168
Test trace exporters
dyladan Oct 31, 2023
375ac6c
Fix line ordering
dyladan Oct 31, 2023
1041126
Test all packages except otlp exporters
dyladan Oct 31, 2023
da4ac69
Add trace http exporter
dyladan Oct 31, 2023
6b18e61
Add trace proto exporter
dyladan Oct 31, 2023
bc5f011
Test all but grpc exporters
dyladan Oct 31, 2023
f9b1dc7
chore: use npm workspaces and degrade lerna to v6
legendecas Nov 1, 2023
5093a10
chore: get rid of lerna bootstrap
legendecas Nov 1, 2023
a24e0d5
chore: use npx
legendecas Nov 1, 2023
e6b1b8f
chore: allow install scripts to setup buf
legendecas Nov 1, 2023
1c4e7e2
chore: fix w3c-integration-test cache key
legendecas Nov 1, 2023
36833f5
chore: fix cache key
legendecas Nov 1, 2023
6c47b32
chore: disable resource compat test
legendecas Nov 1, 2023
3f168db
chore: fix node_modules assumptions
legendecas Nov 1, 2023
08225f1
chore: fix hoisted karma issue
legendecas Nov 1, 2023
89113f9
chore: fix markdown linter complaints
legendecas Nov 1, 2023
e331083
chore: lock @grpc/grpc-js to v1.8.21
legendecas Nov 1, 2023
8d7f865
Break caches
dyladan Nov 1, 2023
ba0d37b
chore: remove cache
legendecas Nov 1, 2023
a639048
chore: fixup inline commands
legendecas Nov 1, 2023
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
20 changes: 2 additions & 18 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,11 @@ jobs:

- run: npm install -g npm@latest

- name: restore lerna
id: cache
uses: actions/cache@v3
with:
path: |
node_modules
package-lock.json
packages/*/node_modules
packages/*/package-lock.json
experimental/packages/*/node_modules
experimental/packages/*/package-lock.json
key: node-tests-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}-04292022

- name: Bootstrap
run: |
npm install --ignore-scripts
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js' --ignore @opentelemetry/selenium-tests
run: npm ci

- name: Build 🔧
run: |
npm run compile
run: npm run compile

- name: Benchmark tests
run: |
Expand Down
26 changes: 2 additions & 24 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,9 @@ jobs:
with:
node-version: '18'

- name: restore lock files
uses: actions/cache@master # must use unreleased master to cache multiple paths
id: cache
with:
# must be done before bootstrap to not include node_modules files in the cache paths
path: |
package-lock.json
packages/*/package-lock.json
backwards-compatibility/*/package-lock.json
metapackages/*/package-lock.json
packages/*/package-lock.json
integration-tests/*/package-lock.json
key: ${{ runner.os }}-unit_test-${{ matrix.node_version }}-${{ hashFiles('**/package.json') }}
- name: Install and Build (cache miss) 🔧
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install --ignore-scripts
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js'
npm run compile

- name: Install and Build (cache hit) 🔧
if: steps.cache.outputs.cache-hit == 'true'
- name: Install and Build 🔧
run: |
npm ci --ignore-scripts
npx lerna bootstrap --hoist --nohoist='zone.js'
npm ci
npm run compile

- name: Build Docs
Expand Down
18 changes: 1 addition & 17 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,8 @@ jobs:
args: "./**/*.md"
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'

- name: restore lerna
id: cache
uses: actions/cache@v3
with:
path: |
node_modules
package-lock.json
packages/*/node_modules
packages/*/package-lock.json
experimental/packages/*/node_modules
experimental/packages/*/package-lock.json
key: lint-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}-04142022

# On a cache miss, install dependencies
- name: Bootstrap
run: |
npm install --ignore-scripts
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js'
run: npm ci

- name: Lint
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/peer-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v4

- name: Install lerna
run: npm install -g lerna
run: npm install -g lerna@6.6.2

- name: Install semver
run: npm install semver
Comment on lines 19 to 23
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: This npm install semver installs all dependencies anyway (npm issue: npm/cli#3023). This could consider just running npm ci OR also installing semver globally (untested): npm install -g semver. The latter, if it works, would avoid installing ~800MB of deps.

Copy link
Member

Choose a reason for hiding this comment

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

Expand Down
81 changes: 7 additions & 74 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,11 @@ jobs:
- run: npm install -g npm@"<10.0.0"
if: ${{ matrix.node_version == '14' || matrix.node_version == '16' }}

- name: restore lerna
id: cache
uses: actions/cache@v3
with:
path: |
node_modules
package-lock.json
packages/*/node_modules
packages/*/package-lock.json
experimental/packages/*/node_modules
experimental/packages/*/package-lock.json
key: node-tests-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}-04292022

# temporary fix for https://github.com/nrwl/nx/issues/19022
- run: npm install --save-dev nx@16.7.4 @nx/devkit@16.7.4
if: ${{ matrix.node_version == '14' }}

- name: Bootstrap
run: |
npm install --ignore-scripts
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js' --ignore @opentelemetry/selenium-tests
run: npm ci

- name: Build 🔧
run: |
npm run compile
run: npm run compile

- name: Unit tests
run: |
Expand All @@ -83,23 +63,8 @@ jobs:

- run: npm install -g npm@latest

- name: restore lerna
id: cache
uses: actions/cache@v3
with:
path: |
node_modules
package-lock.json
packages/*/node_modules
packages/*/package-lock.json
experimental/packages/*/node_modules
experimental/packages/*/package-lock.json
key: node-windows-tests-${{ runner.os }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}

- name: Bootstrap
run: |
npm install --ignore-scripts
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js' --ignore @opentelemetry/selenium-tests
run: npm ci

- name: Build 🔧
run: |
Expand All @@ -122,27 +87,11 @@ jobs:
with:
node-version: 16

- name: restore lerna
id: cache
uses: actions/cache@v3
with:
path: |
node_modules
package-lock.json
packages/*/node_modules
packages/*/package-lock.json
experimental/packages/*/node_modules
experimental/packages/*/package-lock.json
key: browser-tests-${{ runner.os }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}-04292022

- name: Bootstrap
run: |
npm install --ignore-scripts
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js' --ignore @opentelemetry/selenium-tests
run: npm ci

- name: Build 🔧
run: |
npm run compile
run: npm run compile

- name: Unit tests
run: npm run test:browser
Expand All @@ -159,27 +108,11 @@ jobs:
with:
node-version: 16

- name: restore lerna
id: cache
uses: actions/cache@v3
with:
path: |
node_modules
package-lock.json
packages/*/node_modules
packages/*/package-lock.json
experimental/packages/*/node_modules
experimental/packages/*/package-lock.json
key: webworker-tests-${{ runner.os }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}-04292022

- name: Bootstrap
run: |
npm install --ignore-scripts
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js'
run: npm ci

- name: Build 🔧
run: |
npm run compile
run: npm run compile

- name: Unit tests
run: npm run test:webworker
Expand Down
28 changes: 3 additions & 25 deletions .github/workflows/w3c-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,11 @@ jobs:
with:
node-version: '16'

- name: restore lock files
uses: actions/cache@master # must use unreleased master to cache multiple paths
id: cache
with:
# must be done before bootstrap to not include node_modules files in the cache paths
path: |
package-lock.json
packages/*/package-lock.json
metapackages/*/package-lock.json
packages/*/package-lock.json
integration-tests/*/package-lock.json
key: ${{ runner.os }}-w3c_integration-${{ hashFiles('**/package.json') }}

- name: Install and Bootstrap (cache miss) 🔧
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install --ignore-scripts
npx lerna bootstrap --no-ci --hoist --scope=propagation-validation-server --include-dependencies

- name: Install and Bootstrap (cache hit) 🔧
if: steps.cache.outputs.cache-hit == 'true'
run: |
npm ci --ignore-scripts
npx lerna bootstrap --hoist --scope=propagation-validation-server --include-dependencies
- name: Install and Bootstrap 🔧
run: npm ci

- name: Generate version.ts files
run: lerna run version
run: npm run version:update

- name: Build 🔧
run: npm run compile
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ typings/

# lock files
yarn.lock
package-lock.json

# docs files
docs
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/

### :house: (Internal)

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

## 1.17.1

### :bug: (Bug Fix)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Most of the commands needed for development are accessed as [npm scripts](https:

### Install dependencies

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.
This will install all dependencies for the root project and all modules managed by `npm workspaces`.

```sh
npm install
Expand Down
2 changes: 1 addition & 1 deletion api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"karma-mocha-webworker": "1.3.0",
"karma-spec-reporter": "0.0.36",
"karma-webpack": "4.0.2",
"lerna": "7.1.5",
"lerna": "6.6.2",
"memfs": "3.5.3",
"mocha": "10.2.0",
"nyc": "15.1.0",
Expand Down
2 changes: 1 addition & 1 deletion api/test/tree-shaking/tree-shaking.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('tree-shaking', () => {
if (err) {
return reject(err);
}
resolve(stats);
resolve(stats!);
});
});
assert.deepStrictEqual(stats.compilation.errors, []);
Expand Down
4 changes: 2 additions & 2 deletions experimental/examples/logs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
},
"dependencies": {
"@opentelemetry/api": "^1.6.0",
"@opentelemetry/api-logs": "0.41.0",
"@opentelemetry/sdk-logs": "0.41.0"
"@opentelemetry/api-logs": "0.44.0",
"@opentelemetry/sdk-logs": "0.44.0"
},
"devDependencies": {
"@types/node": "18.6.5",
Expand Down
2 changes: 1 addition & 1 deletion experimental/packages/api-events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"karma-mocha": "2.0.1",
"karma-spec-reporter": "0.0.36",
"karma-webpack": "4.0.2",
"lerna": "7.1.5",
"lerna": "6.6.2",
"mocha": "10.2.0",
"nyc": "15.1.0",
"ts-loader": "8.4.0",
Expand Down
2 changes: 1 addition & 1 deletion experimental/packages/api-logs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"karma-mocha": "2.0.1",
"karma-spec-reporter": "0.0.36",
"karma-webpack": "4.0.2",
"lerna": "7.1.5",
"lerna": "6.6.2",
"mocha": "10.2.0",
"nyc": "15.1.0",
"ts-loader": "8.4.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"codecov": "3.8.3",
"cpx": "1.5.0",
"cross-var": "1.1.0",
"lerna": "7.1.5",
"lerna": "6.6.2",
"mocha": "10.2.0",
"nyc": "15.1.0",
"sinon": "15.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"karma-mocha": "2.0.1",
"karma-spec-reporter": "0.0.36",
"karma-webpack": "4.0.2",
"lerna": "7.1.5",
"lerna": "6.6.2",
"mocha": "10.2.0",
"nyc": "15.1.0",
"sinon": "15.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"karma-mocha": "2.0.1",
"karma-spec-reporter": "0.0.36",
"karma-webpack": "4.0.2",
"lerna": "7.1.5",
"lerna": "6.6.2",
"mocha": "10.2.0",
"nyc": "15.1.0",
"sinon": "15.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"codecov": "3.8.3",
"cpx": "1.5.0",
"cross-var": "1.1.0",
"lerna": "7.1.5",
"lerna": "6.6.2",
"mocha": "10.2.0",
"nyc": "15.1.0",
"sinon": "15.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"karma-mocha": "2.0.1",
"karma-spec-reporter": "0.0.36",
"karma-webpack": "4.0.2",
"lerna": "7.1.5",
"lerna": "6.6.2",
"mocha": "10.2.0",
"nyc": "15.1.0",
"sinon": "15.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"karma-mocha": "2.0.1",
"karma-spec-reporter": "0.0.36",
"karma-webpack": "4.0.2",
"lerna": "7.1.5",
"lerna": "6.6.2",
"mocha": "10.2.0",
"nyc": "15.1.0",
"sinon": "15.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"karma-mocha": "2.0.1",
"karma-spec-reporter": "0.0.36",
"karma-webpack": "4.0.2",
"lerna": "7.1.5",
"lerna": "6.6.2",
"mocha": "10.2.0",
"nyc": "15.1.0",
"sinon": "15.1.2",
Expand Down
Loading