Skip to content

feat(web): edit a repository's policy from a code review page - #675

Closed
TheGreatAxios wants to merge 2 commits into
cl-11575-add-a-server-route-that-patches-a-repositorys-policy-filefrom
cl-11564-add-a-code-review-page-that-edits-every-repositorys-judging
Closed

TheGreatAxios wants to merge 2 commits into
cl-11575-add-a-server-route-that-patches-a-repositorys-policy-filefrom
cl-11564-add-a-code-review-page-that-edits-every-repositorys-judging

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

This branch is based on cl-11575-add-a-server-route-that-patches-a-repositorys-policy-file because the page calls the policy patch route from that pull request. It does not add a second route.

A policy file is .corbits-triage.yml on a repository's default branch. It decides which rules run, including judging and code review (bug finding). The Code Review page lists those rules for one repository and opens one pull request for a batch of changes.

  • Sidebar page with a repository switcher (search, keyboard, recent).
  • Built-in rules, custom rules, judging, and code review as switches. Off rules sit below the ones that are on.
  • The tray previews the change as sentences, then the file before and after. Preview writes nothing. Opening applies the batch through POST /api/integrations/github-triage/{tenantId}/policy/patch.
  • A new judge rule is three questions. The file stores an is-true model rule: what to check is text (the claim), it passes when that claim is true, and what happens on fail is onFail.
  • A missing decision model says Needs a model. A missing place to run code review says so and links to the one setup on this page.
  • The Anthropic key and where code review runs moved here from Settings. The decision model can be set here too. It also remains under Settings, Triage, which this issue was not allowed to edit.
  • The repository page no longer has a code review setup card.

Verification

  • bun run check passed (typecheck and hub bundle).
  • bun run lint passed: 22 warnings, 0 errors, exit 0.
  • bun --conditions=intx-src test --preload ./apps/web/src/lib/dom-preload.ts ./apps/web/src/components/code-review/PolicyEditor.dom.test.tsx passed: a switch becomes a tray change and the preview shows the file before and after.
  • git log --format='%G? %ae' -1 prints G.

Closes CL-11564

List each repository's rules from its policy file and open one pull request through the existing patch route.
@linear-code

linear-code Bot commented Oct 27, 2026

Copy link
Copy Markdown

CL-11564

A rule the file does not list is not previewed until the batch enables it and sets max or paths.
@TheGreatAxios

Copy link
Copy Markdown
Contributor Author

Review: needs fixes, and one part is the wrong direction. It also sits on an old #672 commit (lacks 6ffa01a), so turning on max-lines-changed with max: 200 from this page answers "Rule max-lines-changed is not in the file."; it conflicts with main and with #674.

  1. Wrong direction: readFileText in pages/CodeReview.tsx reads the policy file by previewing a fake change on the patch route. Any file where that fake change is refused cannot be loaded, and the text comes from the pull request branch while file.data.sha comes from the default branch. Return the text from the policy-file read route.
  2. More than one concern: moving the Anthropic key and "where code review runs" out of Settings, duplicating the decision-model control, and removing CodeReviewCard are separate pull requests.
  3. Docs: "Settings → Code review" still appears in docs/PRODUCT.md (401, 410), docs/SELF_HOST.md (358, 377), docs/provisioners/README.md (16), docs/provisioners/railway-sandboxes.md (3, 33, 57) and the Manual (42, 206). The Manual heading {#code-review-page} is not GitHub syntax. The caption for images/38.png describes the removed card.
  4. Bugs: void open() with apply rethrowing leaves an unhandled rejection; RepoSwitcher writes localStorage without a try and hand-builds a combobox where @corbits/react-ui has command-palette, select and menu; "Start from {name}'s" opens the starter export, not that repository's rules; judgeRuleChange writes the claim as the reason; step 2 of "three questions" has no input; the test waits on setTimeout(50).
  5. Body: no process talk, and say how the manual and browser checks were verified.

@TheGreatAxios

Copy link
Copy Markdown
Contributor Author

Closing: the page reads the policy file through a fake patch preview and bundles three concerns. CL-11564 stays open and gets rebuilt on the policy-file read route once #672 and #674 are on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant