feat: 接入精确回滚与确认后执行的运维操作

- 生成绑定操作者与 SHA 的签名计划,确认后复用发布、取消和重试服务,限制过期、并发与重复提交。

- 从真实历史构建核实回滚目标,升级纳管 Jenkins 任务以锁定提交并保留原参数选择器。

- Agent 只准备操作卡片,不直接执行;补充权限、回放、历史令牌与实际部署参数回归。
This commit is contained in:
湛兮
2026-10-28 10:18:01 +08:00
parent 3cd644158d
commit a29066f343
26 changed files with 1486 additions and 32 deletions
@@ -308,6 +308,27 @@ describe('DeployExecutionService', () => {
);
});
it('passes an immutable historical commit through the real deployment workflow', async () => {
const { repository, service, jenkins } = createService({
jenkinsHealth: { status: 'ok' },
notificationStatus: 'sent',
});
const { run } = await repository.create({
...input,
idempotencyKey: 'pinned-rollback',
resolvedCommit: 'a'.repeat(40),
operationKind: 'rollback',
sourceRunId: 'historical-run',
});
await service.execute(run, project);
expect(jenkins.buildWithParameters).toHaveBeenCalledWith(
expect.any(String),
expect.objectContaining({ DEPLOY_COMMIT: 'a'.repeat(40) }),
);
expect(
(await repository.findByOperationKey('pinned-rollback'))?.resolvedCommit,
).toBe('a'.repeat(40));
});
it('syncs a queued Jenkins run to success', async () => {
const { audit, repository, service } = createService({
jenkinsHealth: { status: 'ok' },