feat: add durable isolated Git workspaces and source-bound delivery
This commit is contained in:
@@ -9,6 +9,8 @@ import { inspectProject } from './project-inspector.mjs';
|
||||
import { gitArguments, gitEnvironment, runGit } from './git-process.mjs';
|
||||
import { DeliveryReporter, verifiedCheck } from './delivery-report.mjs';
|
||||
import { pendingDeliveryReview, resolveDeliveryReview } from '../shared/contracts/delivery-review.mjs';
|
||||
import { assertWorkspacesResolved } from '../shared/contracts/workspaces.mjs';
|
||||
import { verifyWorkspaceProject } from './workspaces/git-workspaces.mjs';
|
||||
|
||||
const at = () => new Date().toISOString();
|
||||
const sha = value => createHash('sha256').update(value).digest('hex');
|
||||
@@ -71,6 +73,7 @@ export class GitDelivery {
|
||||
}
|
||||
assertTask(session) {
|
||||
assertChangeSetsResolved(this.store, session.projectId, { includePrepared: true });
|
||||
assertWorkspacesResolved(this.store, session.projectId, { includePrepared: true });
|
||||
if (!session.taskId || !session.runId) throw conflict('先发送一个项目任务,再准备本任务的Git交付。');
|
||||
const task = this.store.owned('task', session.taskId, session.id), run = this.store.owned('run', session.runId, session.id);
|
||||
if (run.taskId !== task.id) throw conflict('当前Task和Run归属不一致。');
|
||||
@@ -84,6 +87,7 @@ export class GitDelivery {
|
||||
}
|
||||
|
||||
async snapshot(project, { allowOwnLock = false } = {}) {
|
||||
await verifyWorkspaceProject(this.store, project);
|
||||
const root = safePath(project);
|
||||
let top;
|
||||
try { top = await this.needGit(project, ['rev-parse', '--show-toplevel']); }
|
||||
|
||||
Reference in New Issue
Block a user