feat: 接入真实登录与成员权限

- auth/members/messages: 新增超级管理员登录、成员权限和密码消息流程
- agent-config/agent: 支持服务端保存 Agent 配置并取消未配置 mock 成功结果
- projects/deploy-runs/settings: 按当前用户权限保护真实接口
- prisma: 新增用户、项目权限和平台消息表结构
This commit is contained in:
湛兮
2026-06-12 00:38:23 +08:00
parent cf1bebf625
commit bc3aa31289
83 changed files with 3844 additions and 378 deletions
@@ -121,10 +121,10 @@ describe('DeployExecutionService', () => {
};
}
function createRun(
async function createRun(
repository: DeployRunRepository,
idempotencyKey: string,
): DeployRunSummary {
): Promise<DeployRunSummary> {
return repository.create({
...input,
idempotencyKey,
@@ -143,7 +143,7 @@ describe('DeployExecutionService', () => {
},
notificationStatus: 'skipped',
});
const run = createRun(repository, 'run_dry_001');
const run = await createRun(repository, 'run_dry_001');
const result = await service.execute(run, project);
@@ -169,7 +169,7 @@ describe('DeployExecutionService', () => {
notificationStatus: 'sent',
queueId: 'jenkins_queue_42',
});
const run = createRun(repository, 'run_queue_001');
const run = await createRun(repository, 'run_queue_001');
const result = await service.execute(run, project);
@@ -207,7 +207,10 @@ describe('DeployExecutionService', () => {
queueBuildNumber: 18,
buildResult: 'SUCCESS',
});
const run = await service.execute(createRun(repository, 'run_success_001'), project);
const run = await service.execute(
await createRun(repository, 'run_success_001'),
project,
);
const result = await service.syncJenkinsRun(run, project);
@@ -234,15 +237,18 @@ describe('DeployExecutionService', () => {
buildResult: 'FAILURE',
logText: ['install ok', 'build failed', 'token=secret-value'].join('\n'),
});
const run = await service.execute(createRun(repository, 'run_failure_001'), project);
const run = await service.execute(
await createRun(repository, 'run_failure_001'),
project,
);
const result = await service.syncJenkinsRun(run, project);
expect(result.status).toBe('failed');
expect(result.failureSummary).toBe('Jenkins build #19 FAILURE');
expect(result.failureSummary).toBe('Jenkins 构建 #19 FAILURE');
expect(step(result, 'jenkins-build')?.status).toBe('failed');
expect(step(result, 'jenkins-build')?.errorSummary).toBe(
'Jenkins build #19 FAILURE',
'Jenkins 构建 #19 FAILURE',
);
expect(step(result, 'jenkins-build')?.logExcerpt).toContain('build failed');
expect(step(result, 'notify-wecom')?.status).toBe('skipped');