Skip to content

Commit 190ac92

Browse files
authored
ci: pin a fixed telemetry installation ID for CLI e2e jobs (#130)
1 parent c7f1e7c commit 190ac92

9 files changed

Lines changed: 121 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Seed fixed e2e telemetry installation ID
2+
description: >-
3+
Pins a fixed Blocks CLI telemetry installation ID for CI e2e runs so this
4+
traffic is consistent and identifiable (and can be excluded from product
5+
usage metrics). Also suppresses the first-run telemetry consent notice.
6+
POSIX/Linux/macOS only (bash, uses $HOME).
7+
inputs:
8+
installation-id:
9+
description: The fixed telemetry installation ID to seed.
10+
required: false
11+
# Canonical fixed CI e2e telemetry installation ID. Keep in sync with the
12+
# Windows equivalent (BLOCKS_E2E_TELEMETRY_ID in .github/workflows/windows-e2e.yml).
13+
default: '00000000-0000-0000-0000-000000000e2e'
14+
runs:
15+
using: composite
16+
steps:
17+
- name: Seed fixed e2e telemetry installation ID
18+
shell: bash
19+
env:
20+
BLOCKS_E2E_TELEMETRY_ID: ${{ inputs.installation-id }}
21+
run: |
22+
mkdir -p "$HOME/.blocks/telemetry"
23+
printf '%s' "$BLOCKS_E2E_TELEMETRY_ID" > "$HOME/.blocks/telemetry/installation-id"

.github/workflows/canary.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ jobs:
4040
node-version-file: '.nvmrc'
4141
cache: npm
4242

43+
# Pin a fixed Blocks CLI telemetry installation ID for CI e2e runs so this
44+
# traffic is consistent and identifiable (and can be excluded from product
45+
# usage metrics).
46+
- uses: ./.github/actions/seed-telemetry-id
47+
4348
- run: npm ci
4449

4550
- name: Build

.github/workflows/dependency-update.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ jobs:
2424
node-version-file: '.nvmrc'
2525
cache: npm
2626

27+
# Pin a fixed Blocks CLI telemetry installation ID for CI e2e runs so this
28+
# traffic is consistent and identifiable (and can be excluded from product
29+
# usage metrics).
30+
- uses: ./.github/actions/seed-telemetry-id
31+
2732
- run: npm install -g npm-check-updates
2833

2934
- name: Bump root + workspace packages

.github/workflows/e2e-amplify-interop.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ jobs:
5656
node-version-file: '.nvmrc'
5757
cache: npm
5858

59+
# Pin a fixed Blocks CLI telemetry installation ID for CI e2e runs so this
60+
# traffic is consistent and identifiable (and can be excluded from product
61+
# usage metrics).
62+
- uses: ./.github/actions/seed-telemetry-id
63+
5964
- run: npm ci
6065
- run: npm run build
6166

@@ -108,6 +113,11 @@ jobs:
108113
node-version-file: '.nvmrc'
109114
cache: npm
110115

116+
# Pin a fixed Blocks CLI telemetry installation ID for CI e2e runs so this
117+
# traffic is consistent and identifiable (and can be excluded from product
118+
# usage metrics).
119+
- uses: ./.github/actions/seed-telemetry-id
120+
111121
- run: npm ci
112122
- run: npm run build
113123

.github/workflows/native-sdk-e2e.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ jobs:
9999
with:
100100
sdk: '3.11.0'
101101

102+
# Pin a fixed Blocks CLI telemetry installation ID for CI e2e runs so this
103+
# traffic is consistent and identifiable (and can be excluded from product
104+
# usage metrics).
105+
- uses: ./.github/actions/seed-telemetry-id
106+
102107
- run: npm ci
103108
- run: npm run build
104109

@@ -183,6 +188,11 @@ jobs:
183188
node-version-file: '.nvmrc'
184189
cache: npm
185190

191+
# Pin a fixed Blocks CLI telemetry installation ID for CI e2e runs so this
192+
# traffic is consistent and identifiable (and can be excluded from product
193+
# usage metrics).
194+
- uses: ./.github/actions/seed-telemetry-id
195+
186196
- run: npm ci
187197
- run: npm run build
188198

@@ -283,6 +293,11 @@ jobs:
283293
with:
284294
sdk: '3.11.0'
285295

296+
# Pin a fixed Blocks CLI telemetry installation ID for CI e2e runs so this
297+
# traffic is consistent and identifiable (and can be excluded from product
298+
# usage metrics).
299+
- uses: ./.github/actions/seed-telemetry-id
300+
286301
- run: npm ci
287302
- run: npm run build
288303

@@ -410,6 +425,11 @@ jobs:
410425
node-version-file: '.nvmrc'
411426
cache: npm
412427

428+
# Pin a fixed Blocks CLI telemetry installation ID for CI e2e runs so this
429+
# traffic is consistent and identifiable (and can be excluded from product
430+
# usage metrics).
431+
- uses: ./.github/actions/seed-telemetry-id
432+
413433
- run: npm ci
414434
- run: npm run build
415435

.github/workflows/pr-checks.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ jobs:
6969
node-version-file: '.nvmrc'
7070
cache: npm
7171

72+
# Pin a fixed Blocks CLI telemetry installation ID for CI e2e runs so this
73+
# traffic is consistent and identifiable (and can be excluded from product
74+
# usage metrics).
75+
- uses: ./.github/actions/seed-telemetry-id
76+
7277
- run: npm ci
7378

7479
- name: Lint (advisory — annotations only, non-blocking)
@@ -120,6 +125,11 @@ jobs:
120125
node-version-file: '.nvmrc'
121126
cache: npm
122127

128+
# Pin a fixed Blocks CLI telemetry installation ID for CI e2e runs so this
129+
# traffic is consistent and identifiable (and can be excluded from product
130+
# usage metrics).
131+
- uses: ./.github/actions/seed-telemetry-id
132+
123133
- run: npm ci
124134

125135
- name: Download registry artifact
@@ -152,6 +162,11 @@ jobs:
152162
node-version-file: '.nvmrc'
153163
cache: npm
154164

165+
# Pin a fixed Blocks CLI telemetry installation ID for CI e2e runs so this
166+
# traffic is consistent and identifiable (and can be excluded from product
167+
# usage metrics).
168+
- uses: ./.github/actions/seed-telemetry-id
169+
155170
- run: npm ci
156171
- run: npm run build
157172

@@ -185,6 +200,11 @@ jobs:
185200
node-version-file: '.nvmrc'
186201
cache: npm
187202

203+
# Pin a fixed Blocks CLI telemetry installation ID for CI e2e runs so this
204+
# traffic is consistent and identifiable (and can be excluded from product
205+
# usage metrics).
206+
- uses: ./.github/actions/seed-telemetry-id
207+
188208
- run: npm ci
189209
- run: npm run build
190210

@@ -218,6 +238,11 @@ jobs:
218238
node-version-file: '.nvmrc'
219239
cache: npm
220240

241+
# Pin a fixed Blocks CLI telemetry installation ID for CI e2e runs so this
242+
# traffic is consistent and identifiable (and can be excluded from product
243+
# usage metrics).
244+
- uses: ./.github/actions/seed-telemetry-id
245+
221246
- run: npm ci
222247
- run: npm run build
223248

@@ -257,6 +282,11 @@ jobs:
257282
node-version-file: '.nvmrc'
258283
cache: npm
259284

285+
# Pin a fixed Blocks CLI telemetry installation ID for CI e2e runs so this
286+
# traffic is consistent and identifiable (and can be excluded from product
287+
# usage metrics).
288+
- uses: ./.github/actions/seed-telemetry-id
289+
260290
- run: npm ci
261291
- run: npm run build
262292

@@ -339,6 +369,11 @@ jobs:
339369
node-version-file: '.nvmrc'
340370
cache: npm
341371

372+
# Pin a fixed Blocks CLI telemetry installation ID for CI e2e runs so this
373+
# traffic is consistent and identifiable (and can be excluded from product
374+
# usage metrics).
375+
- uses: ./.github/actions/seed-telemetry-id
376+
342377
- run: npm ci
343378
- run: npm run build
344379

.github/workflows/publish-canary.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ jobs:
2626
node-version-file: '.nvmrc'
2727
cache: npm
2828

29+
# Pin a fixed Blocks CLI telemetry installation ID for CI e2e runs so this
30+
# traffic is consistent and identifiable (and can be excluded from product
31+
# usage metrics).
32+
- uses: ./.github/actions/seed-telemetry-id
33+
2934
- run: npm ci
3035

3136
- name: Build

.github/workflows/publish-packages.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ jobs:
3838
cache: npm
3939
registry-url: 'https://registry.npmjs.org'
4040

41+
# Pin a fixed Blocks CLI telemetry installation ID for CI e2e runs so this
42+
# traffic is consistent and identifiable (and can be excluded from product
43+
# usage metrics).
44+
- uses: ./.github/actions/seed-telemetry-id
45+
4146
- run: npm ci
4247

4348
# ── Version bump ──────────────────────────────────────────

.github/workflows/windows-e2e.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ jobs:
2929
# Unique per run so a cancelled run can't collide with the next.
3030
BLOCKS_STACK_SUFFIX: w${{ github.run_number }}
3131
E2E_FROM_EMAIL: ${{ secrets.E2E_FROM_EMAIL }}
32+
# Canonical fixed CI e2e telemetry installation ID. Keep in sync with the
33+
# POSIX equivalent (the `installation-id` default in
34+
# .github/actions/seed-telemetry-id/action.yml).
35+
BLOCKS_E2E_TELEMETRY_ID: '00000000-0000-0000-0000-000000000e2e'
3236
steps:
3337
- uses: actions/checkout@v5
3438
with:
@@ -39,6 +43,15 @@ jobs:
3943
node-version-file: '.nvmrc'
4044
cache: npm
4145

46+
# Pin a fixed Blocks CLI telemetry installation ID for CI e2e runs so this
47+
# traffic is consistent and identifiable (and can be excluded from product
48+
# usage metrics).
49+
- name: Seed fixed e2e telemetry installation ID
50+
shell: pwsh
51+
run: |
52+
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.blocks\telemetry" | Out-Null
53+
Set-Content -NoNewline -Path "$env:USERPROFILE\.blocks\telemetry\installation-id" -Value "$env:BLOCKS_E2E_TELEMETRY_ID"
54+
4255
- run: npm ci
4356
- run: npm run build
4457

0 commit comments

Comments
 (0)