Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ once to the approving admin.
5. **Executor** shows where reviews run (from the config file, read-only) and manages the review image's version, resources and, for Kubernetes, scheduling, pod labels and annotations, the CA bundle and the job TTL. Changes apply to the next review. See [deploy.md](deploy.md#settings-in-the-admin-panel).
6. **Settings → Admin sessions → Sign out after inactivity** ends a session that has made no request for that long (60 minutes by default, 0 for never; the panel's own refreshes don't count), recorded as `session.ended` with reason `idle`. **Settings → Signed-in admins** lists every admin session. Sign one out, or **Sign out everyone else** (after offboarding someone, or if a session may be compromised). Every request is also checked against the current sign-in rules and license, so an admin removed from `allowed_emails`, `allowed_domains` or `allowed_groups` (after the restart that applies the change) is signed out at once. Group membership comes from the identity provider at sign-in: a group removed there applies when the session ends (`session_ttl`) or when you sign the session out here.
7. **Review scores.** Every review the CLI scores (quality, security, maintainability, 1 to 100) keeps its scores, whether or not score labels are on. **Reviews** shows them per review, banded like the labels (80 and up, 50 to 79, below 50), filters by them ("security below 60" searches all reviews) and sorts the loaded reviews by them. With the metrics feature, it also shows the period's average scores and a trend chart; **Repositories** shows each repository's latest scores with a 30-day sparkline, and a repository's **Settings** panel charts its scores over 30 days, 12 months or all its history. Reviews stored before the upgrade get their scores from the stored result. The filters, sort, chart period and the open review are kept in the address (for example `/admin/reviews?score_kind=security&score_below=60&sort=security`, with the same names as `/admin/api/reviews`), so a reload or Back keeps the view and a filtered view can be bookmarked or shared. A review that approved the merge request on the code host is marked **✓ approved** on Reviews and on the status dashboard (or **approval withdrawn** / **approval failed**), and Reviews filters by it (`approval=approved`); this is the bot approving merge requests, set under Settings, not operator change requests.
8. **Approve merge requests** (Settings) has the bot approve a merge request whose review passes, as its token's user (or the GitHub App). Choose which findings block approval (critical; major or critical, the default; minor or above; any finding; or none, to approve whatever it found), an optional lowest score for all three scores, and whether a later review that doesn't pass withdraws the bot's approval (on by default) or leaves it. New findings, ones beyond the comment limit and ones still open from an earlier review count; questions don't. A partial or too-large review leaves the approval as it is. **Rules** turn approval on or off for a host, group or pattern (**Approve MRs**), and **Repositories** shows where it applies. A review's details show what happened ("approved", "withdrawn", "not approved"…), and a refusal from the code host shows on the review as "could not approve". It needs code-review-bot 0.5 or later (the CLI version on **Executor**). On GitLab the bot's user must be allowed to approve and can't approve its own merge requests; on GitHub, withdrawing dismisses the bot's review, which branch protection can restrict.
9. **Impact** shows what the console has done for this installation, from its own database only (nothing leaves it): merge requests reviewed and review runs, findings raised by severity, security findings, the median time to first review (from the webhook to the first review's comments, including the wait after a push), active repositories, comments posted and average scores. Questions aren't counted as findings. The last 30 days are free; with the metrics feature, choose 90 days, 12 months or all history, see the trends, findings by category, the top repositories by reviews and by findings, and **Export CSV** or **Export JSON** for reports (exports are audited as `impact.export`). Periods are whole UTC days or months; the label ends on the last day (or month) included, and the API and exports give that day as `through` next to the exclusive end (`to`, `to_exclusive` in the CSV). The numbers come from rollups kept for good, like the review charts; on upgrade they are filled in from the reviews still stored. How many findings were acted on (fixed, resolved or dismissed) isn't tracked yet and isn't shown. Periods are whole UTC days or months. The numbers link to **Reviews** with the matching filters and period: merge requests reviewed, findings raised (`severity=any`), security findings (`category=security`), each severity and category, and each top repository. Reviews can also be filtered by finding severity and category directly; `/admin/api/reviews` takes `severity` (or `any`) and `category`, counted the way Impact counts them (questions aren't findings). **Approvals by the bot** counts merge requests the bot approved on the code host (a review that approved; one already approved isn't counted again), and is in the exports as `approvals_by_the_bot`.
8. **Approve merge requests** (Settings) has the bot approve a merge request whose review passes, as its token's user (or the GitHub App). Choose which findings block approval (critical; major or critical, the default; minor or above; any finding; or none, to approve whatever it found), an optional lowest score for all three scores, and whether a later review that doesn't pass withdraws the bot's approval (on by default) or leaves it. New findings, ones beyond the comment limit and ones still open from an earlier review count; questions don't. A review that can't decide (partial, too large) of a new commit also withdraws the bot's approval when withdrawing is on (code-review-bot 0.6 or later), so an approval never carries over to code that wasn't fully reviewed; a re-review of the same commit leaves it. The console always tells the CLI which you chose. **Rules** turn approval on or off for a host, group or pattern (**Approve MRs**), and **Repositories** shows where it applies. A review's details show what happened ("approved", "withdrawn", "not approved"…), and a refusal from the code host shows on the review as "could not approve". It needs code-review-bot 0.5 or later (the CLI version on **Executor**). On GitLab the bot's user must be allowed to approve and can't approve its own merge requests; on GitHub, withdrawing dismisses the bot's review, which branch protection can restrict. A partial or too-large review leaves the approval as it is.
9. **Impact** shows what the console has done for this installation, from its own database only (nothing leaves it): merge requests reviewed and review runs, findings raised by severity, security findings, the median time to first review (from the webhook to the first review's comments, including the wait after a push), active repositories, comments posted and average scores. Questions aren't counted as findings. The last 30 days are free; with the metrics feature, choose 90 days, 12 months or all history, see the trends, findings by category, the top repositories by reviews and by findings, and **Export CSV** or **Export JSON** for reports (exports are audited as `impact.export`). Periods are whole UTC days or months. The numbers come from rollups kept for good, like the review charts; on upgrade they are filled in from the reviews still stored. **Approvals by the bot** counts merge requests the bot approved on the code host (a review that approved; one already approved isn't counted again), and is in the exports as `approvals_by_the_bot`. The numbers link to **Reviews** with the matching filters and period: merge requests reviewed, findings raised (`severity=any`), security findings (`category=security`), each severity and category, and each top repository. Reviews can also be filtered by finding severity and category directly; `/admin/api/reviews` takes `severity` (or `any`) and `category`, counted the way Impact counts them (questions aren't findings). How many findings were acted on (fixed, resolved or dismissed) isn't tracked yet and isn't shown. Periods are whole UTC days or months; the label ends on the last day (or month) included, and the API and exports give that day as `through` next to the exclusive end (`to`, `to_exclusive` in the CSV).
10. **Webhooks** shows every delivery. A delivery whose body was already received (a retry, an event arriving through two GitLab hooks, a replay) shows as a duplicate and is not processed again, for 7 days. Redelivering an old webhook from the code host therefore does nothing; use **Review now** on the Repositories page instead. The project and outcome filters are kept in the address.
11. **Audit log** lists sign-ins, denied sign-ins, sign-outs and every change, newest first, with who made it and from which address and browser. Each change shows only the fields that changed (old → new), with the raw entry one click away; secret changes are named without their values (`token:changed`, `signing_tokens:+1`). Filter by who, action (`host.*` matches every host action), target, a text search and dates; **Older entries** pages back through everything, and **Export CSV** or **Export JSON Lines** downloads the filtered view (up to 100,000 entries; exports are audited too). Times are shown as `23 Nov 2026, 09:33:38 IST` in your browser's time zone, with UTC on hover. The applied filter is kept in the address (`/admin/audit?action=host.*`).
12. **Unsaved changes.** On **Settings**, edited cards are marked **Unsaved**, and a bar at the bottom of the window lists what isn't saved yet (the settings, the default review settings, the queue and review settings) with **Save** and **Discard**. Leaving the page or following a link asks first. If the session ended before you save, the changes stay on the page: sign in again in the new tab it offers, come back and save.
Expand Down
6 changes: 3 additions & 3 deletions internal/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ func Args(t Task) ([]string, error) {
}
if a := t.Approval; a != nil {
args = append(args, "--approve", "--approve-block", firstNonEmpty(a.Block, "none"), "--approve-min-score", strconv.Itoa(a.MinScore))
if a.Withdraw {
args = append(args, "--approve-withdraw")
}
// Always explicit: the CLI's default changed to on in 0.6, so
// "leave it" must say =false (older CLIs accept that too).
args = append(args, "--approve-withdraw="+strconv.FormatBool(a.Withdraw))
}
return args, nil
case "validate":
Expand Down
6 changes: 3 additions & 3 deletions internal/executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ func TestArgsPostingFlags(t *testing.T) {

func TestArgsApproval(t *testing.T) {
args, _ := Args(Task{Kind: "review", URL: "u", Post: true, Approval: &Approval{Block: "major", MinScore: 80, Withdraw: true}})
if got := strings.Join(args, " "); !strings.Contains(got, "--approve --approve-block major --approve-min-score 80 --approve-withdraw") {
if got := strings.Join(args, " "); !strings.Contains(got, "--approve --approve-block major --approve-min-score 80 --approve-withdraw=true") {
t.Errorf("approval flags: %s", got)
}
args, _ = Args(Task{Kind: "review", URL: "u", Post: true, Approval: &Approval{}})
if got := strings.Join(args, " "); !strings.Contains(got, "--approve-block none --approve-min-score 0") || strings.Contains(got, "--approve-withdraw") {
t.Errorf("approve whatever was found, without withdrawing: %s", got)
if got := strings.Join(args, " "); !strings.Contains(got, "--approve-block none --approve-min-score 0 --approve-withdraw=false") {
t.Errorf("approve whatever was found, without withdrawing (explicit: the CLI's default is on): %s", got)
}
args, _ = Args(Task{Kind: "review", URL: "u", Post: true})
if strings.Contains(strings.Join(args, " "), "--approve") {
Expand Down
2 changes: 1 addition & 1 deletion web/src/pages/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export default function Settings() {
<Num label="Lowest score to approve" value={v.approve_min_score} onChange={set("approve_min_score")} min={0} max={100} placeholder="0" note={<Note className="text-xs">Every score (quality, security, maintainability) must be at least this. 0 ignores the scores.</Note>} />
<Bool label="When a later review doesn't pass" value={v.approve_withdraw} onChange={set("approve_withdraw")} yes="Withdraw the bot's approval" no="Leave it" />
</FormGrid>
<Note className="text-xs">A partial or too-large review leaves the approval as it is. GitLab: the bot's user must be allowed to approve. GitHub: withdrawing dismisses the bot's review, which branch protection may restrict.</Note>
<Note className="text-xs">With withdrawing on, a review that can't judge a new commit (partial, too large) also withdraws the approval (CLI 0.6 or later). GitLab: the bot's user must be allowed to approve. GitHub: withdrawing dismisses the bot's review, which branch protection may restrict.</Note>
</Group>
<Group title="Learnings" unsaved={any("learnings_enabled", "learnings_auto_activate")}>
<FormGrid>
Expand Down
Loading