Repository navigation
feat(blocks,create-blocks-app)!: remove the telemetry app task - #1633
VarshithaPamisetty wants to merge 1 commit into
Conversation
#1606 removes the `telemetry` command, the `blocks-telemetry` binary and `AWS_BLOCKS_DISABLE_TELEMETRY`, so telemetry follows CDK's opt-out only. #1610 landed a `telemetry` package script in every template that has one, which would leave a newly scaffolded app running a command that is gone. Remove the task everywhere it is written, documented or asserted: - the `"telemetry"` script in 13 of the 14 create-blocks-app templates (`amplify` is an overlay and defines no `scripts`, so it never had it) - the task list the Amplify integration writes into a scaffolded `package.json` (`create-blocks-app/src/index.ts`) - `USER_TASKS` in `blocks/src/cli/commands/migrate.ts`, so `npm run migrate` stops adding the script - the example scaffolded `package.json` in the create-blocks-app README - the two committed example apps that carry the script, `native/kotlin`'s TypeScript example and `native/swift`'s TypeScript demo Tests follow: the scaffolded task map in `create-blocks-app/src/cli.test.ts`, migrate's rewritten-scripts assertions in `blocks/src/cli/migrate.test.ts`, and the runnable-task list in `blocks/src/cli/help.test.ts`. Migrate only stops adding the script. An app already scaffolded with it keeps it; removing a stale script from an existing app is deliberately not in scope. Also splits one statement in `create-blocks-app/src/index.ts`, from `const hostScripts = pkg.scripts ??= {}` to the assignment and the binding on separate lines. `npm run lint` is `biome lint --changed --since=origin/main`, so editing this file brings it into scope and its pre-existing `lint/suspicious/noAssignInExpressions` error fails the run. Behaviour is unchanged: `??=` evaluates to the final value of its target, so `hostScripts` binds the same object either way, for an absent, undefined, null or populated `scripts`. No changeset, as nothing observable changes. Merge order: this depends on #1606 and must merge after it. `help.test.ts` compares root help against that runnable list, and root help is built from the command registry, which still carries `telemetry` until #1606 removes it. So that one assertion fails on today's main and passes once #1606 lands.
🦋 Changeset detectedLatest commit: 46a2082 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 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 |
|
Folded into #1606. Every change from this PR now lives in that one commit, so the removal of the Verified before closing: 21 of the 22 files here are byte-identical in #1606, and the 22nd ( Keeping the branch |
📖 Glossary & notes — scoring, indicators, per-metric thresholds (click to expand)
Results — PR vs
|
| Task | Template | Tests | Judge | Cost | Turns | Score | Stop reason |
|---|---|---|---|---|---|---|---|
| async-word-counter | bare | ✅ 13/13 (0) | ✅ $4.19 (-$0.23) | ✅ 20 (-3) | ✅ 22.7 (+0.6) | endTurn | |
| auth-notes | demo | ✅ 11/11 (0) | ✨ 9 (+0.8) | ❌ $19.85 (+$4.03) | ✅ 45 (+3) | ✅ 4.8 (-1.1) | endTurn |
| cognito-profile | auth | ✅ 10/10 (0) | ❌ 8 (-1.2) | ✨ $21.09 (-$8.67) | ✨ 58 (-16) | ✅ 4.4 (+1.1) | endTurn |
| collab-presence-board | default | ✅ 11/11 (0) | ✅ $3.17 (+$0.28) | ✅ 16 (+2) | ✅ 30 (-3.7) | endTurn | |
| email-digest | demo | ✅ 12/12 (0) | ✅ 9.4 (0) | ❌ $6.51 (+$1.58) | ❌ 26 (+8) | ✅ 15 (-4.8) | endTurn |
| file-gallery | bare | ✅ 12/12 (0) | ✅ 9.6 (+0.2) | ✨ $2.44 (-$0.4) | ✅ 12 (-1) | ✨ 40.4 (+6) | endTurn |
| kb-chat-agent | demo | ✅ 9/9 (0) | ✨ 9.6 (+0.6) | ❌ 63 (+11) | ✅ 3.3 (-0.5) | endTurn | |
| observability-api | backend | ✅ 18/18 (0) | ❌ 8.8 (-0.8) | ✨ $9.01 (-$2.35) | ✅ 48 (+1) | ✅ 10.6 (+1.9) | endTurn |
| oidc-dsql-notes | react | ✅ 11/11 (0) | ❌ $51.32 (+$13.32) | ❌ 95 (+18) | ✅ 1.9 (-0.6) | endTurn | |
| sql-kb-catalog | nextjs | ✅ 9/9 (0) | ✅ 8.8 (-0.2) | ❌ $11.43 (+$3.2) | ✅ 38 (+2) | ✅ 8.3 (-3.4) | endTurn |
Merge verdict
✅ This bench run does not block the PR.
- ✅ Absolute floor — mean composite 95.8 >= floor 65.
- ✅ Regression vs
main— mean composite delta -0.9 pts vs main is within the 10-pt limit.
The Δ vs base ball above is a fixed ±5-pt display band; the regression gate uses BENCH_MAX_REGRESSION. The ball is cosmetic — the gate threshold is what blocks.
Why
#1606 removes the
telemetrycommand, theblocks-telemetrybinary andAWS_BLOCKS_DISABLE_TELEMETRY, so Blocks telemetry follows CDK's opt-out only (CDK_DISABLE_CLI_TELEMETRY,cdk cli-telemetry --disable, orcli-telemetry: falsein thecontextofcdk.jsonor~/.cdk.json).#1610 wired a
telemetrypackage script into every template that has ascriptsblock. Once #1606 merges, a newly scaffolded app would shipnpm run telemetrypointing at a command that no longer exists, andnpm run migratewould keep adding it to apps being upgraded.This removes the task.
Merge order: depends on #1606
This must merge after #1606. One assertion fails on today's
mainand passes once #1606 lands:help.test.ts'slists every runnable task once under its package script namecompares root help against a hard-coded runnable list, andhelp.tsbuilds root help from the command registry, which still carriestelemetryuntil #1606 removes it fromregistry.ts.For whoever merges: hold this PR until #1606 is in, then confirm
help.test.tsgoes green — or land the two behind a single merge somainis never red. The diff itself needs no change for this.Mutation-checked both directions, so the assertion still guards the registry/task-list contract:
'telemetry'removed from the list → fails (what CI will show here until feat(core)!: follow CDK's telemetry opt-out and remove the AWS Blocks one #1606 merges)What changed — 22 sites
"telemetry"script in 13 of 14create-blocks-apptemplates.amplifyis an overlay (blocksTemplateOverlayOnly) and defines noscripts, so it never had itcreate-blocks-app/src/index.ts— the task list the Amplify integration writes into a scaffoldedpackage.jsonblocks/src/cli/commands/migrate.tsUSER_TASKS—npm run migratestops adding the scriptcreate-blocks-app/README.md— the example scaffoldedpackage.jsonno longer lists the task (AGENTS.md rule 11)native/kotlin/example/typescriptandnative/swift/Demo/typescript-demo, the two committed apps carrying the scriptcreate-blocks-app/src/cli.test.ts(scaffolded task map),blocks/src/cli/migrate.test.ts(rewritten-scripts assertions),blocks/src/cli/help.test.ts(runnable list)packages/blocks/README.mdis deliberately untouched — #1606 already removes itsnpm run telemetryandAWS_BLOCKS_DISABLE_TELEMETRYreferences (0 occurrences of each at6cbdc1069).packages/blocks/docs/README.mdis not a 23rd site: it is untracked build output (git ls-filesdoes not know it), produced byscripts/gen-block-docs.mjs, whose line 49copyMarkdown(blocksDir, outDir)mirrors every root-level*.mdofpackages/blocksintopackages/blocks/docs/verbatim. So it is downstream ofpackages/blocks/README.md, i.e. of #1606, and no generator readscreate-blocks-app/README.mdat all. (scripts/sync-catalog.mjsonly maintains the catalog table between theBEGIN:block-catalog/END:block-catalogmarkers insidepackages/blocks/README.md; it does not producedocs/.)Confirmed by simulating the merged state rather than waiting for it: with #1606's
packages/blocks/README.mdapplied on top of this branch,node scripts/gen-block-docs.mjs(exit 0, 21 block docs) leaves 0 matches fornpm run telemetry,"telemetry":or-- telemetryanywhere underpackages/blocks/docs/. Branch state restored afterwards; tree clean at46a2082e0.Incidental fix forced by the lint scope
npm run lintisbiome lint --changed --since=origin/main. Editingcreate-blocks-app/src/index.tsbrings the whole file into scope, which exposes a pre-existinglint/suspicious/noAssignInExpressionserror at line 469, unrelated to this change. It fails the run, so it is fixed here:No changeset: behaviour is identical, verified rather than assumed. The emitted
dist/index.jsdiffers only in that statement split, and both forms were run againstscriptsabsent,undefined,nulland populated — same resultingpkg, same bound value, andhostScriptsaliasespkg.scriptsin both, since??=evaluates to the final value of its target.Changeset
.changeset/remove-telemetry-task.md,minorfor@aws-blocks/blocksand@aws-blocks/create-blocks-app— the two changed published packages, which.changeset/config.jsonalso keeps in afixedgroup. Breaking, and this repo is pre-1.0, so breaking goes in theminorchannel, matching #1610's and #1606's own changesets. The twonative/example apps are absent from the rootworkspacesarray, so changesets does not track them.npx changeset status --since=origin/main→ exit 0, bumps both packagesminor.Verification
npm run buildnpm run lintnpm run lint:depsgit diff HEAD origin/main --stat -- package-lock.jsonnpm run test:templatesnode --test dist/cli/*.test.jsnpm testScaffold and migrate were exercised end to end: scaffolded the
defaulttemplate, deleted six tasks, ranmigrate --force --output json→ exit 0, re-added exactlydocs docs:search docs:api db whoami migrate, notelemetry, zero occurrences in the resultingpackage.json.test:templatesalso runsmigrate --forceand--dry-runagainst a real installed app.Known failures not addressed
create-blocks-appcli.test.tsrefuses to scaffold into an npm workspace that does not list the app's aws-blocks/ folder— pre-existing, A/B verified: fails identically with these changes stashed.packages/blocksconditional-exports.test.js—ENOENT packages/bb-data/package.json;bb-datais gone from the tree while the rootpackage.jsonstill lists it. Broken onmainalready.The templates e2e was run with each scaffolded app's
blocks.dev.portmoved off the default, because this machine has 3001 occupied. No env var controls it: the port is read from the scaffolded app'spackage.json#blocks.dev.portby bothnpm run devand the template'stest/e2e.test.ts.Migrate leaves existing apps alone, by contract
npm run migrateonly stops adding the task; it does not strip atelemetryscript from an app already scaffolded with one. That is not a new choice, it is what migrate's documented contract already requires:blocks/src/cli/commands/migrate.tsheader: apackage.jsonscript "is rewritten only when its value is exactly the command a template generated", and "Every other script stays as it is". Only a generated wrapper file is deleted, once nothing references it; a customized one "migrate never deletes".blocks/src/cli/registry.tsformigrate: generated commands "are rewritten; missing framework tasks are added without overwriting custom scripts".The changeset states the resulting behaviour: "An existing app keeps the script it was scaffolded with;
npm run migratedoes not remove it."