chore(error-tracking): drop 7 orphaned feature flag constants#60222
Conversation
|
🎭 Playwright didn't run on this PR — your changes touch code that could affect E2E behavior, but Playwright is opt-in via label now to keep CI cost down. Add the Most PRs don't need this. Real regressions still get caught on master and fix-forward. |
|
Size Change: 0 B Total Size: 80.2 MB ℹ️ View Unchanged
|
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
frontend/src/lib/constants.tsx:278-279
`ERROR_TRACKING_ISSUE_CORRELATION` is removed here but is still actively referenced in `frontend/src/scenes/max/max-constants.tsx` line 625: `flag: FEATURE_FLAGS.ERROR_TRACKING_ISSUE_CORRELATION`. This will produce a TypeScript compile error (accessing a property that no longer exists on the `FEATURE_FLAGS` object), and at runtime the Max AI tool `find_error_tracking_impactful_issue_event_list` would have its feature-flag guard silently broken. The PR description acknowledges this constant must be kept, but the actual diff does not include the restoration.
```suggestion
ERROR_TRACKING_FORCE_QUERY_V3: 'error-tracking-force-query-v3', // owner: #team-error-tracking
ERROR_TRACKING_ISSUE_CORRELATION: 'error-tracking-issue-correlation', // owner: @david #team-error-tracking
ERROR_TRACKING_ISSUE_SPLITTING: 'error-tracking-issue-splitting', // owner: @david #team-error-tracking
```
Reviews (1): Last reviewed commit: "chore(error-tracking): drop 8 orphaned f..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3374eec3bc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
These FEATURE_FLAGS entries have no remaining references anywhere in the codebase (frontend or backend). This removes the dead constants only; the underlying PostHog feature flags are left untouched. Dropped: - ERROR_TRACKING_ALERT_ROUTING - ERROR_TRACKING_ALERTS_WIZARD - ERROR_TRACKING_FORCE_QUERY_V2 (no corresponding flag exists in PostHog) - ERROR_TRACKING_INGESTION_CONTROLS - ERROR_TRACKING_JIRA_INTEGRATION - ERROR_TRACKING_REVENUE_SORTING - ERROR_TRACKING_SETTINGS_SPLIT Kept: ERROR_TRACKING_QUERY_V2 (per request) and ERROR_TRACKING_ISSUE_CORRELATION (still used in frontend/src/scenes/max/max-constants.tsx).
524cb7e to
ccbcd19
Compare
Problem
frontend/src/lib/constants.tsxaccumulated several error-trackingFEATURE_FLAGSentries whose features are fully released. Seven of them no longer have a single reference anywhere in the repo (frontend or backend), so the constants are dead weight and make the flag list harder to reason about.This follows the same cleanup already underway in the team's other flag-removal PRs (e.g.
error-tracking-insights,error-tracking-spike-alerting).Changes
Removed 7 orphaned constants from
FEATURE_FLAGS. Each was confirmed to have zero references outsideconstants.tsxvia a fixed-string search across the whole repo:ERROR_TRACKING_ALERT_ROUTINGerror-tracking-alert-routingERROR_TRACKING_ALERTS_WIZARDerror-tracking-alerts-wizardERROR_TRACKING_FORCE_QUERY_V2error-tracking-force-query-v2ERROR_TRACKING_INGESTION_CONTROLSerror-tracking-ingestion-controlsERROR_TRACKING_JIRA_INTEGRATIONerror-tracking-jira-integrationERROR_TRACKING_REVENUE_SORTINGerror-tracking-revenue-sortingERROR_TRACKING_SETTINGS_SPLITerror-tracking-settings-splitThis is a code-only change — it removes the unused TypeScript constants. The underlying PostHog feature flags are intentionally left in place and unchanged; cleaning those up (delete/disable) is a separate decision for the flag owners.
Kept:
ERROR_TRACKING_QUERY_V2— explicitly out of scope for this cleanup.ERROR_TRACKING_ISSUE_CORRELATION— still referenced infrontend/src/scenes/max/max-constants.tsx(a Max AI tool definition), so it is not orphaned.The
error-tracking-query-v3/error-tracking-force-query-v3flags and every other still-referenced error-tracking flag are unaffected.How did you test this code?
I'm an agent (Claude Code). No manual/UI testing was performed. Automated checks I actually ran against the worktree:
oxfmt --checkandoxlintonconstants.tsx→ clean (0/0).git grepfor every dropped constant and its flag-key string across*.ts/*.tsx/*.py/*.rs/*.go→ no references outsideconstants.tsx. (The loneerror-tracking-ingestion-controlsstring infrontend/src/scenes/settings/types.tsis an unrelated settings-section slug, not a flag lookup.)pnpm install+kea-typegen write+tsc --noEmit→ no type errors reference the removed constants orconstants.tsx. (The worktree surfaced unrelated errors from the@posthog/quillworkspace package not being linked in the isolated checkout; those are environmental and untouched by this change.)Publish to changelog?
no
Docs update
No docs change needed.
🤖 Agent context
Authored by Claude Code at the request of the human PR owner.
gh, localoxfmt/oxlint/tsc/kea-typegen); PostHog MCP (feature-flag-get-all,feature-flag-get-definition,feature-flags-status-retrieve) to verify each flag's rollout/state read-only against the production project. No changes were made through the MCP.masterfor everyERROR_TRACKING_*constant to find ones with no remaining code references.git grep -E "\b…\b"pattern; POSIXgrep -Edoes not honor\b, so references that used the constant (not the raw flag string) were missed andERROR_TRACKING_ISSUE_CORRELATIONwas wrongly flagged as orphaned and removed. This was caught by the typecheck, re-verified with a fixed-string search, and the constant was restored. The final set of 7 was re-confirmed with fixed-string matching.ERROR_TRACKING_FORCE_QUERY_V2is included because it has neither code references nor a corresponding PostHog flag.