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
6 changes: 4 additions & 2 deletions apps/gittensory-ui/public/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -8918,7 +8918,8 @@
]
},
"firstTimeContributorGrace": {
"type": "boolean"
"type": "boolean",
"description": "Reserved (#2266) -- the gate evaluator never reads this field. Currently has no effect on gate decisions."
},
"slopGateMinScore": {
"type": "number",
Expand Down Expand Up @@ -10279,7 +10280,8 @@
]
},
"firstTimeContributorGrace": {
"type": "boolean"
"type": "boolean",
"description": "Reserved (#2266) -- the gate evaluator never reads this field. Currently has no effect on gate decisions."
},
"slopGateMinScore": {
"type": "number",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ type ToggleFieldDef = {
label: string;
kind: "toggle";
hint?: string;
// Renders greyed-out and non-interactive with the hint as the disclosure -- for a field that is real
// and DB-backed but currently wired to nothing (e.g. firstTimeContributorGrace, #2266/#2411), so a
// maintainer can't be misled into thinking the toggle has an effect.
disabled?: boolean;
};
type NumberFieldDef = {
key: keyof MaintainerSettings;
Expand Down Expand Up @@ -184,7 +188,8 @@ const GATE_FIELDS: FieldDef[] = [
key: "firstTimeContributorGrace",
label: "First-time-contributor grace",
kind: "toggle",
hint: "Soften a newcomer's block to advisory",
hint: "Reserved — currently has no effect on gate decisions (#2266)",
disabled: true,
},
];

Expand Down Expand Up @@ -623,6 +628,7 @@ function FieldGroup({
key={field.key}
label={field.label}
hint={field.hint}
disabled={field.disabled}
value={settings[field.key] as boolean}
onChange={(value) =>
setField(field.key, value as MaintainerSettings[typeof field.key])
Expand Down Expand Up @@ -682,17 +688,20 @@ function ToggleControl({
hint,
value,
onChange,
disabled,
}: {
label: string;
hint?: string;
value: boolean;
onChange: (value: boolean) => void;
disabled?: boolean;
}) {
return (
<label className="flex items-start gap-2 text-token-sm">
<label className={`flex items-start gap-2 text-token-sm ${disabled ? "opacity-60" : ""}`}>
<input
type="checkbox"
checked={value}
disabled={disabled}
onChange={(event) => onChange(event.target.checked)}
className="mt-0.5 size-4 accent-mint"
/>
Expand Down
4 changes: 3 additions & 1 deletion src/api/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,9 @@ const maintainerSettingsSchema = z
selfAuthoredLinkedIssueGateMode: z.enum(["off", "advisory", "block"]),
linkedIssueSatisfactionGateMode: z.enum(["off", "advisory", "block"]),
mergeTrainMode: z.enum(["off", "audit", "enforce"]),
firstTimeContributorGrace: z.boolean(),
firstTimeContributorGrace: z
.boolean()
.describe("Reserved (#2266) -- the gate evaluator never reads this field. Currently has no effect on gate decisions."),
slopGateMode: z.enum(["off", "advisory", "block"]),
slopGateMinScore: z.number().int().min(0).max(100).nullable(),
slopAiAdvisory: z.boolean(),
Expand Down
8 changes: 6 additions & 2 deletions src/openapi/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,9 @@ export const RepositorySettingsSchema = z
manifestPolicyGateMode: z.enum(["off", "advisory", "block"]),
selfAuthoredLinkedIssueGateMode: z.enum(["off", "advisory", "block"]),
linkedIssueSatisfactionGateMode: z.enum(["off", "advisory", "block"]),
firstTimeContributorGrace: z.boolean(),
firstTimeContributorGrace: z
.boolean()
.describe("Reserved (#2266) -- the gate evaluator never reads this field. Currently has no effect on gate decisions."),
slopGateMinScore: z.number().nullable().optional(),
slopAiAdvisory: z.boolean(),
aiReviewMode: z.enum(["off", "advisory", "block"]),
Expand Down Expand Up @@ -880,7 +882,9 @@ export const RepoSettingsPreviewSchema = z
manifestPolicyGateMode: z.enum(["off", "advisory", "block"]),
selfAuthoredLinkedIssueGateMode: z.enum(["off", "advisory", "block"]),
linkedIssueSatisfactionGateMode: z.enum(["off", "advisory", "block"]),
firstTimeContributorGrace: z.boolean(),
firstTimeContributorGrace: z
.boolean()
.describe("Reserved (#2266) -- the gate evaluator never reads this field. Currently has no effect on gate decisions."),
slopGateMinScore: z.number().nullable().optional(),
autoLabelEnabled: z.boolean(),
typeLabelsEnabled: z.boolean(),
Expand Down
Loading