feat(workflow): configure review precision and approval on the review.pr step
This commit is contained in:
19 files changed
+107
-267
No files matched your search
@@ -59,7 +59,6 @@ const settings: NavSpec = {
|
||||
"/settings/models",
|
||||
"/settings/skills",
|
||||
"/settings/curators",
|
||||
"/settings/review",
|
||||
"/settings/scheduling-policy",
|
||||
],
|
||||
},
|
||||
|
||||
@@ -13,7 +13,6 @@ import OrgWorkspacesPage from "@/org/OrgWorkspacesPage.vue";
|
||||
import OrgAccessPage from "@/org/OrgAccessPage.vue";
|
||||
import OrgModelsPage from "@/org/OrgModelsPage.vue";
|
||||
import SchedulingPolicyPage from "@/settings/SchedulingPolicyPage.vue";
|
||||
import ReviewSettingsPage from "@/settings/ReviewSettingsPage.vue";
|
||||
import ToolsPage from "@/settings/ToolsPage.vue";
|
||||
import HistoryPage from "@/settings/HistoryPage.vue";
|
||||
import SoulPage from "@/settings/SoulPage.vue";
|
||||
@@ -310,18 +309,6 @@ const routes = [
|
||||
section: "settings",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/settings/review",
|
||||
name: "settings-review",
|
||||
component: ReviewSettingsPage,
|
||||
meta: {
|
||||
navPath: "/settings",
|
||||
settings: true,
|
||||
label: "Review",
|
||||
description: "Pull request review: precision filter and approval.",
|
||||
section: "settings",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/settings/tools",
|
||||
name: "settings-tools",
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import ApplyStatusRows from "./ApplyStatusRows.vue";
|
||||
import { computed, onMounted } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
|
||||
import PageHeader from "@/base/PageHeader.vue";
|
||||
import { SettingRow } from "@/components/ui/setting-row";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
|
||||
import DraftHint from "./DraftHint.vue";
|
||||
import HistoryLink from "./HistoryLink.vue";
|
||||
|
||||
const KIND = "review-settings";
|
||||
|
||||
interface ReviewDials {
|
||||
precision_gate: boolean;
|
||||
approve_before_post: boolean;
|
||||
}
|
||||
|
||||
const store = useSettingsStore();
|
||||
const { catalog, catalogError } = storeToRefs(store);
|
||||
onMounted(() => store.load());
|
||||
|
||||
const resources = computed(() => resourcesForPage(catalog.value, "review"));
|
||||
const dials = computed(() => store.drafts[KIND]?.value as ReviewDials | undefined);
|
||||
const error = computed(() => store.pageErrorFor(KIND));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<PageHeader title="Review">
|
||||
<HistoryLink :kinds="resources.map((r) => r.kind)" />
|
||||
</PageHeader>
|
||||
<ApplyStatusRows v-for="resource in resources" :key="resource.kind" :kind="resource.kind" class="mb-4" />
|
||||
|
||||
<p v-if="catalogError || error" class="mb-4 text-sm text-danger" role="alert">
|
||||
{{ catalogError || error }}
|
||||
</p>
|
||||
|
||||
<template v-if="dials">
|
||||
<SettingRow
|
||||
label="Precision gate"
|
||||
for="review-precision"
|
||||
hint="Filters weak findings before posting."
|
||||
>
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<Switch id="review-precision" v-model="dials.precision_gate" aria-label="Precision gate" />
|
||||
<DraftHint :kind="KIND" path="precision_gate" />
|
||||
</div>
|
||||
</SettingRow>
|
||||
<SettingRow
|
||||
label="Approve before posting"
|
||||
for="review-approve"
|
||||
hint="Draft reviews require approval."
|
||||
>
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<Switch id="review-approve" v-model="dials.approve_before_post" aria-label="Approve before posting" />
|
||||
<DraftHint :kind="KIND" path="approve_before_post" />
|
||||
</div>
|
||||
</SettingRow>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
@@ -4,13 +4,6 @@ export interface ReloadStatus {
|
||||
last_error?: string;
|
||||
}
|
||||
|
||||
/** The effective pr-review policy after the review-settings resource is
|
||||
* layered over the file's [review] section. */
|
||||
export interface ReviewView {
|
||||
precision_gate: boolean;
|
||||
approve_before_post: boolean;
|
||||
}
|
||||
|
||||
/** A provider the model catalog found usable, with its model ids. */
|
||||
export interface CatalogProvider {
|
||||
id: string;
|
||||
@@ -23,7 +16,6 @@ export interface CatalogProvider {
|
||||
|
||||
export interface ConfigView {
|
||||
catalog?: CatalogProvider[];
|
||||
review?: ReviewView;
|
||||
reload?: ReloadStatus;
|
||||
bootstrap?:Record<string,string>;
|
||||
}
|
||||
Reference in new issue
Block a user