Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(review-hog): let the review-hog flag open the Code review scene (#81736)

Alex Lebedev582be2fa4963
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx
index 17278acf2c81..9b81683ea0c2 100644
--- a/frontend/src/lib/constants.tsx
+++ b/frontend/src/lib/constants.tsx
@@ -478,7 +478,7 @@ export const FEATURE_FLAGS = {
REPLAY_VISION_MODEL_TIER_NAMING_EXPERIMENT: 'replay-vision-model-tier-naming-experiment', // owner: #team-replay multivariate=control,test,lite-standard-pro
REVAMPED_PY_NOTEBOOKS: 'revamped-py-notebooks', // owner: #team-data-tools
REVENUE_FIELDS_IN_POWER_USERS_TABLE: 'revenue-fields-in-power-users-table', // owner: @arthurdedeus #team-customer-analytics
- REVIEW_HOG: 'review-hog', // owner: #team-devex, gates the Code review menu entry
+ REVIEW_HOG: 'review-hog', // owner: #team-devex, gates the Code review menu entry and scene (staff bypass the flag)
SCENE_MENU_BAR: 'scene-menu-bar', // owner: @adamleithp #team-platform-ux, gates the per-scene MenuBar above SceneTitleSection
SCHEMA_ENFORCEMENT_REJECT: 'schema-enforcement-reject', // owner: @aspicer, gates the ability to set schema enforcement mode to "reject"
SCHEMA_MANAGEMENT: 'schema-management', // owner: @aspicer
diff --git a/products/review_hog/DECISIONS.md b/products/review_hog/DECISIONS.md
index 1827c4049085..3c782f5c4ab3 100644
--- a/products/review_hog/DECISIONS.md
+++ b/products/review_hog/DECISIONS.md
@@ -230,7 +230,7 @@ matched `acting_user` only), no way to link to the report (drawer state was kea-
blamed "the author's … ReviewHog settings" for a threshold that wasn't theirs, and the drawer's "Published (N)"
tab claimed publication for findings computed against the _viewer's current_ threshold. Decisions:
-- **Report deep links**: `/code_review?review=<report UUID>`, mirrored both ways by the existing URL sync in
+- **Report deep links**: `/code-review?review=<report UUID>`, mirrored both ways by the existing URL sync in
`reviewHogSettingsLogic` (`replace`, never `push`, so drawer open/close doesn't stack history). The status
comment's held-back sentence links here ("View them in PostHog", auth-gated — same posture as Slack links),
which makes the param a **permanent public contract**. A deep link has no list row, so the drawer renders
@@ -460,11 +460,12 @@ floor and blind-spots/validator are **exactly-one-active with deactivation block
- **Placement (as of 2026-07-13 — standalone scene):** originally shipped as a `'code-review'`
`InboxTabKey` after `'archived'` (staff-gated via `INBOX_STAFF_ONLY_TAB_KEYS`, "Alpha" tag from
- `INBOX_TAB_TAG`). Moved out of the Inbox to its own `CodeReview` scene at `/code_review`, registered
+ `INBOX_TAB_TAG`). Moved out of the Inbox to its own `CodeReview` scene at `/code-review`, registered
by `products/review_hog/manifest.tsx` with an "Unreleased" nav entry (`ProductItemCategory.UNRELEASED`,
- `tags: ['alpha']`). Gating is two-layer by design: `FEATURE_FLAGS.REVIEW_HOG` (`review-hog`) controls
+ `tags: ['alpha']`). Gating was two-layer by design: `FEATURE_FLAGS.REVIEW_HOG` (`review-hog`) controls
**only the menu entry's visibility** (who discovers it); the scene itself stays **staff-only**
- (non-staff get `NotFound`) regardless of the flag. The old inbox tab and `/inbox/code-review` URL are
+ (non-staff get `NotFound`) regardless of the flag. (Superseded 2026-08-12 — the scene now honors the
+ flag too; see the follow-up below.) The old inbox tab and `/inbox/code-review` URL are
gone with no redirect. Body unchanged: hero → pipeline diagram → trigger toggles → urgency slider →
perspectives → blind-spot check → validation criteria → read-only skill drawer; it no longer sits
behind the Inbox onboarding takeover.
@@ -508,8 +509,23 @@ floor and blind-spots/validator are **exactly-one-active with deactivation block
drawer shows the canonical SKILL.md body, threshold click PATCHes and persists (`must_fix` verified in
DB, then reset), blind-spot deactivation blocked with the toast. New workflow tests cover the opt-out
skip, the CLI-override bypass, and threshold threading into body+publish.
-- **Still deferred:** reset-to-canonical (needs the force-re-pull helper in `lazy_seed`); non-staff
- rollout. (The "Review all your Inbox PRs" behavior is **BUILT** — see Stage 6.)
+- **Still deferred:** reset-to-canonical (needs the force-re-pull helper in `lazy_seed`). Non-staff
+ rollout is **BUILT** — see the 2026-08-12 follow-up below. (The "Review all your Inbox PRs" behavior
+ is **BUILT** — see Stage 6.)
+
+#### ✅ BUILT 2026-08-12 — scene access follows the menu flag (staff-only gate relaxed)
+
+The two-layer gating above carried an unstated invariant: the `review-hog` flag's audience had to stay
+within Django-staff users, or people would discover a menu entry they couldn't open. The invariant is
+also unenforceable — `is_staff` is a Django DB column, not a person/group property a flag can target —
+and the flag's real rollout (org-wide internally) broke it: non-staff colleagues saw "Code review"
+under Unreleased and got `NotFound` on click. `CodeReviewScene` now allows
+`FEATURE_FLAGS.REVIEW_HOG` **or** `is_staff`, so the menu entry and the page can no longer disagree,
+and staff keep direct-URL access where the flag is off. Rollout control is now entirely the flag's.
+Nothing changed on the backend: the endpoints were already deliberately self-/team-scoped rather than
+staff-gated, and the UI trigger stays behind the `REVIEWHOG_TEAM_ID` dogfood gate. Before widening the
+flag beyond the internal org, close the QAREPORT note about config endpoints returning skill bodies
+without the `llm_analytics` resource check.
#### ✅ BUILT 2026-07-16 — default urgency threshold flipped to "All issues" (`consider`)
diff --git a/products/review_hog/frontend/CodeReviewScene.tsx b/products/review_hog/frontend/CodeReviewScene.tsx
index 674741258e15..4454b162a71f 100644
--- a/products/review_hog/frontend/CodeReviewScene.tsx
+++ b/products/review_hog/frontend/CodeReviewScene.tsx
@@ -32,11 +32,13 @@ import { Logomark } from 'lib/brand'
import { CopyToClipboardInline } from 'lib/components/CopyToClipboard'
import { NotFound } from 'lib/components/NotFound'
import { TZLabel } from 'lib/components/TZLabel'
+import { FEATURE_FLAGS } from 'lib/constants'
import { IconStamphog } from 'lib/lemon-ui/icons'
import { LemonCard } from 'lib/lemon-ui/LemonCard'
import { LemonCollapse } from 'lib/lemon-ui/LemonCollapse'
import { LemonDrawer } from 'lib/lemon-ui/LemonDrawer'
import { LemonMarkdown } from 'lib/lemon-ui/LemonMarkdown'
+import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { SceneExport } from 'scenes/sceneTypes'
import { urls } from 'scenes/urls'
import { userLogic } from 'scenes/userLogic'
@@ -1574,15 +1576,17 @@ export const scene: SceneExport = {
/**
* The "Code review" scene: ReviewHog's combined onboarding and settings page. One scrollable
* guided-configuration page — every control is live from load, no save step. See
- * `reviewHogSettingsLogic` for the data flow. Staff-only while ReviewHog is an internal alpha;
- * the FEATURE_FLAGS.REVIEW_HOG flag only controls the menu entry's visibility.
+ * `reviewHogSettingsLogic` for the data flow. Access is gated on FEATURE_FLAGS.REVIEW_HOG, the same
+ * flag that shows the menu entry, so whoever discovers the entry can open the page. Staff bypass the
+ * flag, keeping the page reachable by direct URL where the flag is off.
*/
export function CodeReviewScene(): JSX.Element {
const { user } = useValues(userLogic)
+ const { featureFlags } = useValues(featureFlagLogic)
const { blindSpots, validators, initialLoadFailed } = useValues(reviewHogSettingsLogic)
const { selectBlindSpots, selectValidator, loadAll } = useActions(reviewHogSettingsLogic)
- if (user != null && !user.is_staff) {
+ if (user != null && !user.is_staff && !featureFlags[FEATURE_FLAGS.REVIEW_HOG]) {
return <NotFound object="page" />
}