Skip to content

Commit ed2f033

Browse files
dyladanvmarchaud
andauthored
Merge back into a single lerna monorepo (#2892)
* chore: use a single lerna monorepo * chore: release API dependencies * chore: fix selenium exporter * chore: support old API versions * chore: update changelog * chore: remove peer api check * chore: changelog * chore: fix cache keys and paths * chore: fix lint cache * ci: install when cache misses * chore: apply cache fix to webworker and web * chore: apply cache fix to lint * chore: revert peer api check removal * chore: match peer and dev dependency versions for API * chore: send full string to lerna exec * chore: use npm script for peer api check * chore: use MetricAttributes in metrics * chore: use MetricAttributes when appropriate Co-authored-by: Valentin Marchaud <[email protected]>
1 parent 7086d5a commit ed2f033

File tree

106 files changed

+523
-477
lines changed

Some content is hidden

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

106 files changed

+523
-477
lines changed

.github/workflows/lint.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ on:
88

99
jobs:
1010
build:
11-
strategy:
12-
fail-fast: false
13-
matrix:
14-
package-group: [".", "experimental"]
1511
runs-on: ubuntu-latest
1612

1713
steps:
@@ -22,7 +18,6 @@ jobs:
2218
- uses: actions/checkout@v2
2319

2420
- name: Lint changelog file
25-
if: ${{ matrix.package-group == '.' }}
2621
uses: avto-dev/markdown-lint@v1
2722
with:
2823
# Commenting due to
@@ -33,7 +28,6 @@ jobs:
3328
args: "./CHANGELOG.md"
3429

3530
- name: Lint markdown files
36-
if: ${{ matrix.package-group == '.' }}
3731
uses: avto-dev/markdown-lint@v1
3832
with:
3933
args: "./**/*.md"
@@ -45,27 +39,25 @@ jobs:
4539
with:
4640
path: |
4741
node_modules
48-
experimental/node_modules
49-
*/*/node_modules
50-
experimental/*/*/node_modules
51-
key: lint-${{ matrix.package-group }}-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('**/package.json') }}-20211216.2
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: lint-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}-04142022
5248

5349
# On a cache miss, install dependencies
5450
- name: Bootstrap
55-
if: steps.cache.outputs.cache-hit != 'true'
56-
working-directory: ${{ matrix.package-group }}
5751
run: |
5852
npm install --ignore-scripts
5953
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js'
6054
6155
- name: Lint
62-
working-directory: ${{ matrix.package-group }}
6356
run: |
6457
npm run lint
6558
npm run lint:examples
6659
6760
- name: Lint doc files
68-
if: ${{ matrix.package-group == '.' }}
6961
run: |
7062
npm run compile
7163
NODE_OPTIONS=--max-old-space-size=4096 npm run docs

.github/workflows/peer-api.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/peer-api.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Ensure API Peer Dependency
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
peer-api-check:
11+
runs-on: ubuntu-latest
12+
container:
13+
image: node:14
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Install lerna
19+
run: npm install -g lerna
20+
21+
- name: Install semver
22+
run: npm install semver
23+
24+
- name: Check API dependency semantics
25+
working-directory: packages
26+
run: lerna run peer-api-check

.github/workflows/unit-test.yml

Lines changed: 23 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77

88
jobs:
9-
node-tests-stable:
9+
node-tests:
1010
strategy:
1111
fail-fast: false
1212
matrix:
@@ -28,11 +28,14 @@ jobs:
2828
with:
2929
path: |
3030
node_modules
31-
*/*/node_modules
32-
key: node-tests-stable-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('**/package.json') }}
31+
package-lock.json
32+
packages/*/node_modules
33+
packages/*/package-lock.json
34+
experimental/packages/*/node_modules
35+
experimental/packages/*/package-lock.json
36+
key: node-tests-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}-04142022
3337

3438
- name: Bootstrap
35-
if: steps.cache.outputs.cache-hit != 'true'
3639
run: |
3740
npm install --ignore-scripts
3841
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js' --ignore @opentelemetry/selenium-tests
@@ -46,7 +49,7 @@ jobs:
4649
- name: Report Coverage
4750
run: npm run codecov
4851
if: ${{ matrix.node_version == '14' }}
49-
browser-tests-stable:
52+
browser-tests:
5053
runs-on: ubuntu-latest
5154
container:
5255
image: circleci/node:16-browsers
@@ -59,16 +62,19 @@ jobs:
5962
uses: actions/checkout@v2
6063

6164
- name: restore lerna
62-
uses: actions/cache@v3
6365
id: cache
66+
uses: actions/cache@v3
6467
with:
6568
path: |
6669
node_modules
67-
*/*/node_modules
68-
key: browser-tests-stable-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('**/package.json') }}
70+
package-lock.json
71+
packages/*/node_modules
72+
packages/*/package-lock.json
73+
experimental/packages/*/node_modules
74+
experimental/packages/*/package-lock.json
75+
key: browser-tests-${{ runner.os }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}-04142022
6976

7077
- name: Bootstrap
71-
if: steps.cache.outputs.cache-hit != 'true'
7278
run: |
7379
npm install --ignore-scripts
7480
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js' --ignore @opentelemetry/selenium-tests
@@ -83,7 +89,7 @@ jobs:
8389
run: npm run test:browser
8490
- name: Report Coverage
8591
run: npm run codecov:browser
86-
webworker-tests-stable:
92+
webworker-tests:
8793
runs-on: ubuntu-latest
8894
container:
8995
image: circleci/node:14-browsers
@@ -95,154 +101,31 @@ jobs:
95101
- name: Permission Setup
96102
run: sudo chmod -R 777 /github /__w
97103

98-
- name: restore lerna
99-
uses: actions/cache@v3
100-
id: cache
101-
with:
102-
path: |
103-
node_modules
104-
*/*/node_modules
105-
key: browser-tests-stable-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('**/package.json') }}
106-
107-
- name: Bootstrap
108-
if: steps.cache.outputs.cache-hit != 'true'
109-
run: |
110-
npm install --ignore-scripts
111-
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js'
112-
113-
- name: Build 🔧
114-
run: |
115-
npm run compile
116-
# run additional compilation variants
117-
npx lerna run compile
118-
119-
- name: Unit tests
120-
run: npm run test:webworker
121-
- name: Report Coverage
122-
run: npm run codecov:webworker
123-
node-tests-experimental:
124-
strategy:
125-
fail-fast: false
126-
matrix:
127-
node_version: ["8", "10", "12", "14", "16"]
128-
runs-on: ubuntu-latest
129-
env:
130-
NPM_CONFIG_UNSAFE_PERM: true
131-
steps:
132-
- name: Checkout
133-
uses: actions/checkout@v2
134-
135-
- uses: actions/setup-node@v3
136-
with:
137-
node-version: ${{ matrix.node_version }}
138-
139104
- name: restore lerna
140105
id: cache
141106
uses: actions/cache@v3
142107
with:
143108
path: |
144-
experimental/node_modules
145-
experimental/*/*/node_modules
146-
key: node-tests-experimental-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('experimental/**/package.json') }}
147-
148-
- name: Bootstrap
149-
if: steps.cache.outputs.cache-hit != 'true'
150-
working-directory: experimental
151-
run: |
152-
npm install --ignore-scripts
153-
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js'
154-
155-
- name: Build 🔧
156-
working-directory: experimental
157-
run: |
158-
npm run compile
159-
160-
- name: Unit tests
161-
working-directory: experimental
162-
run: npm run test
163-
- name: Report Coverage
164-
working-directory: experimental
165-
run: npm run codecov
166-
if: ${{ matrix.node_version == '14' }}
167-
browser-tests-experimental:
168-
runs-on: ubuntu-latest
169-
container:
170-
image: circleci/node:16-browsers
171-
env:
172-
NPM_CONFIG_UNSAFE_PERM: true
173-
steps:
174-
- name: Permission Setup
175-
run: sudo chmod -R 777 /github /__w
176-
- name: Checkout
177-
uses: actions/checkout@v2
178-
179-
- name: restore lerna
180-
uses: actions/cache@v3
181-
id: cache
182-
with:
183-
path: |
184-
experimental/node_modules
185-
experimental/*/*/node_modules
186-
key: browser-tests-experimental-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('**/package.json') }}
187-
188-
- name: Bootstrap
189-
if: steps.cache.outputs.cache-hit != 'true'
190-
working-directory: experimental
191-
run: |
192-
npm install --ignore-scripts
193-
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js'
194-
195-
- name: Build 🔧
196-
working-directory: experimental
197-
run: |
198-
npm run compile
199-
# run additional compilation variants
200-
npx lerna run compile
201-
202-
- name: Unit tests
203-
working-directory: experimental
204-
run: npm run test:browser
205-
- name: Report Coverage
206-
working-directory: experimental
207-
run: npm run codecov:browser
208-
webworker-tests-experimental:
209-
runs-on: ubuntu-latest
210-
container:
211-
image: circleci/node:14-browsers
212-
env:
213-
NPM_CONFIG_UNSAFE_PERM: true
214-
steps:
215-
- name: Checkout
216-
uses: actions/checkout@v1
217-
- name: Permission Setup
218-
run: sudo chmod -R 777 /github /__w
219-
220-
- name: restore lerna
221-
uses: actions/cache@v3
222-
id: cache
223-
with:
224-
path: |
225-
experimental/node_modules
226-
experimental/*/*/node_modules
227-
key: browser-tests-experimental-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('**/package.json') }}
109+
node_modules
110+
package-lock.json
111+
packages/*/node_modules
112+
packages/*/package-lock.json
113+
experimental/packages/*/node_modules
114+
experimental/packages/*/package-lock.json
115+
key: webworker-tests-${{ runner.os }}-${{ hashFiles('package.json', 'packages/*/package.json', 'experimental/packages/*/package.json') }}-04142022
228116

229117
- name: Bootstrap
230-
if: steps.cache.outputs.cache-hit != 'true'
231-
working-directory: experimental
232118
run: |
233119
npm install --ignore-scripts
234120
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js'
235121
236122
- name: Build 🔧
237-
working-directory: experimental
238123
run: |
239124
npm run compile
240125
# run additional compilation variants
241126
npx lerna run compile
242127
243128
- name: Unit tests
244-
working-directory: experimental
245129
run: npm run test:webworker
246130
- name: Report Coverage
247-
working-directory: experimental
248131
run: npm run codecov:webworker

CHANGELOG.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@ All notable changes to this project will be documented in this file.
1010

1111
### :bug: (Bug Fix)
1212

13-
* fix: sanitize attributes inputs #2881 @legendecas
13+
* fix: sanitize attributes inputs [#2881](https://github.com/open-telemetry/opentelemetry-js/pull/2881) @legendecas
14+
* fix: support earlier API versions [#2892](https://github.com/open-telemetry/opentelemetry-js/pull/2892) @dyladan
1415

1516
### :books: (Refine Doc)
1617

17-
* docs(sdk): update earliest support node version #2860 @svetlanabrennan
18+
* docs(sdk): update earliest support node version [#2860](https://github.com/open-telemetry/opentelemetry-js/pull/2860) @svetlanabrennan
1819

1920
### :house: (Internal)
2021

21-
* chore: require changelog entry to merge PR #2847 @dyladan
22+
* chore: require changelog entry to merge PR [#2847](https://github.com/open-telemetry/opentelemetry-js/pull/2847) @dyladan
23+
* chore: remove peer API check [#2892](https://github.com/open-telemetry/opentelemetry-js/pull/2892) @dyladan
24+
* chore: merge lerna subdirectories into a single monorepo [#2892](https://github.com/open-telemetry/opentelemetry-js/pull/2892) @dyladan
2225

2326
## 1.1.1
2427

experimental/backwards-compatability/node10/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"description": "Backwards compatability app for node8 types and the OpenTelemetry Node.js SDK",
66
"main": "index.js",
77
"scripts": {
8-
"test:backcompat": "tsc --noEmit index.ts && tsc --noEmit --esModuleInterop index.ts"
8+
"test:backcompat": "tsc --noEmit index.ts && tsc --noEmit --esModuleInterop index.ts",
9+
"peer-api-check": "node ../../../scripts/peer-api-check.js"
910
},
1011
"dependencies": {
1112
"@opentelemetry/sdk-node": "0.27.0",

experimental/backwards-compatability/node10/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"index.ts"
99
],
1010
"references": [
11+
{
12+
"path": "../../../packages/opentelemetry-sdk-trace-base"
13+
},
1114
{
1215
"path": "../../packages/opentelemetry-sdk-node"
1316
}

0 commit comments

Comments
 (0)