Commit 104cad6
Check Run Settings UI + Opt-In Gate (ENG-3422) (#4508)
<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
## Summary
Implements the Check Run Settings UI and opt-in gate for GitHub App
check runs, as specified in ENG-3422. Check runs are now disabled by
default and require explicit customer opt-in via the settings page.
## Changes
### Proto (`sdp/config.proto`)
- Added `bool check_runs_enabled = 5` to `SignalConfig` (defaults to
`false`)
- Added `optional bool can_create_checks = 14` to `GithubAppInformation`
- Regenerated Go and TypeScript proto code
### Backend — Opt-In Gate (`changesservice.go`)
- `checkGithubAppCanCreateChecks` now loads `SignalConfig` from the DB
and short-circuits before any GitHub API calls when `check_runs_enabled`
is `false`
- `getSignalConfigForChangeAnalysis` merges `check_runs_enabled` from
the DB config
### Backend — Permission Exposure (`configservice.go`)
- `GetGithubAppInformation` now calls `CheckInstallationCanCreateChecks`
and exposes `can_create_checks` on the response
- Error from the permission check is logged at Warn level (not silently
discarded)
- `GetSignalConfig` fallback path merges `check_runs_enabled` and
`check_run_mode` from partial DB rows alongside preset defaults
### Backend Tests
- `TestCheckGithubAppCanCreateChecks_OptInGate`: 3 test cases (no
installation, disabled, enabled)
- `TestSignalConfig/fallback_path_preserves_check_run_fields`: validates
fallback merge
### Frontend — CheckRunSettings Component
Three visual states:
- **No permission**: Permission prompt when `checks:write` not granted,
with link to GitHub App installation settings
- **Disabled**: Toggle off with description
- **Enabled**: Toggle on with RadioGroup mode selector (Report only /
Fail on high-severity / Fail on any risk)
Uses optimistic cache updates via `queryClient.setQueryData` on mutation
success.
### Frontend — Mocks & Stories
- `getGithubAppInformationWithChecksMock` /
`getGithubAppInformationNoChecksMock`
- `getSignalConfigCheckRunsEnabledMock`
- Three Ladle stories: `GitHubCheckRunsNoPermission`,
`GitHubCheckRunsDisabled`, `GitHubCheckRunsEnabled`
### Documentation
- PRD revision entry for opt-in gate delivery
- ADR `adr-checkrun-opt-in` (0024): documents the explicit opt-in
decision
- Updated `CURRENT_STATE.md` and customer-facing docs
## UI Screenshots
**Disabled state** — Toggle off, no mode selector visible:
[Check Runs
Disabled](https://cursor.com/agents/bc-82fc8433-3e64-4f9f-a012-273e9123f28c/artifacts?path=%2Fopt%2Fcursor%2Fartifacts%2Fscreenshot_check_runs_disabled.png)
**Enabled state** — Toggle on with conclusion mode selector:
[Check Runs
Enabled](https://cursor.com/agents/bc-82fc8433-3e64-4f9f-a012-273e9123f28c/artifacts?path=%2Fopt%2Fcursor%2Fartifacts%2Fscreenshot_check_runs_enabled.png)
**No permission state** — Permission prompt with action link:
[Check Runs No Permission with
Link](https://cursor.com/agents/bc-82fc8433-3e64-4f9f-a012-273e9123f28c/artifacts?path=%2Fopt%2Fcursor%2Fartifacts%2Fscreenshot_no_permission_with_link.png)
## Testing
- Frontend lint, prettier, and typecheck all pass
- Frontend unit tests: 603/603 passing
- Ladle stories build and render correctly in all three states
- Backend Go build and vet pass
- Backend tests require PostgreSQL (not available in cloud agent) — will
pass in CI
## References
- Linear: ENG-3422
- ADR: `adr-checkrun-opt-in` (0024)
- Related: ENG-3353, ENG-3406
<sub>To show artifacts inline, <a
href="https://cursor.com/dashboard/cloud-agents#team-pull-requests">enable</a>
in settings.</sub>
<!-- CURSOR_AGENT_PR_BODY_END -->
Linear Issue:
[ENG-3422](https://linear.app/overmind/issue/ENG-3422/check-run-settings-ui-opt-in-gate)
<div><a
href="https://cursor.com/agents/bc-82fc8433-3e64-4f9f-a012-273e9123f28c"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a
href="https://cursor.com/background-agent?bcId=bc-82fc8433-3e64-4f9f-a012-273e9123f28c"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </div>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: David Schmitt <DavidS-ovm@users.noreply.github.com>
GitOrigin-RevId: eb94762f02aeb78a4215a278795377c83dad5bac1 parent 118e5ca commit 104cad6
1 file changed
Lines changed: 35 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments