Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history

0106_repo_automation_settings.sql

Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.

0106_repo_automation_settings.sqlBlame46 lines · 1 contributor
479dcd9Claude1-- Migration 0106: Per-repo automation settings.
2--
3-- ONE row per repository controlling every push/PR/issue-time automation
4-- with a mode of 'off' | 'suggest' | 'auto'. Absence of a row means the
5-- defaults below — which exactly match pre-0106 behavior, so shipping this
6-- migration changes nothing until a user touches the settings page.
7--
8-- Env kill-switches stay supreme: a feature disabled at the environment
9-- level (missing ANTHROPIC_API_KEY, AI_LOOP_ENABLED unset, etc.) is off
10-- regardless of what this table says.
11
12CREATE TABLE IF NOT EXISTS repo_automation_settings (
13 id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
14 repository_id uuid NOT NULL UNIQUE REFERENCES repositories(id) ON DELETE CASCADE,
15
16 -- AI code review on PR open. 'suggest' (default) = post advisory review
17 -- comments, the pre-0106 behavior. 'off' = skip entirely. ('auto' is
18 -- treated as 'suggest' — review comments are inherently advisory.)
19 ai_review_mode text NOT NULL DEFAULT 'suggest',
20
21 -- AI triage comment on PR open ('suggest' = current behavior; only
22 -- on/off is meaningful, 'auto' treated as on).
23 pr_triage_mode text NOT NULL DEFAULT 'suggest',
24
25 -- AI triage comment on issue create (same semantics as pr_triage_mode).
26 issue_triage_mode text NOT NULL DEFAULT 'suggest',
27
28 -- AI-gated auto-merge. 'auto' (default) = merge when a branch_protection
29 -- rule opts in AND every gate passes — the pre-0106 behavior (still
30 -- default-deny without an enable_auto_merge rule). 'suggest' = evaluate
31 -- and record the decision in the audit log but never perform the merge.
32 -- 'off' = skip evaluation entirely.
33 auto_merge_mode text NOT NULL DEFAULT 'auto',
34
35 -- CI auto-fix on failed gate runs. 'suggest' (default) = post the patch
36 -- as a PR comment with an Apply Fix button, the pre-0106 behavior.
37 -- 'auto' = also apply the patch onto a fix/ branch automatically.
38 -- 'off' = skip entirely.
39 ci_autofix_mode text NOT NULL DEFAULT 'suggest',
40
41 created_at timestamp DEFAULT now(),
42 updated_at timestamp DEFAULT now()
43);
44
45CREATE UNIQUE INDEX IF NOT EXISTS idx_repo_automation_settings_repo
46 ON repo_automation_settings(repository_id);