plugin-workflow-ci 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client-v2.js +1 -0
- package/client.js +1 -0
- package/dist/client/index.js +10 -0
- package/dist/client-v2/index.js +10 -0
- package/dist/externalVersion.js +21 -0
- package/dist/index.js +48 -0
- package/dist/locale/en-US.json +105 -0
- package/dist/locale/vi-VN.json +105 -0
- package/dist/locale/zh-CN.json +105 -0
- package/dist/server/actions/ci-manager.js +307 -0
- package/dist/server/collections/ci-gate-runs.js +85 -0
- package/dist/server/collections/ci-git-feedback-outbox.js +51 -0
- package/dist/server/collections/ci-pipelines.js +88 -0
- package/dist/server/index.js +62 -0
- package/dist/server/instructions/CiInstructions.js +180 -0
- package/dist/server/migrations/20261206000001-harden-workflow-ci-v020.js +91 -0
- package/dist/server/plugin.js +255 -0
- package/dist/server/services/AiTriageService.js +215 -0
- package/dist/server/services/CiGateWorkflowService.js +1776 -0
- package/dist/server/services/EphemeralContainerService.js +891 -0
- package/dist/server/services/GitFeedbackService.js +995 -0
- package/dist/server/services/constants-internal.js +65 -0
- package/dist/shared/collection-schemas.js +125 -0
- package/dist/shared/constants.js +120 -0
- package/dist/shared/runtime-context.js +67 -0
- package/dist/shared/types.js +24 -0
- package/dist/shared/ui/CiPipelinesSettingsView.js +700 -0
- package/package.json +58 -4
- package/server.js +1 -0
- package/src/client/index.tsx +10 -0
- package/src/client/locale.ts +31 -0
- package/src/client/plugin.tsx +62 -0
- package/src/client/workflow.tsx +119 -0
- package/src/client-v2/index.tsx +10 -0
- package/src/client-v2/locale.ts +32 -0
- package/src/client-v2/plugin.tsx +77 -0
- package/src/client-v2/workflow.tsx +124 -0
- package/src/index.ts +11 -0
- package/src/locale/en-US.json +105 -0
- package/src/locale/vi-VN.json +105 -0
- package/src/locale/zh-CN.json +105 -0
- package/src/server/actions/ci-manager.ts +377 -0
- package/src/server/collections/ci-gate-runs.ts +65 -0
- package/src/server/collections/ci-git-feedback-outbox.ts +31 -0
- package/src/server/collections/ci-pipelines.ts +68 -0
- package/src/server/index.ts +17 -0
- package/src/server/instructions/CiInstructions.ts +180 -0
- package/src/server/migrations/20261206000001-harden-workflow-ci-v020.ts +78 -0
- package/src/server/plugin.ts +274 -0
- package/src/server/services/AiTriageService.ts +254 -0
- package/src/server/services/CiGateWorkflowService.ts +2310 -0
- package/src/server/services/EphemeralContainerService.ts +1170 -0
- package/src/server/services/GitFeedbackService.ts +1224 -0
- package/src/server/services/constants-internal.ts +27 -0
- package/src/shared/collection-schemas.ts +98 -0
- package/src/shared/constants.ts +50 -0
- package/src/shared/runtime-context.tsx +55 -0
- package/src/shared/types.ts +203 -0
- package/src/shared/ui/CiPipelinesSettingsView.tsx +1035 -0
- package/README.md +0 -3
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
CI_GATE_RUNS_COLLECTION,
|
|
12
|
+
CI_GIT_FEEDBACK_OUTBOX_COLLECTION,
|
|
13
|
+
CI_INSTRUCTIONS,
|
|
14
|
+
CI_MANAGED_WORKFLOW_KEY,
|
|
15
|
+
CI_MR_POLL_INTERVAL_MS,
|
|
16
|
+
CI_PIPELINES_COLLECTION,
|
|
17
|
+
CI_RECONCILE_INTERVAL_MS,
|
|
18
|
+
CI_WORKFLOW_TEMPLATE_MARKER,
|
|
19
|
+
CI_WORKFLOW_TEMPLATE_VERSION,
|
|
20
|
+
DEFAULT_CI_TIMEOUT_MS,
|
|
21
|
+
PORTAINER_PIPELINE_RUNS_COLLECTION,
|
|
22
|
+
PORTAINER_PIPELINES_COLLECTION,
|
|
23
|
+
TEST_RUNS_COLLECTION,
|
|
24
|
+
TEST_TENANTS_COLLECTION,
|
|
25
|
+
} from '../../shared/constants';
|
|
26
|
+
|
|
27
|
+
export const TEST_MANAGER_RESOURCE_FALLBACK = 'testManager';
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { CI_GATE_RUNS_COLLECTION, CI_PIPELINES_COLLECTION } from './constants';
|
|
11
|
+
|
|
12
|
+
export const ciPipelinesCollectionSchema = {
|
|
13
|
+
name: CI_PIPELINES_COLLECTION,
|
|
14
|
+
title: 'CI Pipelines',
|
|
15
|
+
autoGenId: true,
|
|
16
|
+
fields: [
|
|
17
|
+
{ name: 'id', type: 'bigInt', interface: 'id' },
|
|
18
|
+
{ name: 'key', type: 'string', interface: 'input' },
|
|
19
|
+
{ name: 'name', type: 'string', interface: 'input' },
|
|
20
|
+
{ name: 'enabled', type: 'boolean', interface: 'checkbox' },
|
|
21
|
+
{ name: 'tenantId', type: 'bigInt', interface: 'integer' },
|
|
22
|
+
{ name: 'gitRepositoryId', type: 'bigInt', interface: 'integer' },
|
|
23
|
+
{ name: 'branchPattern', type: 'string', interface: 'input' },
|
|
24
|
+
{ name: 'protectedBranches', type: 'json', interface: 'json' },
|
|
25
|
+
{ name: 'triggerOnPush', type: 'boolean', interface: 'checkbox' },
|
|
26
|
+
{ name: 'triggerOnMergeRequest', type: 'boolean', interface: 'checkbox' },
|
|
27
|
+
{ name: 'pollMergeRequests', type: 'boolean', interface: 'checkbox' },
|
|
28
|
+
{ name: 'runnerBackend', type: 'string', interface: 'select' },
|
|
29
|
+
{ name: 'portainerInstanceId', type: 'bigInt', interface: 'integer' },
|
|
30
|
+
{ name: 'portainerEndpointId', type: 'bigInt', interface: 'integer' },
|
|
31
|
+
{ name: 'runnerImage', type: 'string', interface: 'input' },
|
|
32
|
+
{ name: 'runnerCommand', type: 'text', interface: 'textarea' },
|
|
33
|
+
{ name: 'runnerNetwork', type: 'string', interface: 'input' },
|
|
34
|
+
{ name: 'runnerEnv', type: 'json', interface: 'json' },
|
|
35
|
+
{ name: 'runnerTimeoutMs', type: 'integer', interface: 'integer' },
|
|
36
|
+
{ name: 'qaInstanceId', type: 'bigInt', interface: 'integer' },
|
|
37
|
+
{ name: 'qaEndpointId', type: 'bigInt', interface: 'integer' },
|
|
38
|
+
{ name: 'qaStackId', type: 'bigInt', interface: 'integer' },
|
|
39
|
+
{ name: 'qaAppServices', type: 'json', interface: 'json' },
|
|
40
|
+
{ name: 'publishCommitStatus', type: 'boolean', interface: 'checkbox' },
|
|
41
|
+
{ name: 'statusContext', type: 'string', interface: 'input' },
|
|
42
|
+
{ name: 'publishPrComment', type: 'boolean', interface: 'checkbox' },
|
|
43
|
+
{ name: 'enrichGitReview', type: 'boolean', interface: 'checkbox' },
|
|
44
|
+
{ name: 'portainerPipelineId', type: 'bigInt', interface: 'integer' },
|
|
45
|
+
{ name: 'deployStackId', type: 'bigInt', interface: 'integer' },
|
|
46
|
+
{ name: 'deployEndpointId', type: 'bigInt', interface: 'integer' },
|
|
47
|
+
{ name: 'deployInstanceId', type: 'bigInt', interface: 'integer' },
|
|
48
|
+
{ name: 'deployGateMode', type: 'string', interface: 'select' },
|
|
49
|
+
{ name: 'gateApproverIds', type: 'json', interface: 'json' },
|
|
50
|
+
{ name: 'dbBackwardCompatible', type: 'boolean', interface: 'checkbox' },
|
|
51
|
+
{ name: 'promotionHalted', type: 'boolean', interface: 'checkbox' },
|
|
52
|
+
{ name: 'promotionHaltReason', type: 'text', interface: 'textarea' },
|
|
53
|
+
{ name: 'lastKnownGoodSnapshot', type: 'json', interface: 'json' },
|
|
54
|
+
{ name: 'enableAiTriage', type: 'boolean', interface: 'checkbox' },
|
|
55
|
+
{ name: 'agentLoopPatternKey', type: 'string', interface: 'input' },
|
|
56
|
+
{ name: 'smokeOnClusterHotReload', type: 'boolean', interface: 'checkbox' },
|
|
57
|
+
],
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const ciGateRunsCollectionSchema = {
|
|
61
|
+
name: CI_GATE_RUNS_COLLECTION,
|
|
62
|
+
title: 'CI Gate Runs',
|
|
63
|
+
autoGenId: true,
|
|
64
|
+
fields: [
|
|
65
|
+
{ name: 'id', type: 'bigInt', interface: 'id' },
|
|
66
|
+
{ name: 'pipelineId', type: 'bigInt', interface: 'integer' },
|
|
67
|
+
{ name: 'tenantId', type: 'bigInt', interface: 'integer' },
|
|
68
|
+
{ name: 'testRunId', type: 'bigInt', interface: 'integer' },
|
|
69
|
+
{ name: 'buildRunId', type: 'bigInt', interface: 'integer' },
|
|
70
|
+
{ name: 'operationId', type: 'string', interface: 'input' },
|
|
71
|
+
{ name: 'gitRepositoryId', type: 'bigInt', interface: 'integer' },
|
|
72
|
+
{ name: 'eventType', type: 'string', interface: 'select' },
|
|
73
|
+
{ name: 'branch', type: 'string', interface: 'input' },
|
|
74
|
+
{ name: 'targetBranch', type: 'string', interface: 'input' },
|
|
75
|
+
{ name: 'commitSha', type: 'string', interface: 'input' },
|
|
76
|
+
{ name: 'baseSha', type: 'string', interface: 'input' },
|
|
77
|
+
{ name: 'mrIid', type: 'bigInt', interface: 'integer' },
|
|
78
|
+
{ name: 'state', type: 'string', interface: 'select' },
|
|
79
|
+
{ name: 'testVerdict', type: 'string', interface: 'input' },
|
|
80
|
+
{ name: 'verdictReasonCode', type: 'string', interface: 'input' },
|
|
81
|
+
{ name: 'approvalState', type: 'string', interface: 'select' },
|
|
82
|
+
{ name: 'approvalRecord', type: 'json', interface: 'json' },
|
|
83
|
+
{ name: 'deployOutcome', type: 'string', interface: 'select' },
|
|
84
|
+
{ name: 'rollbackRecord', type: 'json', interface: 'json' },
|
|
85
|
+
{ name: 'commitStatusState', type: 'string', interface: 'select' },
|
|
86
|
+
{ name: 'gitFeedbackSyncState', type: 'string', interface: 'select' },
|
|
87
|
+
{ name: 'prCommentId', type: 'string', interface: 'input' },
|
|
88
|
+
{ name: 'ephemeralContainerId', type: 'string', interface: 'input' },
|
|
89
|
+
{ name: 'deployTargetSummary', type: 'json', interface: 'json' },
|
|
90
|
+
{ name: 'triageResult', type: 'json', interface: 'json' },
|
|
91
|
+
{ name: 'errorMessage', type: 'text', interface: 'textarea' },
|
|
92
|
+
{ name: 'startedAt', type: 'date', interface: 'datetime' },
|
|
93
|
+
{ name: 'finishedAt', type: 'date', interface: 'datetime' },
|
|
94
|
+
{ name: 'durationMs', type: 'integer', interface: 'integer' },
|
|
95
|
+
],
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const allWorkflowCiCollections = [ciPipelinesCollectionSchema, ciGateRunsCollectionSchema];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export const NAMESPACE = 'plugin-workflow-ci';
|
|
11
|
+
export const CI_MANAGER_RESOURCE = 'ciManager';
|
|
12
|
+
export const CI_MANAGER_ACL_SNIPPET = 'pm.plugin-workflow-ci';
|
|
13
|
+
|
|
14
|
+
export const CI_PIPELINES_COLLECTION = 'ciPipelines';
|
|
15
|
+
export const CI_GATE_RUNS_COLLECTION = 'ciGateRuns';
|
|
16
|
+
export const CI_GIT_FEEDBACK_OUTBOX_COLLECTION = 'ciGitFeedbackOutbox';
|
|
17
|
+
|
|
18
|
+
export const CI_MANAGED_WORKFLOW_KEY = 'workflow-ci-gate-pipeline';
|
|
19
|
+
export const CI_WORKFLOW_TEMPLATE_MARKER = 'workflowCiManaged';
|
|
20
|
+
export const CI_WORKFLOW_TEMPLATE_VERSION = 2;
|
|
21
|
+
export const CI_WORKFLOW_GROUP_KEY = 'extended';
|
|
22
|
+
|
|
23
|
+
export const CI_INSTRUCTIONS = {
|
|
24
|
+
dispatchRun: 'ci-dispatch-run',
|
|
25
|
+
aiTriage: 'ci-ai-triage',
|
|
26
|
+
publishGitFeedback: 'ci-publish-git-feedback',
|
|
27
|
+
waitApproval: 'ci-wait-approval',
|
|
28
|
+
promoteDeploy: 'ci-promote-deploy',
|
|
29
|
+
} as const;
|
|
30
|
+
|
|
31
|
+
export const TEST_TENANTS_COLLECTION = 'testTenants';
|
|
32
|
+
export const TEST_RUNS_COLLECTION = 'testRuns';
|
|
33
|
+
export const TEST_CASE_RESULTS_COLLECTION = 'testCaseResults';
|
|
34
|
+
export const TEST_RUN_COMPLETED_EVENT = 'test-manager:run-completed';
|
|
35
|
+
|
|
36
|
+
export const GIT_REPOSITORIES_COLLECTION = 'gitRepositories';
|
|
37
|
+
export const GIT_ACCOUNTS_COLLECTION = 'gitAccounts';
|
|
38
|
+
export const GIT_REVIEW_REQUESTS_COLLECTION = 'gitReviewRequests';
|
|
39
|
+
|
|
40
|
+
export const PORTAINER_INSTANCES_COLLECTION = 'portainerInstances';
|
|
41
|
+
export const PORTAINER_PIPELINES_COLLECTION = 'portainerGitPipelines';
|
|
42
|
+
export const PORTAINER_PIPELINE_RUNS_COLLECTION = 'portainerGitPipelineRuns';
|
|
43
|
+
|
|
44
|
+
export const AGENT_LOOP_PATTERNS_COLLECTION = 'agentLoopPatterns';
|
|
45
|
+
export const AGENT_LOOP_RUNS_COLLECTION = 'agentLoopRuns';
|
|
46
|
+
|
|
47
|
+
export const SECRET_MASK = '••••••••';
|
|
48
|
+
export const DEFAULT_CI_TIMEOUT_MS = 600_000;
|
|
49
|
+
export const CI_RECONCILE_INTERVAL_MS = 30_000;
|
|
50
|
+
export const CI_MR_POLL_INTERVAL_MS = 120_000;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import React, { createContext, useContext } from 'react';
|
|
11
|
+
|
|
12
|
+
export interface CiHttpRequestConfig {
|
|
13
|
+
url: string;
|
|
14
|
+
method?: 'get' | 'post' | 'put' | 'delete' | 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
15
|
+
params?: Record<string, unknown>;
|
|
16
|
+
data?: unknown;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface WorkflowCiApiLike {
|
|
20
|
+
request<T = { data?: unknown }>(config: CiHttpRequestConfig): Promise<{ data: T }>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type TranslateFn = (key: string, options?: Record<string, unknown>) => string;
|
|
24
|
+
|
|
25
|
+
export interface WorkflowCiRuntimeContextValue {
|
|
26
|
+
api: WorkflowCiApiLike;
|
|
27
|
+
t: TranslateFn;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const defaultTranslate: TranslateFn = (key, options) => {
|
|
31
|
+
if (!options) return key;
|
|
32
|
+
return key.replace(/\{\{\s*(\w+)\s*\}\}/g, (_, token: string) => {
|
|
33
|
+
const val = options[token];
|
|
34
|
+
return val === undefined || val === null ? '' : String(val);
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const CiRuntimeContext = createContext<WorkflowCiRuntimeContextValue | null>(null);
|
|
39
|
+
|
|
40
|
+
export const WorkflowCiRuntimeProvider: React.FC<{
|
|
41
|
+
api: WorkflowCiApiLike;
|
|
42
|
+
t?: TranslateFn;
|
|
43
|
+
children: React.ReactNode;
|
|
44
|
+
}> = ({ api, t = defaultTranslate, children }) => {
|
|
45
|
+
const value = React.useMemo(() => ({ api, t }), [api, t]);
|
|
46
|
+
return <CiRuntimeContext.Provider value={value}>{children}</CiRuntimeContext.Provider>;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export function useWorkflowCiRuntime(): WorkflowCiRuntimeContextValue {
|
|
50
|
+
const ctx = useContext(CiRuntimeContext);
|
|
51
|
+
if (!ctx) {
|
|
52
|
+
throw new Error('useWorkflowCiRuntime must be used inside WorkflowCiRuntimeProvider');
|
|
53
|
+
}
|
|
54
|
+
return ctx;
|
|
55
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export type ID = string | number;
|
|
11
|
+
|
|
12
|
+
export type CiRunnerBackend = 'external_ci' | 'portainer_ephemeral' | 'cluster_ephemeral' | 'test_manager_default';
|
|
13
|
+
|
|
14
|
+
export type CiDeployGateMode = 'none' | 'gate_deploy' | 'manual_on_diff_mismatch';
|
|
15
|
+
|
|
16
|
+
export type CiEventType = 'push' | 'merge_request' | 'pre_deploy_gate' | 'hot_reload_smoke' | 'manual';
|
|
17
|
+
|
|
18
|
+
export type CiGateRunState =
|
|
19
|
+
| 'queued'
|
|
20
|
+
| 'running_ci'
|
|
21
|
+
| 'triaging'
|
|
22
|
+
| 'publishing_feedback'
|
|
23
|
+
| 'waiting_approval'
|
|
24
|
+
| 'promoting_deploy'
|
|
25
|
+
| 'succeeded'
|
|
26
|
+
| 'failed'
|
|
27
|
+
| 'canceled';
|
|
28
|
+
|
|
29
|
+
export type CiApprovalState = 'not_required' | 'pending' | 'approved' | 'rejected' | 'invalidated';
|
|
30
|
+
|
|
31
|
+
export type CiDeployOutcome =
|
|
32
|
+
| 'not_applicable'
|
|
33
|
+
| 'pending'
|
|
34
|
+
| 'deployed'
|
|
35
|
+
| 'blocked'
|
|
36
|
+
| 'failed'
|
|
37
|
+
| 'rolled_back'
|
|
38
|
+
| 'ops_intervention_required';
|
|
39
|
+
|
|
40
|
+
export type GitCommitStatusState = 'pending' | 'success' | 'failure' | 'error';
|
|
41
|
+
|
|
42
|
+
export interface CiTriageSummary {
|
|
43
|
+
classification: 'code_regression' | 'baseline_change' | 'flaky_or_infra' | 'unknown';
|
|
44
|
+
confidence: number;
|
|
45
|
+
rootCause: string;
|
|
46
|
+
suggestedAction: string;
|
|
47
|
+
suspectedFiles?: string[];
|
|
48
|
+
agentDispatched?: boolean;
|
|
49
|
+
agentLoopRunId?: number | null;
|
|
50
|
+
triageError?: string | null;
|
|
51
|
+
analyzedAt: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface CiApprovalRecord {
|
|
55
|
+
approvedByUserId?: number | null;
|
|
56
|
+
approvedBy?: string | null;
|
|
57
|
+
approvedAt?: string | null;
|
|
58
|
+
approvedCommitSha?: string | null;
|
|
59
|
+
approvedBuildRunId?: number | null;
|
|
60
|
+
approvedBaselineVersions?: Record<string, number> | null;
|
|
61
|
+
originalDiffHash?: string | null;
|
|
62
|
+
invalidatedAt?: string | null;
|
|
63
|
+
invalidatedReason?: string | null;
|
|
64
|
+
invalidatedByCommitSha?: string | null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface CiVerifiedAppImage {
|
|
68
|
+
containerId?: string;
|
|
69
|
+
containerName?: string;
|
|
70
|
+
serviceName?: string;
|
|
71
|
+
imageRef: string;
|
|
72
|
+
imageId: string;
|
|
73
|
+
repoDigest?: string | null;
|
|
74
|
+
healthy?: boolean;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface CiLastKnownGoodSnapshot {
|
|
78
|
+
capturedAt: string;
|
|
79
|
+
stackId: number;
|
|
80
|
+
stackName: string;
|
|
81
|
+
endpointId: number;
|
|
82
|
+
instanceId?: number | null;
|
|
83
|
+
stackFileContent: string;
|
|
84
|
+
env: Array<{ name: string; value: string }>;
|
|
85
|
+
desiredReplicas: number;
|
|
86
|
+
verifiedImageTag?: string | null;
|
|
87
|
+
dockerDaemonId?: string | null;
|
|
88
|
+
verifiedAppImages: CiVerifiedAppImage[];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface CiRollbackRecord {
|
|
92
|
+
triggeredAt: string;
|
|
93
|
+
reason: string;
|
|
94
|
+
eligible: boolean;
|
|
95
|
+
dbBackwardCompatible: boolean;
|
|
96
|
+
restoredFromCapturedAt?: string | null;
|
|
97
|
+
rollbackSucceeded: boolean;
|
|
98
|
+
rollbackVerifiedAt?: string | null;
|
|
99
|
+
detail: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface CiPipelineRecord {
|
|
103
|
+
id: number;
|
|
104
|
+
key: string;
|
|
105
|
+
name: string;
|
|
106
|
+
enabled: boolean;
|
|
107
|
+
tenantId: number;
|
|
108
|
+
gitRepositoryId?: number | null;
|
|
109
|
+
branchPattern?: string | null;
|
|
110
|
+
protectedBranches?: string[] | null;
|
|
111
|
+
triggerOnPush: boolean;
|
|
112
|
+
triggerOnMergeRequest: boolean;
|
|
113
|
+
pollMergeRequests: boolean;
|
|
114
|
+
webhookSecret?: string | null;
|
|
115
|
+
runnerBackend: CiRunnerBackend;
|
|
116
|
+
portainerInstanceId?: number | null;
|
|
117
|
+
portainerEndpointId?: number | null;
|
|
118
|
+
runnerImage?: string | null;
|
|
119
|
+
runnerCommand?: string | null;
|
|
120
|
+
runnerNetwork?: string | null;
|
|
121
|
+
runnerEnv?: Record<string, string> | null;
|
|
122
|
+
runnerTimeoutMs?: number | null;
|
|
123
|
+
qaInstanceId?: number | null;
|
|
124
|
+
qaEndpointId?: number | null;
|
|
125
|
+
qaStackId?: number | null;
|
|
126
|
+
qaAppServices?: string[] | null;
|
|
127
|
+
publishCommitStatus: boolean;
|
|
128
|
+
statusContext: string;
|
|
129
|
+
publishPrComment: boolean;
|
|
130
|
+
enrichGitReview: boolean;
|
|
131
|
+
portainerPipelineId?: number | null;
|
|
132
|
+
deployStackId?: number | null;
|
|
133
|
+
deployEndpointId?: number | null;
|
|
134
|
+
deployInstanceId?: number | null;
|
|
135
|
+
deployGateMode: CiDeployGateMode;
|
|
136
|
+
gateApproverIds?: number[] | null;
|
|
137
|
+
dbBackwardCompatible?: boolean;
|
|
138
|
+
promotionHalted?: boolean;
|
|
139
|
+
promotionHaltReason?: string | null;
|
|
140
|
+
lastKnownGoodSnapshot?: CiLastKnownGoodSnapshot | null;
|
|
141
|
+
enableAiTriage: boolean;
|
|
142
|
+
agentLoopPatternKey?: string | null;
|
|
143
|
+
smokeOnClusterHotReload: boolean;
|
|
144
|
+
lastPolledMrHeads?: Record<string, string> | null;
|
|
145
|
+
createdAt?: string;
|
|
146
|
+
updatedAt?: string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface CiGateRunRecord {
|
|
150
|
+
id: number;
|
|
151
|
+
pipelineId: number;
|
|
152
|
+
tenantId: number;
|
|
153
|
+
testRunId?: number | null;
|
|
154
|
+
buildRunId?: number | null;
|
|
155
|
+
operationId?: string | null;
|
|
156
|
+
gitRepositoryId?: number | null;
|
|
157
|
+
eventType: CiEventType;
|
|
158
|
+
branch: string;
|
|
159
|
+
targetBranch?: string | null;
|
|
160
|
+
commitSha: string;
|
|
161
|
+
baseSha?: string | null;
|
|
162
|
+
commitMessage?: string | null;
|
|
163
|
+
mrIid?: number | null;
|
|
164
|
+
workflowKey?: string | null;
|
|
165
|
+
workflowId?: number | null;
|
|
166
|
+
executionId?: number | null;
|
|
167
|
+
pendingJobId?: number | null;
|
|
168
|
+
state: CiGateRunState;
|
|
169
|
+
testVerdict?: string | null;
|
|
170
|
+
verdictReasonCode?: string | null;
|
|
171
|
+
approvalState?: CiApprovalState | null;
|
|
172
|
+
approvalRecord?: CiApprovalRecord | null;
|
|
173
|
+
deployOutcome?: CiDeployOutcome | null;
|
|
174
|
+
rollbackRecord?: CiRollbackRecord | null;
|
|
175
|
+
commitStatusState?: GitCommitStatusState | null;
|
|
176
|
+
gitFeedbackSyncState?: 'synced' | 'retrying' | 'failed' | 'not_applicable' | null;
|
|
177
|
+
prCommentId?: string | null;
|
|
178
|
+
ephemeralContainerId?: string | null;
|
|
179
|
+
deployTargetSummary?: Record<string, unknown> | null;
|
|
180
|
+
triageResult?: CiTriageSummary | null;
|
|
181
|
+
logs?: string | null;
|
|
182
|
+
errorMessage?: string | null;
|
|
183
|
+
startedAt?: string | null;
|
|
184
|
+
finishedAt?: string | null;
|
|
185
|
+
durationMs?: number | null;
|
|
186
|
+
createdAt?: string;
|
|
187
|
+
updatedAt?: string;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export interface ParsedGitWebhookEvent {
|
|
191
|
+
provider: 'github' | 'gitlab';
|
|
192
|
+
eventType: 'push' | 'merge_request' | 'ignored';
|
|
193
|
+
repoUrl?: string;
|
|
194
|
+
projectPath?: string;
|
|
195
|
+
branch: string;
|
|
196
|
+
targetBranch?: string | null;
|
|
197
|
+
commitSha: string;
|
|
198
|
+
baseSha?: string | null;
|
|
199
|
+
commitMessage?: string | null;
|
|
200
|
+
mrIid?: number | null;
|
|
201
|
+
sender?: string | null;
|
|
202
|
+
reason?: string;
|
|
203
|
+
}
|