Repository navigation
feat(core)!: follow CDK's telemetry opt-out and remove the AWS Blocks one - #1606
Open
VarshithaPamisetty wants to merge 1 commit into
Open
VarshithaPamisetty wants to merge 1 commit into
VarshithaPamisetty wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 84c2f6c The changes in this PR will be included in the next version bump. This PR includes changesets to release 24 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 03:35 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 03:35 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 03:35 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 03:35 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 03:35 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 03:35 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 03:35 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 03:35 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 03:35 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 03:35 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 03:35 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 03:35 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 03:35 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 03:35 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 03:35 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 03:35 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 03:35 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 03:35 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 03:37 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 03:37 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 03:37 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 03:37 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 03:37 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 03:37 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 03:37 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 03:37 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 03:37 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 03:37 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 04:11 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 11:05 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 11:05 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 11:05 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 11:05 — with
GitHub Actions
Inactive
VarshithaPamisetty
had a problem deploying
to
e2e
November 18, 2026 11:05 — with
GitHub Actions
Error
VarshithaPamisetty
temporarily deployed
to
e2e
November 18, 2026 11:05 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 11:07 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 11:07 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 11:07 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 11:07 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 11:07 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 11:07 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 11:07 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 11:07 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 11:07 — with
GitHub Actions
Inactive
VarshithaPamisetty
temporarily deployed
to
agent-bench
November 18, 2026 11:07 — with
GitHub Actions
Inactive
VarshithaPamisetty
force-pushed
the
fix/cdk-telemetry-merge
branch
6 times, most recently
from
November 18, 2026 11:57
3231b82 to
96d0965
Compare
cadivus
reviewed
Nov 18, 2026
cadivus
previously approved these changes
Nov 18, 2026
cadivus
previously approved these changes
Nov 18, 2026
cadivus
reviewed
Nov 19, 2026
… one Blocks telemetry had its own opt-out alongside CDK's, so a user had two switches to find and set, and opting out of CDK CLI telemetry left Blocks telemetry on. The wiring only ever ran one way: when Blocks telemetry was off the lifecycle commands passed CDK_DISABLE_CLI_TELEMETRY=1 to the cdk child, so Blocks off disabled CDK, never the reverse. CDK's setting is now the only one. Blocks honours CDK's opt-out by mirroring the CDK CLI rather than reinterpreting it: CDK_DISABLE_CLI_TELEMETRY set to `1` or `true`, and the `cli-telemetry` context key resolving to `false`, which `cdk cli-telemetry --disable` records in the app's cdk.context.json and which can also be set in the `context` of cdk.json or ~/.cdk.json. The environment match is case-sensitive and untrimmed, so `TRUE` and `yes` are not CDK's opt-out and therefore not ours, and across the context files the first one that sets the key wins, so an enable in cdk.json shadows a disable in cdk.context.json, in CDK's documented order of precedence. Verified empirically: 13 of 13 on-disk setups agree with `cdk cli-telemetry --status` on aws-cdk 2.1146.0. The settings are read from disk, not by running the CDK CLI, because most Blocks commands never start one. BREAKING CHANGE: the Blocks opt-out is removed. AWS_BLOCKS_DISABLE_TELEMETRY, the `cdk-blocks telemetry` command, the `blocks-telemetry` binary and the `telemetry.enabled` key in .blocks/config.json are gone, with no fallback and no migration, so a preview user who opted out that way is opted back in until they opt out through CDK. The telemetry.projectId key in the same file stays: it is an identifier rather than a consent setting, and identifiers are out of scope here. CDK_BLOCKS_DISABLE_TEMPLATE_METADATA is unchanged and still governs the AWSToolsMetrics template entry. It keeps the lax 1/true/yes matching, so the helper that reads it moved next to it in cdk/stack-metadata.ts and is tested there against the same shared case table. --telemetry-file is unchanged, and still writes nothing when you are opted out. The README telemetry section and the first-run notice now describe CDK's switch and link to its opt-out documentation. The notice stays pinned byte-identical between core and create-blocks-app, which carries the same resolution so the scaffolder and the CLI agree. --no-version-reporting is deliberately not included. It is the one CDK path with nothing to read: it is taken from the parsed command-line arguments, so `versionReporting: false` in cdk.json or ~/.cdk.json leaves `cdk cli-telemetry --status` reporting enabled while the flag reports disabled. It exists only for the invocation that carries it, cdk-blocks has no such flag, and honouring it would mean either adding one or reading a setting CDK itself ignores for telemetry.
This branch is being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
AWS Blocks telemetry had its own opt-out alongside CDK's, so a user had two switches to find and set, and opting out of CDK CLI telemetry left Blocks telemetry on. The wiring only ever ran one way: when Blocks telemetry was off the lifecycle commands passed
CDK_DISABLE_CLI_TELEMETRY=1to the cdk child, so Blocks off disabled CDK, never the reverse.This makes CDK's setting the only one. Consent is read from disk rather than by asking the CDK CLI, because most Blocks commands never start one.
Changes
CDK_DISABLE_CLI_TELEMETRYset to1ortrue, and thecli-telemetrycontext key resolving tofalse, whichcdk cli-telemetry --disablerecords in the app'scdk.context.jsonand which can also be set in thecontextofcdk.jsonor~/.cdk.json. The environment match is case-sensitive and untrimmed, soTRUEandyesare not CDK's opt-out and therefore not ours, and across the context files the first one that sets the key wins, so an enable incdk.jsonshadows a disable incdk.context.json, in CDK's documented order of precedence.AWS_BLOCKS_DISABLE_TELEMETRY, thecdk-blocks telemetrycommand, theblocks-telemetrybinary and thetelemetry.enabledkey in.blocks/config.jsonare gone, with no fallback and no migration, so a preview user who opted out that way is opted back in until they opt out through CDK. The changeset says so plainly and ships atminor, the pre-1.0 breaking channel. Thetelemetry.projectIdkey in the same file stays, because it is an identifier rather than a consent setting and identifiers are out of scope here.CDK_BLOCKS_DISABLE_TEMPLATE_METADATAis unchanged and still governs theAWSToolsMetricstemplate entry. It keeps the lax1/true/yesmatching, so the helper that reads it moved next to it and is now tested there against the same shared case table.--telemetry-fileis unchanged, and still writes nothing when you are opted out.telemetryapp task goes with the command: the script is removed from the 13 templates that shipped it, from the task listcreate-blocks-appwrites, and frommigrate's task map and renamed-alias set, so a scaffolded or migrated app no longer gets a task that resolves to nothing. Folded in from feat(blocks,create-blocks-app)!: remove the telemetry app task #1633, which is closed, so the command and the task that invoked it land together.package-lock.jsonloses an orphaned@aws-blocks/core@0.3.0node underpackages/bb-dashboard/node_modules/@aws-blocks/bb-lambda-compute/, which was the last thing in the lockfile naming the removedblocks-telemetrybin. Its parent node does not exist andbb-dashboarddepends only oncore@^0.8.0, so nothing resolved through it.create-blocks-app, which carries the same resolution so the scaffolder and the CLI agree. The telemetry test app's README and the canary workflow comment were updated to match, and an orphaned e2e test that symlinked the deleted binary and asserted the removed config key is deleted rather than left to rot. The admin dashboard's list of shipped binaries dropsblocks-telemetry, and the unreleased changesets that described the removed opt-out are trimmed so one release does not both introduce and remove it.readCdkTelemetryContextandresolveDeploymentTargetnow cross-reference each other, because both walk CDK's three context bags in CDK's order.isTelemetryEnabled()now takes an optionalprojectRoot, threaded through both consent gates (trackCommand's early return and the re-check insidebuildAndSendEvent), and throughgetCdkTelemetryEnv,getFrameworkSinkEnvandcreateFrameworkSink. Theblocks-vendorizebin passes its discovered root, because it never chdirs to the project root and would otherwise resolve CDK's context from the shell's directory and miss the project's own opt-out; the production deploy passes the root it already deploys with.create-blocks-appkeeps the no-argument form and resolves context from its own working directory, which is where a project's config sits when the scaffolder is run inside an existing CDK project.Note on
--no-version-reporting, which is not included. It is one of the four ways CDK's own check can refuse telemetry, but it is the only one with nothing to read: verified fromcanCollectTelemetry, it is taken from the parsed command-line arguments, and verified by running the CLI,versionReporting: falseincdk.jsonor~/.cdk.jsonleavescdk cli-telemetry --statusreporting enabled while the--no-version-reportingflag reports disabled. So it exists only for the invocation that carries it,cdk-blockshas no such flag, and honouring it would mean either adding one or reading a setting CDK itself ignores for telemetry. Flagged rather than guessed at.Note on
docs/DECISIONS.md. D-010's preserved body tells a reader to combine--telemetry-filewithAWS_BLOCKS_DISABLE_TELEMETRYto capture events without sending them. D-018 already superseded that clause, and this removal takes the variable away, so this PR appends aStatusamendment line to D-010 in the form its two existing amendments use: it records that the variable no longer exists and that redirectingBLOCKS_TELEMETRY_ENDPOINTcaptures to the file without reaching the collector. The preserved body is left as written, which is how every other amended decision in that file reads.Testing
'true' !== 'false', while every negative control held. On this head that file is 36 of 36. The removal is covered the same way, by the suites that asserted the old behaviour being converted to CDK's files rather than deleted: the--telemetry-filesink, the mid-run opt-out and the identifier-persistence cases now writecdk.context.jsonor~/.cdk.json.cdk cli-telemetry --statuson aws-cdk 2.1146.0, including the shadowing row, the two values CDK does not act on, and the documented but non-working top-level form, which reports enabled on both sides.--telemetry-file, positive control first so an absent file proves something: the dev server emits an event with no opt-out set, emits none under each ofCDK_DISABLE_CLI_TELEMETRY=1,=true, acdk.jsoncontext opt-out,cdk.context.jsonand~/.cdk.json, still emits under=yesbecause CDK does not act on it, and now also emits underAWS_BLOCKS_DISABLE_TELEMETRY=1, which is the removal working. 8 of 8.npm run build0 errors,npm run lint,npm run lint:deps,npm run check:apiwith no report drift,npm run check:imports,sync-docs:check,check:exports-consistency,check:client-user-agent,check:packed-assets,check:runtime-guard, and the four changeset guards.packages/coreis 3205 tests, 0 failures.npm installleaves the lockfile unchanged andnpm ci --dry-runexits 0.Checklist
@aws-blocks/blocksREADME telemetry section and the first-run notice