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.
Files changed (60) hide show
  1. package/client-v2.js +1 -0
  2. package/client.js +1 -0
  3. package/dist/client/index.js +10 -0
  4. package/dist/client-v2/index.js +10 -0
  5. package/dist/externalVersion.js +21 -0
  6. package/dist/index.js +48 -0
  7. package/dist/locale/en-US.json +105 -0
  8. package/dist/locale/vi-VN.json +105 -0
  9. package/dist/locale/zh-CN.json +105 -0
  10. package/dist/server/actions/ci-manager.js +307 -0
  11. package/dist/server/collections/ci-gate-runs.js +85 -0
  12. package/dist/server/collections/ci-git-feedback-outbox.js +51 -0
  13. package/dist/server/collections/ci-pipelines.js +88 -0
  14. package/dist/server/index.js +62 -0
  15. package/dist/server/instructions/CiInstructions.js +180 -0
  16. package/dist/server/migrations/20261206000001-harden-workflow-ci-v020.js +91 -0
  17. package/dist/server/plugin.js +255 -0
  18. package/dist/server/services/AiTriageService.js +215 -0
  19. package/dist/server/services/CiGateWorkflowService.js +1776 -0
  20. package/dist/server/services/EphemeralContainerService.js +891 -0
  21. package/dist/server/services/GitFeedbackService.js +995 -0
  22. package/dist/server/services/constants-internal.js +65 -0
  23. package/dist/shared/collection-schemas.js +125 -0
  24. package/dist/shared/constants.js +120 -0
  25. package/dist/shared/runtime-context.js +67 -0
  26. package/dist/shared/types.js +24 -0
  27. package/dist/shared/ui/CiPipelinesSettingsView.js +700 -0
  28. package/package.json +58 -4
  29. package/server.js +1 -0
  30. package/src/client/index.tsx +10 -0
  31. package/src/client/locale.ts +31 -0
  32. package/src/client/plugin.tsx +62 -0
  33. package/src/client/workflow.tsx +119 -0
  34. package/src/client-v2/index.tsx +10 -0
  35. package/src/client-v2/locale.ts +32 -0
  36. package/src/client-v2/plugin.tsx +77 -0
  37. package/src/client-v2/workflow.tsx +124 -0
  38. package/src/index.ts +11 -0
  39. package/src/locale/en-US.json +105 -0
  40. package/src/locale/vi-VN.json +105 -0
  41. package/src/locale/zh-CN.json +105 -0
  42. package/src/server/actions/ci-manager.ts +377 -0
  43. package/src/server/collections/ci-gate-runs.ts +65 -0
  44. package/src/server/collections/ci-git-feedback-outbox.ts +31 -0
  45. package/src/server/collections/ci-pipelines.ts +68 -0
  46. package/src/server/index.ts +17 -0
  47. package/src/server/instructions/CiInstructions.ts +180 -0
  48. package/src/server/migrations/20261206000001-harden-workflow-ci-v020.ts +78 -0
  49. package/src/server/plugin.ts +274 -0
  50. package/src/server/services/AiTriageService.ts +254 -0
  51. package/src/server/services/CiGateWorkflowService.ts +2310 -0
  52. package/src/server/services/EphemeralContainerService.ts +1170 -0
  53. package/src/server/services/GitFeedbackService.ts +1224 -0
  54. package/src/server/services/constants-internal.ts +27 -0
  55. package/src/shared/collection-schemas.ts +98 -0
  56. package/src/shared/constants.ts +50 -0
  57. package/src/shared/runtime-context.tsx +55 -0
  58. package/src/shared/types.ts +203 -0
  59. package/src/shared/ui/CiPipelinesSettingsView.tsx +1035 -0
  60. package/README.md +0 -3
@@ -0,0 +1,65 @@
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
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var constants_internal_exports = {};
28
+ __export(constants_internal_exports, {
29
+ CI_GATE_RUNS_COLLECTION: () => import_constants.CI_GATE_RUNS_COLLECTION,
30
+ CI_GIT_FEEDBACK_OUTBOX_COLLECTION: () => import_constants.CI_GIT_FEEDBACK_OUTBOX_COLLECTION,
31
+ CI_INSTRUCTIONS: () => import_constants.CI_INSTRUCTIONS,
32
+ CI_MANAGED_WORKFLOW_KEY: () => import_constants.CI_MANAGED_WORKFLOW_KEY,
33
+ CI_MR_POLL_INTERVAL_MS: () => import_constants.CI_MR_POLL_INTERVAL_MS,
34
+ CI_PIPELINES_COLLECTION: () => import_constants.CI_PIPELINES_COLLECTION,
35
+ CI_RECONCILE_INTERVAL_MS: () => import_constants.CI_RECONCILE_INTERVAL_MS,
36
+ CI_WORKFLOW_TEMPLATE_MARKER: () => import_constants.CI_WORKFLOW_TEMPLATE_MARKER,
37
+ CI_WORKFLOW_TEMPLATE_VERSION: () => import_constants.CI_WORKFLOW_TEMPLATE_VERSION,
38
+ DEFAULT_CI_TIMEOUT_MS: () => import_constants.DEFAULT_CI_TIMEOUT_MS,
39
+ PORTAINER_PIPELINES_COLLECTION: () => import_constants.PORTAINER_PIPELINES_COLLECTION,
40
+ PORTAINER_PIPELINE_RUNS_COLLECTION: () => import_constants.PORTAINER_PIPELINE_RUNS_COLLECTION,
41
+ TEST_MANAGER_RESOURCE_FALLBACK: () => TEST_MANAGER_RESOURCE_FALLBACK,
42
+ TEST_RUNS_COLLECTION: () => import_constants.TEST_RUNS_COLLECTION,
43
+ TEST_TENANTS_COLLECTION: () => import_constants.TEST_TENANTS_COLLECTION
44
+ });
45
+ module.exports = __toCommonJS(constants_internal_exports);
46
+ var import_constants = require("../../shared/constants");
47
+ const TEST_MANAGER_RESOURCE_FALLBACK = "testManager";
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {
50
+ CI_GATE_RUNS_COLLECTION,
51
+ CI_GIT_FEEDBACK_OUTBOX_COLLECTION,
52
+ CI_INSTRUCTIONS,
53
+ CI_MANAGED_WORKFLOW_KEY,
54
+ CI_MR_POLL_INTERVAL_MS,
55
+ CI_PIPELINES_COLLECTION,
56
+ CI_RECONCILE_INTERVAL_MS,
57
+ CI_WORKFLOW_TEMPLATE_MARKER,
58
+ CI_WORKFLOW_TEMPLATE_VERSION,
59
+ DEFAULT_CI_TIMEOUT_MS,
60
+ PORTAINER_PIPELINES_COLLECTION,
61
+ PORTAINER_PIPELINE_RUNS_COLLECTION,
62
+ TEST_MANAGER_RESOURCE_FALLBACK,
63
+ TEST_RUNS_COLLECTION,
64
+ TEST_TENANTS_COLLECTION
65
+ });
@@ -0,0 +1,125 @@
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
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var collection_schemas_exports = {};
28
+ __export(collection_schemas_exports, {
29
+ allWorkflowCiCollections: () => allWorkflowCiCollections,
30
+ ciGateRunsCollectionSchema: () => ciGateRunsCollectionSchema,
31
+ ciPipelinesCollectionSchema: () => ciPipelinesCollectionSchema
32
+ });
33
+ module.exports = __toCommonJS(collection_schemas_exports);
34
+ var import_constants = require("./constants");
35
+ const ciPipelinesCollectionSchema = {
36
+ name: import_constants.CI_PIPELINES_COLLECTION,
37
+ title: "CI Pipelines",
38
+ autoGenId: true,
39
+ fields: [
40
+ { name: "id", type: "bigInt", interface: "id" },
41
+ { name: "key", type: "string", interface: "input" },
42
+ { name: "name", type: "string", interface: "input" },
43
+ { name: "enabled", type: "boolean", interface: "checkbox" },
44
+ { name: "tenantId", type: "bigInt", interface: "integer" },
45
+ { name: "gitRepositoryId", type: "bigInt", interface: "integer" },
46
+ { name: "branchPattern", type: "string", interface: "input" },
47
+ { name: "protectedBranches", type: "json", interface: "json" },
48
+ { name: "triggerOnPush", type: "boolean", interface: "checkbox" },
49
+ { name: "triggerOnMergeRequest", type: "boolean", interface: "checkbox" },
50
+ { name: "pollMergeRequests", type: "boolean", interface: "checkbox" },
51
+ { name: "runnerBackend", type: "string", interface: "select" },
52
+ { name: "portainerInstanceId", type: "bigInt", interface: "integer" },
53
+ { name: "portainerEndpointId", type: "bigInt", interface: "integer" },
54
+ { name: "runnerImage", type: "string", interface: "input" },
55
+ { name: "runnerCommand", type: "text", interface: "textarea" },
56
+ { name: "runnerNetwork", type: "string", interface: "input" },
57
+ { name: "runnerEnv", type: "json", interface: "json" },
58
+ { name: "runnerTimeoutMs", type: "integer", interface: "integer" },
59
+ { name: "qaInstanceId", type: "bigInt", interface: "integer" },
60
+ { name: "qaEndpointId", type: "bigInt", interface: "integer" },
61
+ { name: "qaStackId", type: "bigInt", interface: "integer" },
62
+ { name: "qaAppServices", type: "json", interface: "json" },
63
+ { name: "publishCommitStatus", type: "boolean", interface: "checkbox" },
64
+ { name: "statusContext", type: "string", interface: "input" },
65
+ { name: "publishPrComment", type: "boolean", interface: "checkbox" },
66
+ { name: "enrichGitReview", type: "boolean", interface: "checkbox" },
67
+ { name: "portainerPipelineId", type: "bigInt", interface: "integer" },
68
+ { name: "deployStackId", type: "bigInt", interface: "integer" },
69
+ { name: "deployEndpointId", type: "bigInt", interface: "integer" },
70
+ { name: "deployInstanceId", type: "bigInt", interface: "integer" },
71
+ { name: "deployGateMode", type: "string", interface: "select" },
72
+ { name: "gateApproverIds", type: "json", interface: "json" },
73
+ { name: "dbBackwardCompatible", type: "boolean", interface: "checkbox" },
74
+ { name: "promotionHalted", type: "boolean", interface: "checkbox" },
75
+ { name: "promotionHaltReason", type: "text", interface: "textarea" },
76
+ { name: "lastKnownGoodSnapshot", type: "json", interface: "json" },
77
+ { name: "enableAiTriage", type: "boolean", interface: "checkbox" },
78
+ { name: "agentLoopPatternKey", type: "string", interface: "input" },
79
+ { name: "smokeOnClusterHotReload", type: "boolean", interface: "checkbox" }
80
+ ]
81
+ };
82
+ const ciGateRunsCollectionSchema = {
83
+ name: import_constants.CI_GATE_RUNS_COLLECTION,
84
+ title: "CI Gate Runs",
85
+ autoGenId: true,
86
+ fields: [
87
+ { name: "id", type: "bigInt", interface: "id" },
88
+ { name: "pipelineId", type: "bigInt", interface: "integer" },
89
+ { name: "tenantId", type: "bigInt", interface: "integer" },
90
+ { name: "testRunId", type: "bigInt", interface: "integer" },
91
+ { name: "buildRunId", type: "bigInt", interface: "integer" },
92
+ { name: "operationId", type: "string", interface: "input" },
93
+ { name: "gitRepositoryId", type: "bigInt", interface: "integer" },
94
+ { name: "eventType", type: "string", interface: "select" },
95
+ { name: "branch", type: "string", interface: "input" },
96
+ { name: "targetBranch", type: "string", interface: "input" },
97
+ { name: "commitSha", type: "string", interface: "input" },
98
+ { name: "baseSha", type: "string", interface: "input" },
99
+ { name: "mrIid", type: "bigInt", interface: "integer" },
100
+ { name: "state", type: "string", interface: "select" },
101
+ { name: "testVerdict", type: "string", interface: "input" },
102
+ { name: "verdictReasonCode", type: "string", interface: "input" },
103
+ { name: "approvalState", type: "string", interface: "select" },
104
+ { name: "approvalRecord", type: "json", interface: "json" },
105
+ { name: "deployOutcome", type: "string", interface: "select" },
106
+ { name: "rollbackRecord", type: "json", interface: "json" },
107
+ { name: "commitStatusState", type: "string", interface: "select" },
108
+ { name: "gitFeedbackSyncState", type: "string", interface: "select" },
109
+ { name: "prCommentId", type: "string", interface: "input" },
110
+ { name: "ephemeralContainerId", type: "string", interface: "input" },
111
+ { name: "deployTargetSummary", type: "json", interface: "json" },
112
+ { name: "triageResult", type: "json", interface: "json" },
113
+ { name: "errorMessage", type: "text", interface: "textarea" },
114
+ { name: "startedAt", type: "date", interface: "datetime" },
115
+ { name: "finishedAt", type: "date", interface: "datetime" },
116
+ { name: "durationMs", type: "integer", interface: "integer" }
117
+ ]
118
+ };
119
+ const allWorkflowCiCollections = [ciPipelinesCollectionSchema, ciGateRunsCollectionSchema];
120
+ // Annotate the CommonJS export names for ESM import in node:
121
+ 0 && (module.exports = {
122
+ allWorkflowCiCollections,
123
+ ciGateRunsCollectionSchema,
124
+ ciPipelinesCollectionSchema
125
+ });
@@ -0,0 +1,120 @@
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
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var constants_exports = {};
28
+ __export(constants_exports, {
29
+ AGENT_LOOP_PATTERNS_COLLECTION: () => AGENT_LOOP_PATTERNS_COLLECTION,
30
+ AGENT_LOOP_RUNS_COLLECTION: () => AGENT_LOOP_RUNS_COLLECTION,
31
+ CI_GATE_RUNS_COLLECTION: () => CI_GATE_RUNS_COLLECTION,
32
+ CI_GIT_FEEDBACK_OUTBOX_COLLECTION: () => CI_GIT_FEEDBACK_OUTBOX_COLLECTION,
33
+ CI_INSTRUCTIONS: () => CI_INSTRUCTIONS,
34
+ CI_MANAGED_WORKFLOW_KEY: () => CI_MANAGED_WORKFLOW_KEY,
35
+ CI_MANAGER_ACL_SNIPPET: () => CI_MANAGER_ACL_SNIPPET,
36
+ CI_MANAGER_RESOURCE: () => CI_MANAGER_RESOURCE,
37
+ CI_MR_POLL_INTERVAL_MS: () => CI_MR_POLL_INTERVAL_MS,
38
+ CI_PIPELINES_COLLECTION: () => CI_PIPELINES_COLLECTION,
39
+ CI_RECONCILE_INTERVAL_MS: () => CI_RECONCILE_INTERVAL_MS,
40
+ CI_WORKFLOW_GROUP_KEY: () => CI_WORKFLOW_GROUP_KEY,
41
+ CI_WORKFLOW_TEMPLATE_MARKER: () => CI_WORKFLOW_TEMPLATE_MARKER,
42
+ CI_WORKFLOW_TEMPLATE_VERSION: () => CI_WORKFLOW_TEMPLATE_VERSION,
43
+ DEFAULT_CI_TIMEOUT_MS: () => DEFAULT_CI_TIMEOUT_MS,
44
+ GIT_ACCOUNTS_COLLECTION: () => GIT_ACCOUNTS_COLLECTION,
45
+ GIT_REPOSITORIES_COLLECTION: () => GIT_REPOSITORIES_COLLECTION,
46
+ GIT_REVIEW_REQUESTS_COLLECTION: () => GIT_REVIEW_REQUESTS_COLLECTION,
47
+ NAMESPACE: () => NAMESPACE,
48
+ PORTAINER_INSTANCES_COLLECTION: () => PORTAINER_INSTANCES_COLLECTION,
49
+ PORTAINER_PIPELINES_COLLECTION: () => PORTAINER_PIPELINES_COLLECTION,
50
+ PORTAINER_PIPELINE_RUNS_COLLECTION: () => PORTAINER_PIPELINE_RUNS_COLLECTION,
51
+ SECRET_MASK: () => SECRET_MASK,
52
+ TEST_CASE_RESULTS_COLLECTION: () => TEST_CASE_RESULTS_COLLECTION,
53
+ TEST_RUNS_COLLECTION: () => TEST_RUNS_COLLECTION,
54
+ TEST_RUN_COMPLETED_EVENT: () => TEST_RUN_COMPLETED_EVENT,
55
+ TEST_TENANTS_COLLECTION: () => TEST_TENANTS_COLLECTION
56
+ });
57
+ module.exports = __toCommonJS(constants_exports);
58
+ const NAMESPACE = "plugin-workflow-ci";
59
+ const CI_MANAGER_RESOURCE = "ciManager";
60
+ const CI_MANAGER_ACL_SNIPPET = "pm.plugin-workflow-ci";
61
+ const CI_PIPELINES_COLLECTION = "ciPipelines";
62
+ const CI_GATE_RUNS_COLLECTION = "ciGateRuns";
63
+ const CI_GIT_FEEDBACK_OUTBOX_COLLECTION = "ciGitFeedbackOutbox";
64
+ const CI_MANAGED_WORKFLOW_KEY = "workflow-ci-gate-pipeline";
65
+ const CI_WORKFLOW_TEMPLATE_MARKER = "workflowCiManaged";
66
+ const CI_WORKFLOW_TEMPLATE_VERSION = 2;
67
+ const CI_WORKFLOW_GROUP_KEY = "extended";
68
+ const CI_INSTRUCTIONS = {
69
+ dispatchRun: "ci-dispatch-run",
70
+ aiTriage: "ci-ai-triage",
71
+ publishGitFeedback: "ci-publish-git-feedback",
72
+ waitApproval: "ci-wait-approval",
73
+ promoteDeploy: "ci-promote-deploy"
74
+ };
75
+ const TEST_TENANTS_COLLECTION = "testTenants";
76
+ const TEST_RUNS_COLLECTION = "testRuns";
77
+ const TEST_CASE_RESULTS_COLLECTION = "testCaseResults";
78
+ const TEST_RUN_COMPLETED_EVENT = "test-manager:run-completed";
79
+ const GIT_REPOSITORIES_COLLECTION = "gitRepositories";
80
+ const GIT_ACCOUNTS_COLLECTION = "gitAccounts";
81
+ const GIT_REVIEW_REQUESTS_COLLECTION = "gitReviewRequests";
82
+ const PORTAINER_INSTANCES_COLLECTION = "portainerInstances";
83
+ const PORTAINER_PIPELINES_COLLECTION = "portainerGitPipelines";
84
+ const PORTAINER_PIPELINE_RUNS_COLLECTION = "portainerGitPipelineRuns";
85
+ const AGENT_LOOP_PATTERNS_COLLECTION = "agentLoopPatterns";
86
+ const AGENT_LOOP_RUNS_COLLECTION = "agentLoopRuns";
87
+ const SECRET_MASK = "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022";
88
+ const DEFAULT_CI_TIMEOUT_MS = 6e5;
89
+ const CI_RECONCILE_INTERVAL_MS = 3e4;
90
+ const CI_MR_POLL_INTERVAL_MS = 12e4;
91
+ // Annotate the CommonJS export names for ESM import in node:
92
+ 0 && (module.exports = {
93
+ AGENT_LOOP_PATTERNS_COLLECTION,
94
+ AGENT_LOOP_RUNS_COLLECTION,
95
+ CI_GATE_RUNS_COLLECTION,
96
+ CI_GIT_FEEDBACK_OUTBOX_COLLECTION,
97
+ CI_INSTRUCTIONS,
98
+ CI_MANAGED_WORKFLOW_KEY,
99
+ CI_MANAGER_ACL_SNIPPET,
100
+ CI_MANAGER_RESOURCE,
101
+ CI_MR_POLL_INTERVAL_MS,
102
+ CI_PIPELINES_COLLECTION,
103
+ CI_RECONCILE_INTERVAL_MS,
104
+ CI_WORKFLOW_GROUP_KEY,
105
+ CI_WORKFLOW_TEMPLATE_MARKER,
106
+ CI_WORKFLOW_TEMPLATE_VERSION,
107
+ DEFAULT_CI_TIMEOUT_MS,
108
+ GIT_ACCOUNTS_COLLECTION,
109
+ GIT_REPOSITORIES_COLLECTION,
110
+ GIT_REVIEW_REQUESTS_COLLECTION,
111
+ NAMESPACE,
112
+ PORTAINER_INSTANCES_COLLECTION,
113
+ PORTAINER_PIPELINES_COLLECTION,
114
+ PORTAINER_PIPELINE_RUNS_COLLECTION,
115
+ SECRET_MASK,
116
+ TEST_CASE_RESULTS_COLLECTION,
117
+ TEST_RUNS_COLLECTION,
118
+ TEST_RUN_COMPLETED_EVENT,
119
+ TEST_TENANTS_COLLECTION
120
+ });
@@ -0,0 +1,67 @@
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
+ var __create = Object.create;
11
+ var __defProp = Object.defineProperty;
12
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
+ var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
15
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
16
+ var __export = (target, all) => {
17
+ for (var name in all)
18
+ __defProp(target, name, { get: all[name], enumerable: true });
19
+ };
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") {
22
+ for (let key of __getOwnPropNames(from))
23
+ if (!__hasOwnProp.call(to, key) && key !== except)
24
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
+ // If the importer is in node compatibility mode or this is not an ESM
30
+ // file that has been converted to a CommonJS file using a Babel-
31
+ // compatible transform (i.e. "__esModule" has not been set), then set
32
+ // "default" to the CommonJS "module.exports" for node compatibility.
33
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
+ mod
35
+ ));
36
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
+ var runtime_context_exports = {};
38
+ __export(runtime_context_exports, {
39
+ WorkflowCiRuntimeProvider: () => WorkflowCiRuntimeProvider,
40
+ useWorkflowCiRuntime: () => useWorkflowCiRuntime
41
+ });
42
+ module.exports = __toCommonJS(runtime_context_exports);
43
+ var import_react = __toESM(require("react"));
44
+ const defaultTranslate = (key, options) => {
45
+ if (!options) return key;
46
+ return key.replace(/\{\{\s*(\w+)\s*\}\}/g, (_, token) => {
47
+ const val = options[token];
48
+ return val === void 0 || val === null ? "" : String(val);
49
+ });
50
+ };
51
+ const CiRuntimeContext = (0, import_react.createContext)(null);
52
+ const WorkflowCiRuntimeProvider = ({ api, t = defaultTranslate, children }) => {
53
+ const value = import_react.default.useMemo(() => ({ api, t }), [api, t]);
54
+ return /* @__PURE__ */ import_react.default.createElement(CiRuntimeContext.Provider, { value }, children);
55
+ };
56
+ function useWorkflowCiRuntime() {
57
+ const ctx = (0, import_react.useContext)(CiRuntimeContext);
58
+ if (!ctx) {
59
+ throw new Error("useWorkflowCiRuntime must be used inside WorkflowCiRuntimeProvider");
60
+ }
61
+ return ctx;
62
+ }
63
+ // Annotate the CommonJS export names for ESM import in node:
64
+ 0 && (module.exports = {
65
+ WorkflowCiRuntimeProvider,
66
+ useWorkflowCiRuntime
67
+ });
@@ -0,0 +1,24 @@
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
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+ var types_exports = {};
24
+ module.exports = __toCommonJS(types_exports);