airbyte-faros-destination 0.19.57-rc5 → 0.19.57-rc6
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/lib/converters/azure-tfvc/changesets.d.ts +0 -8
- package/lib/converters/azure-tfvc/changesets.js +27 -124
- package/lib/converters/azure-tfvc/changesets.js.map +1 -1
- package/lib/converters/azure-tfvc/common.d.ts +1 -9
- package/lib/converters/azure-tfvc/common.js +0 -14
- package/lib/converters/azure-tfvc/common.js.map +1 -1
- package/lib/converters/azure-workitems/workitems.js +6 -10
- package/lib/converters/azure-workitems/workitems.js.map +1 -1
- package/lib/converters/github/faros_pull_requests.js +22 -28
- package/lib/converters/github/faros_pull_requests.js.map +1 -1
- package/lib/converters/github/review_comments.js +1 -4
- package/lib/converters/github/review_comments.js.map +1 -1
- package/lib/converters/harness/common.d.ts +6 -88
- package/lib/converters/harness/common.js +2 -2
- package/lib/converters/harness/common.js.map +1 -1
- package/lib/converters/harness/executions.d.ts +6 -7
- package/lib/converters/harness/executions.js +143 -170
- package/lib/converters/harness/executions.js.map +1 -1
- package/lib/converters/harness/organizations.d.ts +7 -0
- package/lib/converters/harness/organizations.js +29 -0
- package/lib/converters/harness/organizations.js.map +1 -0
- package/lib/converters/harness/pipelines.d.ts +7 -0
- package/lib/converters/harness/pipelines.js +29 -0
- package/lib/converters/harness/pipelines.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -3
- package/resources/source-specific-configs/spec.json +0 -3
- package/lib/converters/azure-tfvc/users.d.ts +0 -7
- package/lib/converters/azure-tfvc/users.js +0 -56
- package/lib/converters/azure-tfvc/users.js.map +0 -1
- package/lib/converters/github/faros_stats.d.ts +0 -10
- package/lib/converters/github/faros_stats.js +0 -107
- package/lib/converters/github/faros_stats.js.map +0 -1
- package/resources/source-specific-configs/azure-tfvc.json +0 -26
|
@@ -1,102 +1,20 @@
|
|
|
1
1
|
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
-
import { ComputeApplication } from '../common/common';
|
|
3
2
|
import { Converter } from '../converter';
|
|
4
|
-
|
|
3
|
+
export { CDModuleInfo, Organization, Pipeline, PipelineExecution, } from 'faros-airbyte-common/harness';
|
|
4
|
+
export interface CICDOrganizationKey {
|
|
5
5
|
uid: string;
|
|
6
6
|
source: string;
|
|
7
7
|
}
|
|
8
|
-
interface
|
|
8
|
+
export interface CICDPipelineKey {
|
|
9
9
|
uid: string;
|
|
10
|
-
organization:
|
|
10
|
+
organization: CICDOrganizationKey;
|
|
11
11
|
}
|
|
12
|
-
export interface
|
|
12
|
+
export interface CICDBuildKey {
|
|
13
13
|
uid: string;
|
|
14
|
-
pipeline:
|
|
15
|
-
}
|
|
16
|
-
interface CICDRepository {
|
|
17
|
-
uid: string;
|
|
18
|
-
organization: CICDOrganization;
|
|
19
|
-
}
|
|
20
|
-
export interface CICDArtifact {
|
|
21
|
-
readonly uid: string;
|
|
22
|
-
readonly repository: CICDRepository;
|
|
23
|
-
}
|
|
24
|
-
export interface Execution {
|
|
25
|
-
uid: string;
|
|
26
|
-
application: ComputeApplication;
|
|
27
|
-
startedAt: number;
|
|
28
|
-
endedAt: number;
|
|
29
|
-
env: string;
|
|
30
|
-
status: string;
|
|
31
|
-
build: CICDBuild;
|
|
32
|
-
artifact: CICDArtifact;
|
|
33
|
-
}
|
|
34
|
-
export interface ExecutionImplementation {
|
|
35
|
-
application: ComputeApplication;
|
|
36
|
-
env: string;
|
|
37
|
-
build?: CICDBuild;
|
|
38
|
-
artifact?: CICDArtifact;
|
|
39
|
-
}
|
|
40
|
-
interface HarnessService {
|
|
41
|
-
id: string;
|
|
42
|
-
name?: string;
|
|
43
|
-
artifactType: string;
|
|
44
|
-
artifactSources: {
|
|
45
|
-
name: string;
|
|
46
|
-
}[];
|
|
47
|
-
}
|
|
48
|
-
interface HarnessEnvironment {
|
|
49
|
-
type: string;
|
|
50
|
-
name: string;
|
|
51
|
-
}
|
|
52
|
-
export interface HarnessExecutionNode {
|
|
53
|
-
id: string;
|
|
54
|
-
application: {
|
|
55
|
-
id: string;
|
|
56
|
-
name?: string;
|
|
57
|
-
services?: {
|
|
58
|
-
nodes: HarnessService[];
|
|
59
|
-
};
|
|
60
|
-
environments?: {
|
|
61
|
-
nodes: HarnessEnvironment[];
|
|
62
|
-
};
|
|
63
|
-
tags?: {
|
|
64
|
-
name: string;
|
|
65
|
-
value: string;
|
|
66
|
-
}[];
|
|
67
|
-
};
|
|
68
|
-
status: string;
|
|
69
|
-
createdAt: number;
|
|
70
|
-
startedAt: number;
|
|
71
|
-
endedAt: number;
|
|
72
|
-
artifacts?: {
|
|
73
|
-
id: string;
|
|
74
|
-
buildNo: string;
|
|
75
|
-
artifactSource: {
|
|
76
|
-
id: string;
|
|
77
|
-
name: string;
|
|
78
|
-
};
|
|
79
|
-
}[];
|
|
80
|
-
outcomes?: {
|
|
81
|
-
nodes: {
|
|
82
|
-
service: HarnessService;
|
|
83
|
-
environment: HarnessEnvironment;
|
|
84
|
-
}[];
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
export interface ExecutionWorkflow {
|
|
88
|
-
application: ComputeApplication;
|
|
89
|
-
env: string;
|
|
90
|
-
build: CICDBuild;
|
|
91
|
-
artifact: CICDArtifact;
|
|
92
|
-
}
|
|
93
|
-
export interface ExecutionPipeline {
|
|
94
|
-
application: ComputeApplication;
|
|
95
|
-
env: string;
|
|
14
|
+
pipeline: CICDPipelineKey;
|
|
96
15
|
}
|
|
97
16
|
/** Harness converter base */
|
|
98
17
|
export declare abstract class HarnessConverter extends Converter {
|
|
99
18
|
source: string;
|
|
100
19
|
id(record: AirbyteRecord): any;
|
|
101
20
|
}
|
|
102
|
-
export {};
|
|
@@ -9,8 +9,8 @@ class HarnessConverter extends converter_1.Converter {
|
|
|
9
9
|
this.source = 'Harness';
|
|
10
10
|
}
|
|
11
11
|
id(record) {
|
|
12
|
-
var _a, _b;
|
|
13
|
-
return (_b = (_a = record === null || record === void 0 ? void 0 : record.record) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.
|
|
12
|
+
var _a, _b, _c, _d, _e;
|
|
13
|
+
return (_c = (_b = (_a = record === null || record === void 0 ? void 0 : record.record) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.identifier) !== null && _c !== void 0 ? _c : (_e = (_d = record === null || record === void 0 ? void 0 : record.record) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.planExecutionId;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
exports.HarnessConverter = HarnessConverter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/converters/harness/common.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/converters/harness/common.ts"],"names":[],"mappings":";;;AAEA,4CAAuC;AA0BvC,6BAA6B;AAC7B,MAAsB,gBAAiB,SAAQ,qBAAS;IAAxD;;QACE,WAAM,GAAG,SAAS,CAAC;IAKrB,CAAC;IAHC,EAAE,CAAC,MAAqB;;QACtB,OAAO,MAAA,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,IAAI,0CAAE,UAAU,mCAAI,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,IAAI,0CAAE,eAAe,CAAC;IACnF,CAAC;CACF;AAND,4CAMC"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
-
import { DestinationModel, DestinationRecord
|
|
2
|
+
import { DestinationModel, DestinationRecord } from '../converter';
|
|
3
3
|
import { HarnessConverter } from './common';
|
|
4
4
|
export declare class Executions extends HarnessConverter {
|
|
5
5
|
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
6
|
private seenApplications;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
private
|
|
10
|
-
private
|
|
7
|
+
private seenTags;
|
|
8
|
+
convert(record: AirbyteRecord): Promise<ReadonlyArray<DestinationRecord>>;
|
|
9
|
+
private parseInputSetVariables;
|
|
10
|
+
private extractVariables;
|
|
11
11
|
private toBuildStatus;
|
|
12
|
-
private toEnvironmentStatus;
|
|
13
|
-
private toExecution;
|
|
14
12
|
private toDeploymentStatus;
|
|
13
|
+
private toEnvironment;
|
|
15
14
|
}
|
|
@@ -1,240 +1,213 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.Executions = void 0;
|
|
4
7
|
const faros_js_client_1 = require("faros-js-client");
|
|
8
|
+
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
5
9
|
const common_1 = require("../common/common");
|
|
6
10
|
const common_2 = require("./common");
|
|
7
|
-
const DEFAULT_CICD_ORGANIZATION_UID = 'default';
|
|
8
|
-
const DEFAULT_EXECUTION_TAG_APPLICATION_PLATFORM = 'faros_app_platform';
|
|
9
|
-
const DEFAULT_EXECUTION_TAG_ARTIFACT_ORG = 'faros_artifact_org';
|
|
10
|
-
const DEFAULT_EXECUTION_TAG_ARTIFACT_SOURCE = 'faros_artifact_source';
|
|
11
|
-
const DEFAULT_EXECUTION_TAG_ARTIFACT_REPO = 'faros_artifact_repo';
|
|
12
11
|
class Executions extends common_2.HarnessConverter {
|
|
13
12
|
constructor() {
|
|
14
13
|
super(...arguments);
|
|
15
14
|
this.destinationModels = [
|
|
16
|
-
'cicd_ArtifactDeployment',
|
|
17
15
|
'cicd_Build',
|
|
18
16
|
'cicd_Deployment',
|
|
17
|
+
'cicd_DeploymentTag',
|
|
19
18
|
'compute_Application',
|
|
19
|
+
'faros_Tag',
|
|
20
20
|
];
|
|
21
21
|
this.seenApplications = new Set();
|
|
22
|
+
this.seenTags = new Set();
|
|
22
23
|
}
|
|
23
|
-
async convert(record
|
|
24
|
-
var _a, _b;
|
|
25
|
-
const executionRaw = record.record.data;
|
|
24
|
+
async convert(record) {
|
|
25
|
+
var _a, _b, _c, _d;
|
|
26
26
|
const source = this.streamName.source;
|
|
27
|
+
const execution = record.record.data;
|
|
27
28
|
const res = [];
|
|
28
|
-
const
|
|
29
|
+
const cdInfo = (_a = execution.moduleInfo) === null || _a === void 0 ? void 0 : _a.cd;
|
|
30
|
+
if (!cdInfo) {
|
|
31
|
+
return res;
|
|
32
|
+
}
|
|
33
|
+
// Build key
|
|
34
|
+
const build = {
|
|
35
|
+
uid: execution.planExecutionId,
|
|
36
|
+
pipeline: {
|
|
37
|
+
uid: execution.pipelineIdentifier,
|
|
38
|
+
organization: { uid: execution.orgIdentifier, source },
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
// Build (pipeline execution)
|
|
42
|
+
res.push({
|
|
43
|
+
model: 'cicd_Build',
|
|
44
|
+
record: {
|
|
45
|
+
...build,
|
|
46
|
+
name: execution.name,
|
|
47
|
+
startedAt: faros_js_client_1.Utils.toDate(execution.startTs),
|
|
48
|
+
endedAt: faros_js_client_1.Utils.toDate(execution.endTs),
|
|
49
|
+
status: this.toBuildStatus(execution.status),
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
// Application (from service)
|
|
53
|
+
const serviceName = (_b = cdInfo.serviceIdentifiers) === null || _b === void 0 ? void 0 : _b[0];
|
|
29
54
|
let application = null;
|
|
30
|
-
if (
|
|
31
|
-
application = common_1.Common.computeApplication(
|
|
55
|
+
if (serviceName) {
|
|
56
|
+
application = common_1.Common.computeApplication(serviceName, '');
|
|
32
57
|
const appKey = application.uid;
|
|
33
58
|
if (!this.seenApplications.has(appKey)) {
|
|
34
59
|
res.push({ model: 'compute_Application', record: application });
|
|
35
60
|
this.seenApplications.add(appKey);
|
|
36
61
|
}
|
|
37
62
|
}
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
const
|
|
63
|
+
// Deployment
|
|
64
|
+
const envName = (_c = cdInfo.envIdentifiers) === null || _c === void 0 ? void 0 : _c[0];
|
|
65
|
+
const envType = (_d = cdInfo.environmentTypes) === null || _d === void 0 ? void 0 : _d[0];
|
|
66
|
+
const deploymentKey = {
|
|
67
|
+
uid: execution.planExecutionId,
|
|
68
|
+
source,
|
|
69
|
+
};
|
|
41
70
|
res.push({
|
|
42
71
|
model: 'cicd_Deployment',
|
|
43
72
|
record: {
|
|
44
|
-
...
|
|
73
|
+
...deploymentKey,
|
|
45
74
|
application,
|
|
46
|
-
build
|
|
47
|
-
startedAt: faros_js_client_1.Utils.toDate(execution.
|
|
48
|
-
endedAt: faros_js_client_1.Utils.toDate(execution.
|
|
49
|
-
env: this.
|
|
50
|
-
status:
|
|
75
|
+
build,
|
|
76
|
+
startedAt: faros_js_client_1.Utils.toDate(execution.startTs),
|
|
77
|
+
endedAt: faros_js_client_1.Utils.toDate(execution.endTs),
|
|
78
|
+
env: this.toEnvironment(envName, envType),
|
|
79
|
+
status: this.toDeploymentStatus(execution.status),
|
|
51
80
|
},
|
|
52
81
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
82
|
+
// Parse inputSetYaml and create tags
|
|
83
|
+
const variables = this.parseInputSetVariables(execution.inputSetYaml);
|
|
84
|
+
for (const variable of variables) {
|
|
85
|
+
const tagUid = `harness__${variable.name}__${variable.value}`;
|
|
86
|
+
const tagKey = { uid: tagUid };
|
|
87
|
+
if (!this.seenTags.has(tagUid)) {
|
|
88
|
+
res.push({
|
|
89
|
+
model: 'faros_Tag',
|
|
90
|
+
record: {
|
|
91
|
+
...tagKey,
|
|
92
|
+
key: variable.name,
|
|
93
|
+
value: variable.value,
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
this.seenTags.add(tagUid);
|
|
97
|
+
}
|
|
65
98
|
res.push({
|
|
66
|
-
model: '
|
|
99
|
+
model: 'cicd_DeploymentTag',
|
|
67
100
|
record: {
|
|
68
|
-
|
|
69
|
-
|
|
101
|
+
deployment: deploymentKey,
|
|
102
|
+
tag: tagKey,
|
|
70
103
|
},
|
|
71
104
|
});
|
|
72
105
|
}
|
|
73
106
|
return res;
|
|
74
107
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return undefined;
|
|
79
|
-
}
|
|
80
|
-
const executionArtifact = execution.artifacts[0];
|
|
81
|
-
// artifact repo organization pulled from application tags
|
|
82
|
-
const organization = {
|
|
83
|
-
uid: (_a = execution.application.tags.find((t) => t.name === DEFAULT_EXECUTION_TAG_ARTIFACT_ORG)) === null || _a === void 0 ? void 0 : _a.value,
|
|
84
|
-
source: (_c = (_b = execution.application.tags.find((t) => t.name === DEFAULT_EXECUTION_TAG_ARTIFACT_SOURCE)) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : executionArtifact === null || executionArtifact === void 0 ? void 0 : executionArtifact.artifactSource.name,
|
|
85
|
-
};
|
|
86
|
-
const repository = {
|
|
87
|
-
uid: (_d = execution.application.tags.find((t) => t.name === DEFAULT_EXECUTION_TAG_ARTIFACT_REPO)) === null || _d === void 0 ? void 0 : _d.value,
|
|
88
|
-
organization,
|
|
89
|
-
};
|
|
90
|
-
const artifact = {
|
|
91
|
-
uid: executionArtifact === null || executionArtifact === void 0 ? void 0 : executionArtifact.buildNo,
|
|
92
|
-
repository,
|
|
93
|
-
};
|
|
94
|
-
if (artifact.uid &&
|
|
95
|
-
artifact.repository.uid &&
|
|
96
|
-
artifact.repository.organization.uid &&
|
|
97
|
-
artifact.repository.organization.source) {
|
|
98
|
-
return artifact;
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
return undefined;
|
|
108
|
+
parseInputSetVariables(inputSetYaml) {
|
|
109
|
+
if (!inputSetYaml) {
|
|
110
|
+
return [];
|
|
102
111
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
return undefined;
|
|
112
|
+
try {
|
|
113
|
+
const inputSet = js_yaml_1.default.load(inputSetYaml);
|
|
114
|
+
const variables = [];
|
|
115
|
+
this.extractVariables(inputSet, variables);
|
|
116
|
+
return variables;
|
|
109
117
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return
|
|
118
|
+
catch {
|
|
119
|
+
// Silently ignore parse errors
|
|
120
|
+
return [];
|
|
113
121
|
}
|
|
114
|
-
const build = {
|
|
115
|
-
uid: execution.id,
|
|
116
|
-
pipeline: {
|
|
117
|
-
uid: (_c = (_b = outcome.service.name) !== null && _b !== void 0 ? _b : execution.application.name) !== null && _c !== void 0 ? _c : artifactSource.name,
|
|
118
|
-
organization: {
|
|
119
|
-
uid: DEFAULT_CICD_ORGANIZATION_UID,
|
|
120
|
-
source,
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
};
|
|
124
|
-
let artifact = undefined;
|
|
125
|
-
// artifact computation needs to have application tags
|
|
126
|
-
if (execution.application.tags) {
|
|
127
|
-
artifact = this.parseArtifactFromTags(execution);
|
|
128
|
-
}
|
|
129
|
-
return {
|
|
130
|
-
application: common_1.Common.computeApplication((_d = execution.application.name) !== null && _d !== void 0 ? _d : artifactSource.name, (_g = (_f = (_e = execution.application.tags) === null || _e === void 0 ? void 0 : _e.find((t) => t.name === DEFAULT_EXECUTION_TAG_APPLICATION_PLATFORM)) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : ''),
|
|
131
|
-
env: (_h = outcome.environment.name) !== null && _h !== void 0 ? _h : outcome.environment.type,
|
|
132
|
-
build,
|
|
133
|
-
artifact,
|
|
134
|
-
};
|
|
135
122
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const service = (_a = execution.application.services) === null || _a === void 0 ? void 0 : _a.nodes.find((s) => s.artifactType);
|
|
139
|
-
if (!service) {
|
|
123
|
+
extractVariables(obj, result) {
|
|
124
|
+
if (!obj || typeof obj !== 'object') {
|
|
140
125
|
return;
|
|
141
126
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
127
|
+
if (Array.isArray(obj)) {
|
|
128
|
+
for (const item of obj) {
|
|
129
|
+
this.extractVariables(item, result);
|
|
130
|
+
}
|
|
145
131
|
return;
|
|
146
132
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
133
|
+
const record = obj;
|
|
134
|
+
// Check if this object is a variable (has name and value properties)
|
|
135
|
+
if (typeof record.name === 'string' &&
|
|
136
|
+
typeof record.value === 'string' &&
|
|
137
|
+
record.value !== '<+input>' // Skip unresolved inputs
|
|
138
|
+
) {
|
|
139
|
+
result.push({ name: record.name, value: record.value });
|
|
140
|
+
}
|
|
141
|
+
// Recursively check all properties
|
|
142
|
+
for (const value of Object.values(record)) {
|
|
143
|
+
this.extractVariables(value, result);
|
|
144
|
+
}
|
|
151
145
|
}
|
|
152
146
|
toBuildStatus(status) {
|
|
153
|
-
const
|
|
154
|
-
switch (
|
|
155
|
-
case '
|
|
156
|
-
case 'rejected':
|
|
147
|
+
const statusUpper = status === null || status === void 0 ? void 0 : status.toUpperCase();
|
|
148
|
+
switch (statusUpper) {
|
|
149
|
+
case 'ABORTED':
|
|
157
150
|
return { category: 'Canceled', detail: status };
|
|
158
|
-
case '
|
|
159
|
-
case '
|
|
160
|
-
case 'failed':
|
|
151
|
+
case 'EXPIRED':
|
|
152
|
+
case 'FAILED':
|
|
161
153
|
return { category: 'Failed', detail: status };
|
|
162
|
-
case '
|
|
163
|
-
case '
|
|
164
|
-
case '
|
|
154
|
+
case 'QUEUED':
|
|
155
|
+
case 'PAUSED':
|
|
156
|
+
case 'WAITING':
|
|
157
|
+
case 'APPROVALWAITING':
|
|
158
|
+
case 'ASYNCWAITING':
|
|
159
|
+
case 'TASKWAITING':
|
|
160
|
+
case 'TIMEDWAITING':
|
|
165
161
|
return { category: 'Queued', detail: status };
|
|
166
|
-
case '
|
|
167
|
-
case 'running':
|
|
162
|
+
case 'RUNNING':
|
|
168
163
|
return { category: 'Running', detail: status };
|
|
169
|
-
case '
|
|
164
|
+
case 'SUCCESS':
|
|
170
165
|
return { category: 'Success', detail: status };
|
|
171
|
-
case 'skipped':
|
|
172
166
|
default:
|
|
173
167
|
return { category: 'Custom', detail: status };
|
|
174
168
|
}
|
|
175
169
|
}
|
|
176
|
-
toEnvironmentStatus(status) {
|
|
177
|
-
const statusLower = status.toLowerCase();
|
|
178
|
-
if (statusLower.startsWith('prod')) {
|
|
179
|
-
return { category: 'Prod', detail: status };
|
|
180
|
-
}
|
|
181
|
-
if (statusLower === 'staging') {
|
|
182
|
-
return { category: 'Staging', detail: status };
|
|
183
|
-
}
|
|
184
|
-
if (statusLower.startsWith('dev')) {
|
|
185
|
-
return { category: 'Dev', detail: status };
|
|
186
|
-
}
|
|
187
|
-
if (statusLower === 'qa') {
|
|
188
|
-
return { category: 'QA', detail: status };
|
|
189
|
-
}
|
|
190
|
-
return { category: 'Custom', detail: status };
|
|
191
|
-
}
|
|
192
|
-
toExecution(item, source) {
|
|
193
|
-
let implementation;
|
|
194
|
-
if (item.outcomes) {
|
|
195
|
-
implementation = this.parseWorkflow(item, source);
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
implementation = this.parsePipeline(item);
|
|
199
|
-
}
|
|
200
|
-
if (!implementation) {
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
return {
|
|
204
|
-
uid: item.id,
|
|
205
|
-
application: implementation.application,
|
|
206
|
-
startedAt: item.startedAt,
|
|
207
|
-
endedAt: item.endedAt,
|
|
208
|
-
env: implementation.env,
|
|
209
|
-
status: item.status,
|
|
210
|
-
build: implementation.build,
|
|
211
|
-
artifact: implementation.artifact,
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
170
|
toDeploymentStatus(status) {
|
|
215
|
-
const
|
|
216
|
-
switch (
|
|
217
|
-
case '
|
|
218
|
-
case 'rejected':
|
|
171
|
+
const statusUpper = status === null || status === void 0 ? void 0 : status.toUpperCase();
|
|
172
|
+
switch (statusUpper) {
|
|
173
|
+
case 'ABORTED':
|
|
219
174
|
return { category: 'Canceled', detail: status };
|
|
220
|
-
case '
|
|
221
|
-
case '
|
|
222
|
-
case 'failed':
|
|
175
|
+
case 'EXPIRED':
|
|
176
|
+
case 'FAILED':
|
|
223
177
|
return { category: 'Failed', detail: status };
|
|
224
|
-
case '
|
|
225
|
-
case '
|
|
226
|
-
case '
|
|
178
|
+
case 'QUEUED':
|
|
179
|
+
case 'PAUSED':
|
|
180
|
+
case 'WAITING':
|
|
181
|
+
case 'APPROVALWAITING':
|
|
182
|
+
case 'ASYNCWAITING':
|
|
183
|
+
case 'TASKWAITING':
|
|
184
|
+
case 'TIMEDWAITING':
|
|
227
185
|
return { category: 'Queued', detail: status };
|
|
228
|
-
case '
|
|
229
|
-
case 'running':
|
|
186
|
+
case 'RUNNING':
|
|
230
187
|
return { category: 'Running', detail: status };
|
|
231
|
-
case '
|
|
188
|
+
case 'SUCCESS':
|
|
232
189
|
return { category: 'Success', detail: status };
|
|
233
|
-
case 'skipped':
|
|
234
190
|
default:
|
|
235
191
|
return { category: 'Custom', detail: status };
|
|
236
192
|
}
|
|
237
193
|
}
|
|
194
|
+
toEnvironment(envName, envType) {
|
|
195
|
+
const env = envName || envType || 'unknown';
|
|
196
|
+
const envLower = env.toLowerCase();
|
|
197
|
+
if (envLower.includes('prod')) {
|
|
198
|
+
return { category: 'Prod', detail: env };
|
|
199
|
+
}
|
|
200
|
+
if (envLower.includes('staging')) {
|
|
201
|
+
return { category: 'Staging', detail: env };
|
|
202
|
+
}
|
|
203
|
+
if (envLower.includes('dev')) {
|
|
204
|
+
return { category: 'Dev', detail: env };
|
|
205
|
+
}
|
|
206
|
+
if (envLower.includes('qa') || envLower.includes('test')) {
|
|
207
|
+
return { category: 'QA', detail: env };
|
|
208
|
+
}
|
|
209
|
+
return { category: 'Custom', detail: env };
|
|
210
|
+
}
|
|
238
211
|
}
|
|
239
212
|
exports.Executions = Executions;
|
|
240
213
|
//# sourceMappingURL=executions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executions.js","sourceRoot":"","sources":["../../../src/converters/harness/executions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"executions.js","sourceRoot":"","sources":["../../../src/converters/harness/executions.ts"],"names":[],"mappings":";;;;;;AACA,qDAAsC;AACtC,sDAA2B;AAE3B,6CAAwC;AAExC,qCAA2E;AAQ3E,MAAa,UAAW,SAAQ,yBAAgB;IAAhD;;QACW,sBAAiB,GAAoC;YAC5D,YAAY;YACZ,iBAAiB;YACjB,oBAAoB;YACpB,qBAAqB;YACrB,WAAW;SACZ,CAAC;QAEM,qBAAgB,GAAG,IAAI,GAAG,EAAU,CAAC;QACrC,aAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IAiOvC,CAAC;IA/NC,KAAK,CAAC,OAAO,CACX,MAAqB;;QAErB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QACtC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAyB,CAAC;QAC1D,MAAM,GAAG,GAAwB,EAAE,CAAC;QAEpC,MAAM,MAAM,GAAG,MAAA,SAAS,CAAC,UAAU,0CAAE,EAAE,CAAC;QACxC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,GAAG,CAAC;QACb,CAAC;QAED,YAAY;QACZ,MAAM,KAAK,GAAiB;YAC1B,GAAG,EAAE,SAAS,CAAC,eAAe;YAC9B,QAAQ,EAAE;gBACR,GAAG,EAAE,SAAS,CAAC,kBAAkB;gBACjC,YAAY,EAAE,EAAC,GAAG,EAAE,SAAS,CAAC,aAAa,EAAE,MAAM,EAAC;aACrD;SACF,CA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,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAC,CAAC;QACvC,CAAC;QAED,OAAO,EAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAC,CAAC;IAC3C,CAAC;CACF;AA3OD,gCA2OC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord } from '../converter';
|
|
3
|
+
import { HarnessConverter } from './common';
|
|
4
|
+
export declare class Organizations extends HarnessConverter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
convert(record: AirbyteRecord): Promise<ReadonlyArray<DestinationRecord>>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Organizations = void 0;
|
|
4
|
+
const common_1 = require("./common");
|
|
5
|
+
class Organizations extends common_1.HarnessConverter {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.destinationModels = [
|
|
9
|
+
'cicd_Organization',
|
|
10
|
+
];
|
|
11
|
+
}
|
|
12
|
+
async convert(record) {
|
|
13
|
+
const source = this.streamName.source;
|
|
14
|
+
const org = record.record.data;
|
|
15
|
+
return [
|
|
16
|
+
{
|
|
17
|
+
model: 'cicd_Organization',
|
|
18
|
+
record: {
|
|
19
|
+
uid: org.identifier,
|
|
20
|
+
name: org.name,
|
|
21
|
+
description: org.description,
|
|
22
|
+
source,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.Organizations = Organizations;
|
|
29
|
+
//# sourceMappingURL=organizations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizations.js","sourceRoot":"","sources":["../../../src/converters/harness/organizations.ts"],"names":[],"mappings":";;;AAGA,qCAAwD;AAExD,MAAa,aAAc,SAAQ,yBAAgB;IAAnD;;QACW,sBAAiB,GAAoC;YAC5D,mBAAmB;SACpB,CAAC;IAoBJ,CAAC;IAlBC,KAAK,CAAC,OAAO,CACX,MAAqB;QAErB,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QACtC,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,IAAoB,CAAC;QAE/C,OAAO;YACL;gBACE,KAAK,EAAE,mBAAmB;gBAC1B,MAAM,EAAE;oBACN,GAAG,EAAE,GAAG,CAAC,UAAU;oBACnB,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,WAAW,EAAE,GAAG,CAAC,WAAW;oBAC5B,MAAM;iBACP;aACF;SACF,CAAC;IACJ,CAAC;CACF;AAvBD,sCAuBC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
2
|
+
import { DestinationModel, DestinationRecord } from '../converter';
|
|
3
|
+
import { HarnessConverter } from './common';
|
|
4
|
+
export declare class Pipelines extends HarnessConverter {
|
|
5
|
+
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
6
|
+
convert(record: AirbyteRecord): Promise<ReadonlyArray<DestinationRecord>>;
|
|
7
|
+
}
|