From bf316704124b58c5986ac2149fd28973fc1d4560 Mon Sep 17 00:00:00 2001 From: Mert YEREKAPAN <33198490+myerekapan@users.noreply.github.com> Date: Mon, 31 Aug 2026 13:22:56 +0300 Subject: [PATCH] chore(studio): keep useTrackExperimentExposure across experiment gaps (#49765) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Adds a narrow knip suppression so `hooks/misc/useTrackExperimentExposure.ts` isn't flagged as an unused file when no experiment is currently consuming it. ## Why Different from the other files #49719 cleaned up. Those were one-off feature code (specific banners, mutations, table rows) — genuinely dead when their feature was removed. This hook is **shared experiment plumbing**: every A/B experiment plugs into it, and we run experiments frequently. Gaps between experiments are normal. Deleting and re-adding it each cycle: - Churns the codebase for no real cleanup value - Adds review surface to every next experiment PR (has to also add the hook back) - Caused a stacked-merge race today — #49719 deleted it, #49534 reintroduced a usage in `plan-presentation.ts`. Both PRs' CI ran green on their own bases, but merging both broke master's typecheck + Studio deploy. Fixed in #49763. ## What this changes One entry in `knip.jsonc` under `workspaces["apps/studio"].ignoreIssues`: \`\`\`jsonc "hooks/misc/useTrackExperimentExposure.ts": ["files"] \`\`\` `ignoreIssues` (not `ignore`) is the right knob per the config's own guidance — it suppresses only the "unused file" issue for this specific path, while knip still traces the file's imports so anything it depends on stays honestly tracked. ## Test plan - [ ] `pnpm knip --workspace apps/studio` still clean - [ ] With no experiment referencing the hook, knip does not report it --- knip.jsonc | 1 + 1 file changed, 1 insertion(+) diff --git a/knip.jsonc b/knip.jsonc index c1240def9d7..1f537e739fa 100644 --- a/knip.jsonc +++ b/knip.jsonc @@ -72,6 +72,7 @@ // read are documentation of the valid values, not dead code. Scoped to // this file so `enumMembers` keeps working everywhere else. "data/database/constraints-query.ts": ["enumMembers"], + "hooks/misc/useTrackExperimentExposure.ts": ["files"], }, // `vercel` is a globally installed CLI used by the `deploy:staging` script "ignoreBinaries": ["vercel"],