kin: auto-commit after pipeline
This commit is contained in:
parent
9ea3ef1c18
commit
0a5f58b7fe
3 changed files with 38 additions and 1 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -169,3 +169,5 @@ kin.db-shm
|
||||||
PROGRESS.md
|
PROGRESS.md
|
||||||
node_modules/
|
node_modules/
|
||||||
web/frontend/dist/
|
web/frontend/dist/
|
||||||
|
|
||||||
|
.kin_worktrees/
|
||||||
|
|
|
||||||
|
|
@ -772,6 +772,7 @@ def _is_test_failure(result: dict) -> bool:
|
||||||
|
|
||||||
# Roles that trigger auto-test when project.auto_test_enabled is set
|
# Roles that trigger auto-test when project.auto_test_enabled is set
|
||||||
_AUTO_TEST_ROLES = {"backend_dev", "frontend_dev"}
|
_AUTO_TEST_ROLES = {"backend_dev", "frontend_dev"}
|
||||||
|
_WORKTREE_ROLES = {"backend_dev", "frontend_dev", "debugger"}
|
||||||
|
|
||||||
|
|
||||||
def _detect_test_command(project_path: str) -> str | None:
|
def _detect_test_command(project_path: str) -> str | None:
|
||||||
|
|
@ -1432,7 +1433,6 @@ def run_pipeline(
|
||||||
}
|
}
|
||||||
|
|
||||||
# Worktree isolation: opt-in per project, for write-capable roles
|
# Worktree isolation: opt-in per project, for write-capable roles
|
||||||
_WORKTREE_ROLES = {"backend_dev", "frontend_dev", "debugger"}
|
|
||||||
worktree_path = None
|
worktree_path = None
|
||||||
project_for_wt = models.get_project(conn, task["project_id"]) if not dry_run else None
|
project_for_wt = models.get_project(conn, task["project_id"]) if not dry_run else None
|
||||||
use_worktree = (
|
use_worktree = (
|
||||||
|
|
|
||||||
|
|
@ -256,6 +256,24 @@ async function toggleAutoTest() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Worktrees toggle
|
||||||
|
const worktrees = ref(false)
|
||||||
|
|
||||||
|
function loadWorktrees() {
|
||||||
|
worktrees.value = !!(project.value?.worktrees_enabled)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function toggleWorktrees() {
|
||||||
|
worktrees.value = !worktrees.value
|
||||||
|
try {
|
||||||
|
await api.patchProject(props.id, { worktrees_enabled: worktrees.value })
|
||||||
|
if (project.value) project.value = { ...project.value, worktrees_enabled: worktrees.value ? 1 : 0 }
|
||||||
|
} catch (e: any) {
|
||||||
|
error.value = e.message
|
||||||
|
worktrees.value = !worktrees.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Audit
|
// Audit
|
||||||
const auditLoading = ref(false)
|
const auditLoading = ref(false)
|
||||||
const auditResult = ref<AuditResult | null>(null)
|
const auditResult = ref<AuditResult | null>(null)
|
||||||
|
|
@ -483,6 +501,7 @@ async function load() {
|
||||||
loadMode()
|
loadMode()
|
||||||
loadAutocommit()
|
loadAutocommit()
|
||||||
loadAutoTest()
|
loadAutoTest()
|
||||||
|
loadWorktrees()
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
error.value = e.message
|
error.value = e.message
|
||||||
} finally {
|
} finally {
|
||||||
|
|
@ -913,6 +932,14 @@ async function addDecision() {
|
||||||
:title="autoTest ? 'Auto-test: on — запускать тесты после pipeline' : 'Auto-test: off'">
|
:title="autoTest ? 'Auto-test: on — запускать тесты после pipeline' : 'Auto-test: off'">
|
||||||
{{ autoTest ? '✓ Автотест' : 'Автотест' }}
|
{{ autoTest ? '✓ Автотест' : 'Автотест' }}
|
||||||
</button>
|
</button>
|
||||||
|
<button @click="toggleWorktrees"
|
||||||
|
class="px-2 py-1 text-xs border rounded transition-colors"
|
||||||
|
:class="worktrees
|
||||||
|
? 'bg-teal-900/30 text-teal-400 border-teal-800 hover:bg-teal-900/50'
|
||||||
|
: 'bg-gray-800/50 text-gray-400 border-gray-700 hover:bg-gray-800'"
|
||||||
|
:title="worktrees ? 'Worktrees: on — агенты в изолированных git worktrees' : 'Worktrees: off'">
|
||||||
|
{{ worktrees ? '✓ Worktrees' : 'Worktrees' }}
|
||||||
|
</button>
|
||||||
<button @click="runAudit" :disabled="auditLoading"
|
<button @click="runAudit" :disabled="auditLoading"
|
||||||
class="px-2 py-1 text-xs bg-purple-900/30 text-purple-400 border border-purple-800 rounded hover:bg-purple-900/50 disabled:opacity-50"
|
class="px-2 py-1 text-xs bg-purple-900/30 text-purple-400 border border-purple-800 rounded hover:bg-purple-900/50 disabled:opacity-50"
|
||||||
title="Check which pending tasks are already done">
|
title="Check which pending tasks are already done">
|
||||||
|
|
@ -1227,6 +1254,14 @@ async function addDecision() {
|
||||||
:title="autoTest ? 'Auto-test: on — запускать тесты после pipeline' : 'Auto-test: off'">
|
:title="autoTest ? 'Auto-test: on — запускать тесты после pipeline' : 'Auto-test: off'">
|
||||||
{{ autoTest ? '✓ Автотест' : 'Автотест' }}
|
{{ autoTest ? '✓ Автотест' : 'Автотест' }}
|
||||||
</button>
|
</button>
|
||||||
|
<button @click="toggleWorktrees"
|
||||||
|
class="px-2 py-1 text-xs border rounded transition-colors"
|
||||||
|
:class="worktrees
|
||||||
|
? 'bg-teal-900/30 text-teal-400 border-teal-800 hover:bg-teal-900/50'
|
||||||
|
: 'bg-gray-800/50 text-gray-400 border-gray-700 hover:bg-gray-800'"
|
||||||
|
:title="worktrees ? 'Worktrees: on — агенты в изолированных git worktrees' : 'Worktrees: off'">
|
||||||
|
{{ worktrees ? '✓ Worktrees' : 'Worktrees' }}
|
||||||
|
</button>
|
||||||
<button @click="runAudit" :disabled="auditLoading"
|
<button @click="runAudit" :disabled="auditLoading"
|
||||||
class="px-2 py-1 text-xs bg-purple-900/30 text-purple-400 border border-purple-800 rounded hover:bg-purple-900/50 disabled:opacity-50"
|
class="px-2 py-1 text-xs bg-purple-900/30 text-purple-400 border border-purple-800 rounded hover:bg-purple-900/50 disabled:opacity-50"
|
||||||
title="Check which pending tasks are already done">
|
title="Check which pending tasks are already done">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue