feat: add safe Gitea sync and signed updates
ForgeFlow quality gate / secret-scan (push) Failing after 32s
ForgeFlow quality gate / quality (push) Failing after 0s

This commit is contained in:
NuklearRabbit committed 2026-08-27 00:38:58 +02:00
1 parent cb9bdcd713
commit d47c7b5e41
46 files changed
+1658 -246

No files matched your search

+38
View File
@@ -265,6 +265,44 @@ function registerRepositoryIpc({
git.repairSync(safePath, strategy),
);
});
register("repository:workspace-sync-preview", async ({ localPath }) => {
const safePath = await assertKnownRepositoryPath(localPath);
const plan = await withRepositoryMutation(safePath, () =>
git.previewWorkspaceSync(safePath),
);
await diagnostics.info("repository.workspace-sync.previewed", {
localPath: safePath,
branch: plan.branch,
upstream: plan.upstream,
currentSha: plan.currentSha,
targetSha: plan.targetSha,
planId: plan.id,
summary: plan.summary,
blockers: plan.blockers,
});
return plan;
});
register(
"repository:workspace-sync-apply",
async ({ localPath, expectedPlanId }) => {
const safePath = await assertKnownRepositoryPath(localPath);
const result = await withRepositoryMutation(safePath, () =>
git.synchronizeWorkspace(safePath, expectedPlanId),
);
await audit.append("repository.workspace-synchronized", {
localPath: safePath,
branch: result.plan.branch,
upstream: result.plan.upstream,
previousSha: result.plan.currentSha,
targetSha: result.plan.targetSha,
backupBranch: result.backupBranch,
stashSha: result.stash?.sha || null,
ignoredFilesPreserved: true,
applied: result.applied,
});
return result;
},
);
register("repository:set-origin", async ({ localPath, remoteUrl }) => {
const safePath = await assertKnownRepositoryPath(localPath);
return withRepositoryMutation(safePath, () =>