Skip to content

React Compiler lint error in webhooks.tsx blocks all PRs on main #17065

Description

@jhadvig

Description

PR #17032 (CONSOLE-5463: Turn on react compiler linting rules) was merged on 2026-08-19 and enabled the react-hooks/set-state-in-effect ESLint rule. This introduced a lint error in frontend/public/components/utils/webhooks.tsx:87 that was not fixed as part of that PR.

This error causes the ci/prow/frontend job to fail for all PRs targeting main, since the frontend CI lints the entire codebase.

Error

frontend/public/components/utils/webhooks.tsx
  Line 87:  Avoid calling setState() directly within an effect  react-hooks/set-state-in-effect

The offending code calls setSecretNames(newSecretNames) inside a useEffect (lines 79-88). The state is derived from webhookTriggers and should be computed during render via useMemo instead of set in an effect.

Impact

All open PRs on main are blocked by this lint error, regardless of what files they change. Example: PR #17041 (OCPBUGS-72592) fails frontend CI despite only modifying Helm plugin files.

Fix

Replace the useEffect + setSecretNames pattern with a useMemo:

// Before (effect-based, triggers lint error):
useEffect(() => {
  const newSecretNames = /* derive from webhookTriggers */;
  setSecretNames(newSecretNames);
}, [webhookTriggers]);

// After (computed during render):
const secretNames = useMemo(() => {
  return /* derive from webhookTriggers */;
}, [webhookTriggers]);

Introduced by

Blocked PRs (examples)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions