@salesforce/plugin-devops-center 1.2.26 → 1.2.28
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/LICENSE.txt +200 -6
- package/README.md +430 -19
- package/bin/dev.js +15 -0
- package/bin/run.js +5 -0
- package/lib/commands/devops/pipeline/activate.d.ts +14 -0
- package/lib/commands/devops/pipeline/activate.js +82 -0
- package/lib/commands/devops/pipeline/activate.js.map +1 -0
- package/lib/commands/devops/pipeline/attach-project.d.ts +15 -0
- package/lib/commands/devops/pipeline/attach-project.js +82 -0
- package/lib/commands/devops/pipeline/attach-project.js.map +1 -0
- package/lib/commands/devops/pipeline/create.d.ts +23 -0
- package/lib/commands/devops/pipeline/create.js +136 -0
- package/lib/commands/devops/pipeline/create.js.map +1 -0
- package/lib/commands/devops/pipeline/stage/add.d.ts +16 -0
- package/lib/commands/devops/pipeline/stage/add.js +94 -0
- package/lib/commands/devops/pipeline/stage/add.js.map +1 -0
- package/lib/commands/devops/project/create.d.ts +15 -0
- package/lib/commands/devops/project/create.js +72 -0
- package/lib/commands/devops/project/create.js.map +1 -0
- package/lib/commands/devops/project/list.d.ts +20 -0
- package/lib/commands/devops/project/list.js +59 -0
- package/lib/commands/devops/project/list.js.map +1 -0
- package/lib/commands/devops/pull-request/create.d.ts +17 -0
- package/lib/commands/devops/pull-request/create.js +104 -0
- package/lib/commands/devops/pull-request/create.js.map +1 -0
- package/lib/commands/devops/work-item/create.d.ts +16 -0
- package/lib/commands/devops/work-item/create.js +76 -0
- package/lib/commands/devops/work-item/create.js.map +1 -0
- package/lib/commands/devops/work-item/list.d.ts +17 -0
- package/lib/commands/devops/work-item/list.js +72 -0
- package/lib/commands/devops/work-item/list.js.map +1 -0
- package/lib/commands/devops/work-item/status/update.d.ts +16 -0
- package/lib/commands/devops/work-item/status/update.js +90 -0
- package/lib/commands/devops/work-item/status/update.js.map +1 -0
- package/lib/commands/project/deploy/pipeline/quick.d.ts +2 -2
- package/lib/commands/project/deploy/pipeline/quick.js +24 -21
- package/lib/commands/project/deploy/pipeline/quick.js.map +1 -1
- package/lib/commands/project/deploy/pipeline/report.d.ts +4 -4
- package/lib/commands/project/deploy/pipeline/report.js +38 -35
- package/lib/commands/project/deploy/pipeline/report.js.map +1 -1
- package/lib/commands/project/deploy/pipeline/resume.d.ts +2 -2
- package/lib/commands/project/deploy/pipeline/resume.js +24 -21
- package/lib/commands/project/deploy/pipeline/resume.js.map +1 -1
- package/lib/commands/project/deploy/pipeline/start.d.ts +3 -3
- package/lib/commands/project/deploy/pipeline/start.js +26 -23
- package/lib/commands/project/deploy/pipeline/start.js.map +1 -1
- package/lib/commands/project/deploy/pipeline/validate.d.ts +3 -3
- package/lib/commands/project/deploy/pipeline/validate.js +24 -21
- package/lib/commands/project/deploy/pipeline/validate.js.map +1 -1
- package/lib/common/base/abstractAsyncOperation.d.ts +3 -3
- package/lib/common/base/abstractAsyncOperation.js +31 -23
- package/lib/common/base/abstractAsyncOperation.js.map +1 -1
- package/lib/common/base/abstractPromote.d.ts +5 -4
- package/lib/common/base/abstractPromote.js +52 -38
- package/lib/common/base/abstractPromote.js.map +1 -1
- package/lib/common/base/abstractQuick.d.ts +4 -3
- package/lib/common/base/abstractQuick.js +44 -43
- package/lib/common/base/abstractQuick.js.map +1 -1
- package/lib/common/base/abstractReportOnPromote.d.ts +2 -1
- package/lib/common/base/abstractReportOnPromote.js +31 -24
- package/lib/common/base/abstractReportOnPromote.js.map +1 -1
- package/lib/common/base/abstractResume.d.ts +3 -2
- package/lib/common/base/abstractResume.js +40 -33
- package/lib/common/base/abstractResume.js.map +1 -1
- package/lib/common/constants.js +19 -13
- package/lib/common/constants.js.map +1 -1
- package/lib/common/deployPipelineCache.js +20 -15
- package/lib/common/deployPipelineCache.js.map +1 -1
- package/lib/common/flags/flags.d.ts +2 -2
- package/lib/common/flags/flags.js +34 -29
- package/lib/common/flags/flags.js.map +1 -1
- package/lib/common/flags/promote/promoteFlags.d.ts +3 -3
- package/lib/common/flags/promote/promoteFlags.js +26 -20
- package/lib/common/flags/promote/promoteFlags.js.map +1 -1
- package/lib/common/index.d.ts +3 -2
- package/lib/common/index.js +2 -17
- package/lib/common/index.js.map +1 -1
- package/lib/common/outputColumns.d.ts +3 -13
- package/lib/common/outputColumns.js +23 -19
- package/lib/common/outputColumns.js.map +1 -1
- package/lib/common/outputService/aorOutputService.d.ts +4 -4
- package/lib/common/outputService/aorOutputService.js +27 -20
- package/lib/common/outputService/aorOutputService.js.map +1 -1
- package/lib/common/outputService/deployCommandOutputService.d.ts +2 -2
- package/lib/common/outputService/deployCommandOutputService.js +17 -12
- package/lib/common/outputService/deployCommandOutputService.js.map +1 -1
- package/lib/common/outputService/deploySummaryBuilder.d.ts +1 -1
- package/lib/common/outputService/deploySummaryBuilder.js +45 -31
- package/lib/common/outputService/deploySummaryBuilder.js.map +1 -1
- package/lib/common/outputService/deploymentResultOutputService.d.ts +4 -4
- package/lib/common/outputService/deploymentResultOutputService.js +16 -10
- package/lib/common/outputService/deploymentResultOutputService.js.map +1 -1
- package/lib/common/outputService/index.d.ts +8 -6
- package/lib/common/outputService/index.js +5 -19
- package/lib/common/outputService/index.js.map +1 -1
- package/lib/common/outputService/outputService.d.ts +6 -4
- package/lib/common/outputService/outputService.js +20 -14
- package/lib/common/outputService/outputService.js.map +1 -1
- package/lib/common/outputService/outputServiceFactory.d.ts +8 -8
- package/lib/common/outputService/outputServiceFactory.js +21 -16
- package/lib/common/outputService/outputServiceFactory.js.map +1 -1
- package/lib/common/outputService/outputUtils.d.ts +1 -1
- package/lib/common/outputService/outputUtils.js +24 -19
- package/lib/common/outputService/outputUtils.js.map +1 -1
- package/lib/common/outputService/promoteOutputService.d.ts +4 -5
- package/lib/common/outputService/promoteOutputService.js +19 -13
- package/lib/common/outputService/promoteOutputService.js.map +1 -1
- package/lib/common/outputService/reportOutputService.d.ts +5 -6
- package/lib/common/outputService/reportOutputService.js +32 -27
- package/lib/common/outputService/reportOutputService.js.map +1 -1
- package/lib/common/outputService/resumeCommandOutputService.d.ts +3 -3
- package/lib/common/outputService/resumeCommandOutputService.js +19 -13
- package/lib/common/outputService/resumeCommandOutputService.js.map +1 -1
- package/lib/common/outputService/resumeOutputService.d.ts +3 -3
- package/lib/common/outputService/resumeOutputService.js +23 -17
- package/lib/common/outputService/resumeOutputService.js.map +1 -1
- package/lib/common/selectors/asyncOperationResultsSelector.d.ts +1 -1
- package/lib/common/selectors/asyncOperationResultsSelector.js +16 -10
- package/lib/common/selectors/asyncOperationResultsSelector.js.map +1 -1
- package/lib/common/selectors/deployComponentsSelector.d.ts +1 -1
- package/lib/common/selectors/deployComponentsSelector.js +18 -13
- package/lib/common/selectors/deployComponentsSelector.js.map +1 -1
- package/lib/common/selectors/deployProgressSummarySelector.d.ts +2 -2
- package/lib/common/selectors/deployProgressSummarySelector.js +16 -10
- package/lib/common/selectors/deployProgressSummarySelector.js.map +1 -1
- package/lib/common/selectors/deploymentResultsSelector.d.ts +2 -2
- package/lib/common/selectors/deploymentResultsSelector.js +20 -16
- package/lib/common/selectors/deploymentResultsSelector.js.map +1 -1
- package/lib/common/selectors/environmentSelector.d.ts +2 -2
- package/lib/common/selectors/environmentSelector.js +16 -10
- package/lib/common/selectors/environmentSelector.js.map +1 -1
- package/lib/common/selectors/namedCredentialSelector.d.ts +1 -1
- package/lib/common/selectors/namedCredentialSelector.js +16 -10
- package/lib/common/selectors/namedCredentialSelector.js.map +1 -1
- package/lib/common/selectors/pipelineStageSelector.d.ts +1 -1
- package/lib/common/selectors/pipelineStageSelector.js +18 -13
- package/lib/common/selectors/pipelineStageSelector.js.map +1 -1
- package/lib/common/selectors/selectorUtils.d.ts +1 -1
- package/lib/common/selectors/selectorUtils.js +17 -11
- package/lib/common/selectors/selectorUtils.js.map +1 -1
- package/lib/common/selectors/validateDeploySelector.d.ts +1 -1
- package/lib/common/selectors/validateDeploySelector.js +16 -10
- package/lib/common/selectors/validateDeploySelector.js.map +1 -1
- package/lib/common/selectors/workItemSelector.d.ts +2 -2
- package/lib/common/selectors/workItemSelector.js +16 -10
- package/lib/common/selectors/workItemSelector.js.map +1 -1
- package/lib/common/types.d.ts +4 -4
- package/lib/common/types.js +4 -7
- package/lib/common/types.js.map +1 -1
- package/lib/common/utils.d.ts +4 -4
- package/lib/common/utils.js +42 -43
- package/lib/common/utils.js.map +1 -1
- package/lib/configMeta.js +21 -15
- package/lib/configMeta.js.map +1 -1
- package/lib/streamer/doceMonitor.d.ts +3 -2
- package/lib/streamer/doceMonitor.js +14 -6
- package/lib/streamer/doceMonitor.js.map +1 -1
- package/lib/streamer/doceStream.d.ts +1 -1
- package/lib/streamer/doceStream.js +19 -11
- package/lib/streamer/doceStream.js.map +1 -1
- package/lib/streamer/processors/asyncOpStream.d.ts +2 -2
- package/lib/streamer/processors/asyncOpStream.js +22 -15
- package/lib/streamer/processors/asyncOpStream.js.map +1 -1
- package/lib/streamer/sObjectStream.d.ts +1 -1
- package/lib/streamer/sObjectStream.js +9 -10
- package/lib/streamer/sObjectStream.js.map +1 -1
- package/lib/utils/activatePipeline.d.ts +17 -0
- package/lib/utils/activatePipeline.js +35 -0
- package/lib/utils/activatePipeline.js.map +1 -0
- package/lib/utils/addPipelineStage.d.ts +20 -0
- package/lib/utils/addPipelineStage.js +43 -0
- package/lib/utils/addPipelineStage.js.map +1 -0
- package/lib/utils/attachProject.d.ts +21 -0
- package/lib/utils/attachProject.js +44 -0
- package/lib/utils/attachProject.js.map +1 -0
- package/lib/utils/createPipeline.d.ts +34 -0
- package/lib/utils/createPipeline.js +77 -0
- package/lib/utils/createPipeline.js.map +1 -0
- package/lib/utils/createProject.d.ts +17 -0
- package/lib/utils/createProject.js +39 -0
- package/lib/utils/createProject.js.map +1 -0
- package/lib/utils/createPullRequest.d.ts +49 -0
- package/lib/utils/createPullRequest.js +204 -0
- package/lib/utils/createPullRequest.js.map +1 -0
- package/lib/utils/createWorkItem.d.ts +19 -0
- package/lib/utils/createWorkItem.js +58 -0
- package/lib/utils/createWorkItem.js.map +1 -0
- package/lib/utils/pipelineUtils.d.ts +8 -0
- package/lib/utils/pipelineUtils.js +51 -0
- package/lib/utils/pipelineUtils.js.map +1 -0
- package/lib/utils/types.d.ts +57 -0
- package/lib/utils/types.js +17 -0
- package/lib/utils/types.js.map +1 -0
- package/lib/utils/updateWorkItemStatus.d.ts +34 -0
- package/lib/utils/updateWorkItemStatus.js +71 -0
- package/lib/utils/updateWorkItemStatus.js.map +1 -0
- package/lib/utils/workItems.d.ts +3 -0
- package/lib/utils/workItems.js +181 -0
- package/lib/utils/workItems.js.map +1 -0
- package/messages/commonErrors.md +5 -1
- package/messages/devops.pipeline.activate.md +29 -0
- package/messages/devops.pipeline.attach-project.md +29 -0
- package/messages/devops.pipeline.create.md +81 -0
- package/messages/devops.pipeline.stage.add.md +37 -0
- package/messages/devops.project.create.md +29 -0
- package/messages/devops.project.list.md +17 -0
- package/messages/devops.pull-request.create.md +57 -0
- package/messages/devops.work-item.create.md +29 -0
- package/messages/devops.work-item.list.md +21 -0
- package/messages/devops.work-item.status.update.md +29 -0
- package/npm-shrinkwrap.json +4594 -4552
- package/oclif.lock +3513 -3194
- package/oclif.manifest.json +863 -11
- package/package.json +56 -26
- package/schemas/devops-pipeline-activate.json +28 -0
- package/schemas/devops-pipeline-attach__project.json +25 -0
- package/schemas/devops-pipeline-create.json +50 -0
- package/schemas/devops-pipeline-stage-add.json +31 -0
- package/schemas/devops-project-create.json +28 -0
- package/schemas/devops-project-list.json +35 -0
- package/schemas/devops-pull__request-create.json +34 -0
- package/schemas/devops-work__item-create.json +28 -0
- package/schemas/devops-work__item-list.json +75 -0
- package/schemas/devops-work__item-status-update.json +28 -0
- package/schemas/project-deploy-pipeline-report.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateWorkItemStatus.js","sourceRoot":"","sources":["../../src/utils/updateWorkItemStatus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAwBH;;GAEG;AACH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sB,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChG,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,MAAkC;IAC3E,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAE7D,MAAM,IAAI,GAAG,mBAAmB,UAAU,CAAC,aAAa,EAAE,4BAA4B,SAAS,aAAa,UAAU,EAAE,CAAC;IACzH,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAE7D,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;QACxC,MAAM,EAAE,OAAO;QACf,GAAG,EAAE,IAAI;QACT,IAAI;QACJ,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;KAChD,CAAC,CAAC;IAEH,MAAM,IAAI,GAAI,QAAoC,IAAI,EAAE,CAAC;IACzD,OAAO;QACL,OAAO,EAAE,IAAI;QACb,UAAU;QACV,MAAM,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,IAAI,MAAM,CAAW;KACzD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { computeFirstStageId, fetchPipelineStages, findStageById, getBranchNameFromStage, getPipelineIdForProject, resolveTargetStageId, } from './pipelineUtils.js';
|
|
17
|
+
function normalizeProvider(provider) {
|
|
18
|
+
if (!provider)
|
|
19
|
+
return undefined;
|
|
20
|
+
const normalized = String(provider).toLowerCase();
|
|
21
|
+
if (normalized === 'bitbucketcloud') {
|
|
22
|
+
return 'bitbucket';
|
|
23
|
+
}
|
|
24
|
+
return normalized;
|
|
25
|
+
}
|
|
26
|
+
function providerToVcsType(provider) {
|
|
27
|
+
const normalized = normalizeProvider(provider);
|
|
28
|
+
if (normalized === 'github')
|
|
29
|
+
return 'GITHUB';
|
|
30
|
+
if (normalized === 'bitbucket')
|
|
31
|
+
return 'BITBUCKET';
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
function extractOwnerFromVcsPayload(payload) {
|
|
35
|
+
if (!payload)
|
|
36
|
+
return undefined;
|
|
37
|
+
if (typeof payload === 'string')
|
|
38
|
+
return payload.trim() || undefined;
|
|
39
|
+
const obj = payload;
|
|
40
|
+
if (typeof obj.owner === 'string' && obj.owner.trim()) {
|
|
41
|
+
return obj.owner.trim();
|
|
42
|
+
}
|
|
43
|
+
const list = (obj.owners || obj.items || obj.records);
|
|
44
|
+
if (Array.isArray(list)) {
|
|
45
|
+
for (const candidate of list) {
|
|
46
|
+
if (typeof candidate === 'string' && candidate.trim())
|
|
47
|
+
return candidate.trim();
|
|
48
|
+
if (candidate && typeof candidate === 'object') {
|
|
49
|
+
const ownerVal = candidate.owner;
|
|
50
|
+
if (typeof ownerVal === 'string' && ownerVal.trim())
|
|
51
|
+
return ownerVal.trim();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
async function fetchOwnerByVcsType(connection, vcsType) {
|
|
58
|
+
const path = `/services/data/v${connection.getApiVersion()}/connect/devops/vcs/${vcsType}`;
|
|
59
|
+
const response = await connection.request({ method: 'GET', url: path });
|
|
60
|
+
return extractOwnerFromVcsPayload(response);
|
|
61
|
+
}
|
|
62
|
+
async function fetchVcsOwnersForRecords(connection, records) {
|
|
63
|
+
const providerOwnerMap = new Map();
|
|
64
|
+
const vcsTypes = new Set();
|
|
65
|
+
for (const item of records) {
|
|
66
|
+
const provider = item.SourceCodeRepositoryBranch?.SourceCodeRepository?.Provider;
|
|
67
|
+
const vcsType = providerToVcsType(provider);
|
|
68
|
+
if (vcsType)
|
|
69
|
+
vcsTypes.add(vcsType);
|
|
70
|
+
}
|
|
71
|
+
await Promise.all(Array.from(vcsTypes).map(async (vcsType) => {
|
|
72
|
+
try {
|
|
73
|
+
const owner = await fetchOwnerByVcsType(connection, vcsType);
|
|
74
|
+
if (!owner)
|
|
75
|
+
return;
|
|
76
|
+
if (vcsType === 'GITHUB')
|
|
77
|
+
providerOwnerMap.set('github', owner);
|
|
78
|
+
else if (vcsType === 'BITBUCKET')
|
|
79
|
+
providerOwnerMap.set('bitbucket', owner);
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
// Fall back to RepositoryOwner from work item when Connect API owner lookup fails.
|
|
83
|
+
}
|
|
84
|
+
}));
|
|
85
|
+
return providerOwnerMap;
|
|
86
|
+
}
|
|
87
|
+
function buildRepositoryInfo(item, providerOwnerMap) {
|
|
88
|
+
const repoName = item.SourceCodeRepositoryBranch?.SourceCodeRepository?.Name ?? undefined;
|
|
89
|
+
const provider = item.SourceCodeRepositoryBranch?.SourceCodeRepository?.Provider;
|
|
90
|
+
const normalizedProvider = normalizeProvider(provider);
|
|
91
|
+
const ownerFromConnectApi = normalizedProvider ? providerOwnerMap?.get(normalizedProvider) : undefined;
|
|
92
|
+
const ownerFromRepository = item.SourceCodeRepositoryBranch?.SourceCodeRepository?.RepositoryOwner ?? undefined;
|
|
93
|
+
const repoOwner = normalizedProvider === 'bitbucket'
|
|
94
|
+
? ownerFromRepository ?? ownerFromConnectApi
|
|
95
|
+
: ownerFromConnectApi ?? ownerFromRepository;
|
|
96
|
+
let repoUrl;
|
|
97
|
+
let repoType;
|
|
98
|
+
if (normalizedProvider && repoOwner && repoName) {
|
|
99
|
+
if (normalizedProvider === 'github') {
|
|
100
|
+
repoType = 'github';
|
|
101
|
+
repoUrl = `https://github.com/${repoOwner}/${repoName}`;
|
|
102
|
+
}
|
|
103
|
+
else if (normalizedProvider === 'bitbucket') {
|
|
104
|
+
repoType = 'bitbucket';
|
|
105
|
+
repoUrl = `https://bitbucket.org/${repoOwner}/${repoName}`;
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
repoType = normalizedProvider;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return { repoUrl, repoType };
|
|
112
|
+
}
|
|
113
|
+
async function ensureProjectStages(connection, cache, projectId) {
|
|
114
|
+
if (!projectId)
|
|
115
|
+
return null;
|
|
116
|
+
if (cache.has(projectId))
|
|
117
|
+
return cache.get(projectId) ?? null;
|
|
118
|
+
const pipelineId = await getPipelineIdForProject(connection, projectId);
|
|
119
|
+
if (!pipelineId) {
|
|
120
|
+
cache.set(projectId, null);
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
const stages = await fetchPipelineStages(connection, pipelineId);
|
|
124
|
+
if (!stages?.length) {
|
|
125
|
+
cache.set(projectId, null);
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
const firstStageId = computeFirstStageId(stages);
|
|
129
|
+
const ctx = { pipelineId, stages, firstStageId };
|
|
130
|
+
cache.set(projectId, ctx);
|
|
131
|
+
return ctx;
|
|
132
|
+
}
|
|
133
|
+
function mapRawItemToWorkItem(item, ctx, providerOwnerMap) {
|
|
134
|
+
const { repoUrl, repoType } = buildRepositoryInfo(item, providerOwnerMap);
|
|
135
|
+
const mapped = {
|
|
136
|
+
id: item.Id,
|
|
137
|
+
name: item.Name ?? '',
|
|
138
|
+
subject: item.Subject ?? undefined,
|
|
139
|
+
description: item.Description ?? undefined,
|
|
140
|
+
status: item.Status ?? '',
|
|
141
|
+
owner: item.AssignedToId ?? '',
|
|
142
|
+
SourceCodeRepository: repoUrl ?? repoType ? { repoUrl: repoUrl ?? '', repoType: repoType ?? '' } : undefined,
|
|
143
|
+
WorkItemBranch: item.SourceCodeRepositoryBranch?.Name ?? undefined,
|
|
144
|
+
PipelineStageId: item.DevopsPipelineStageId ?? undefined,
|
|
145
|
+
DevopsProjectId: item.DevopsProjectId,
|
|
146
|
+
PipelineId: ctx?.pipelineId,
|
|
147
|
+
};
|
|
148
|
+
if (ctx) {
|
|
149
|
+
let targetStageId = resolveTargetStageId(mapped.PipelineStageId, ctx.stages);
|
|
150
|
+
if (!targetStageId) {
|
|
151
|
+
targetStageId = ctx.firstStageId;
|
|
152
|
+
}
|
|
153
|
+
const targetStage = findStageById(ctx.stages, targetStageId);
|
|
154
|
+
mapped.TargetBranch = getBranchNameFromStage(targetStage);
|
|
155
|
+
mapped.TargetStageId = targetStageId;
|
|
156
|
+
}
|
|
157
|
+
return mapped;
|
|
158
|
+
}
|
|
159
|
+
export async function fetchWorkItems(connection, projectId) {
|
|
160
|
+
const query = `
|
|
161
|
+
SELECT
|
|
162
|
+
Id, Name, Subject, Description, Status, AssignedToId,
|
|
163
|
+
SourceCodeRepositoryBranchId,
|
|
164
|
+
SourceCodeRepositoryBranch.Name,
|
|
165
|
+
SourceCodeRepositoryBranch.SourceCodeRepositoryId,
|
|
166
|
+
SourceCodeRepositoryBranch.SourceCodeRepository.Name,
|
|
167
|
+
SourceCodeRepositoryBranch.SourceCodeRepository.RepositoryOwner,
|
|
168
|
+
SourceCodeRepositoryBranch.SourceCodeRepository.Provider,
|
|
169
|
+
DevopsPipelineStageId,
|
|
170
|
+
DevopsProjectId
|
|
171
|
+
FROM WorkItem
|
|
172
|
+
WHERE DevopsProjectId = '${projectId}'
|
|
173
|
+
`;
|
|
174
|
+
const result = await connection.query(query);
|
|
175
|
+
const records = result.records ?? [];
|
|
176
|
+
const projectStagesCache = new Map();
|
|
177
|
+
const ctx = await ensureProjectStages(connection, projectStagesCache, projectId);
|
|
178
|
+
const providerOwnerMap = await fetchVcsOwnersForRecords(connection, records);
|
|
179
|
+
return records.map((item) => mapRawItemToWorkItem(item, ctx, providerOwnerMap));
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=workItems.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workItems.js","sourceRoot":"","sources":["../../src/utils/workItems.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAG5B,SAAS,iBAAiB,CAAC,QAAiB;IAC1C,IAAI,CAAC,QAAQ;QAAE,OAAO,SAAS,CAAC;IAChC,MAAM,UAAU,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IAClD,IAAI,UAAU,KAAK,gBAAgB,EAAE,CAAC;QACpC,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,iBAAiB,CAAC,QAAiB;IAC1C,MAAM,UAAU,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC/C,IAAI,UAAU,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC7C,IAAI,UAAU,KAAK,WAAW;QAAE,OAAO,WAAW,CAAC;IACnD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,0BAA0B,CAAC,OAAgB;IAClD,IAAI,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAC/B,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,OAAO,CAAC,IAAI,EAAE,IAAI,SAAS,CAAC;IAE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error.query-string-required
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
The query string is empty or missing. Specify a query string and try again.
|
|
48
|
+
|
|
49
|
+
# error.DevopsCenterNotEnabled
|
|
50
|
+
|
|
51
|
+
We couldn't run this command because DevOps Center isn't enabled in this org. Enable DevOps Center in Setup, and try again.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Activate a DevOps Center pipeline for deployments.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
A pipeline must have at least one stage before you activate it. You can't modify the pipeline stages after you activate and promote changes through it.
|
|
8
|
+
|
|
9
|
+
# flags.target-org.summary
|
|
10
|
+
|
|
11
|
+
Username or alias of the DevOps Center org.
|
|
12
|
+
|
|
13
|
+
# flags.pipeline-id.summary
|
|
14
|
+
|
|
15
|
+
ID of the pipeline.
|
|
16
|
+
|
|
17
|
+
# examples
|
|
18
|
+
|
|
19
|
+
- Activate a pipeline using the pipeline ID.
|
|
20
|
+
|
|
21
|
+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --pipeline-id 0XB000000000001
|
|
22
|
+
|
|
23
|
+
# error.NoStages
|
|
24
|
+
|
|
25
|
+
Can't activate pipeline %s. Add at least one stage, then try again.
|
|
26
|
+
|
|
27
|
+
# error.AlreadyActive
|
|
28
|
+
|
|
29
|
+
Pipeline %s is already active.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Attach a DevOps Center project to a pipeline.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
You can attach a project to only one pipeline.
|
|
8
|
+
|
|
9
|
+
# flags.target-org.summary
|
|
10
|
+
|
|
11
|
+
Username or alias of the DevOps Center org.
|
|
12
|
+
|
|
13
|
+
# flags.pipeline-id.summary
|
|
14
|
+
|
|
15
|
+
ID of the pipeline.
|
|
16
|
+
|
|
17
|
+
# flags.project-id.summary
|
|
18
|
+
|
|
19
|
+
ID of the DevOps Center project.
|
|
20
|
+
|
|
21
|
+
# examples
|
|
22
|
+
|
|
23
|
+
- Attach a project to a pipeline using the project ID and pipeline ID.
|
|
24
|
+
|
|
25
|
+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --pipeline-id 0XB000000000001 --project-id 0Hn000000000001
|
|
26
|
+
|
|
27
|
+
# error.AlreadyAttached
|
|
28
|
+
|
|
29
|
+
Project %s is already attached to pipeline %s. Remove the project, and then try again.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Create a DevOps Center pipeline.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Provide the URL of an existing repository, or use `--create-repo` with a repository name to create one. After you create the pipeline, add stages, and activate the pipeline.
|
|
8
|
+
|
|
9
|
+
# flags.target-org.summary
|
|
10
|
+
|
|
11
|
+
Username or alias of the DevOps Center org.
|
|
12
|
+
|
|
13
|
+
# flags.name.summary
|
|
14
|
+
|
|
15
|
+
Name of the pipeline.
|
|
16
|
+
|
|
17
|
+
# flags.repo.summary
|
|
18
|
+
|
|
19
|
+
URL of an existing repository or the name of a repository to create.
|
|
20
|
+
|
|
21
|
+
# flags.repo-type.summary
|
|
22
|
+
|
|
23
|
+
Type of the source code repository. Required when creating a repository using '--create-repo'.
|
|
24
|
+
|
|
25
|
+
# flags.create-repo.summary
|
|
26
|
+
|
|
27
|
+
Create a repository if it doesn't exist.
|
|
28
|
+
|
|
29
|
+
# flags.repo-owner.summary
|
|
30
|
+
|
|
31
|
+
Owner (organization or user) of the repository. Required when creating a repository using '--create-repo'.
|
|
32
|
+
|
|
33
|
+
# flags.bitbucket-project.summary
|
|
34
|
+
|
|
35
|
+
Bitbucket project key for the repository. Used when creating a Bitbucket repository with '--create-repo'.
|
|
36
|
+
|
|
37
|
+
# flags.description.summary
|
|
38
|
+
|
|
39
|
+
Description of the pipeline.
|
|
40
|
+
|
|
41
|
+
# examples
|
|
42
|
+
|
|
43
|
+
- Create a pipeline and associate it with an existing GitHub repository.
|
|
44
|
+
|
|
45
|
+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --name "Release Pipeline" --repo https://github.com/myorg/myrepo
|
|
46
|
+
|
|
47
|
+
- Create a pipeline and associate it with a new GitHub repository.
|
|
48
|
+
|
|
49
|
+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --name "Release Pipeline" --repo my-new-repo --repo-type github --repo-owner myorg --create-repo
|
|
50
|
+
|
|
51
|
+
- Create a pipeline with a description and associate it with a Bitbucket repository.
|
|
52
|
+
|
|
53
|
+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --name "Release Pipeline" --repo https://bitbucket.org/myorg/myrepo --description "Main CI/CD pipeline for production releases"
|
|
54
|
+
|
|
55
|
+
# error.RepoTypeRequired
|
|
56
|
+
|
|
57
|
+
The --repo-type flag is required when using --create-repo. Specify --repo-type github or --repo-type bitbucket.
|
|
58
|
+
|
|
59
|
+
# error.RepoCreationFailed
|
|
60
|
+
|
|
61
|
+
Failed to create repository "%s". Verify the --repo-owner has permission to create repositories and the repository name is available. Details: %s
|
|
62
|
+
|
|
63
|
+
# error.RepoNotFound
|
|
64
|
+
|
|
65
|
+
Repository "%s" was not found or you don't have access. Verify the repository URL is correct and your DevOps Center org has the required VCS credentials.
|
|
66
|
+
|
|
67
|
+
# error.RepoValidationFailed
|
|
68
|
+
|
|
69
|
+
Failed to validate repository "%s". When using an existing repository, provide the full URL (e.g. https://github.com/owner/repo). To create a new repository, use --create-repo with --repo-type and --repo-owner.
|
|
70
|
+
|
|
71
|
+
# error.RepoOwnerRequired
|
|
72
|
+
|
|
73
|
+
The --repo-owner flag is required when using --create-repo. Specify the GitHub or Bitbucket organization or user that will own the repository.
|
|
74
|
+
|
|
75
|
+
# error.VcsCredentialsMissing
|
|
76
|
+
|
|
77
|
+
No VCS credentials found for repository "%s". Connect to Bitbucket in your DevOps Center org before creating a pipeline.
|
|
78
|
+
|
|
79
|
+
# error.RepoTypeDetectionFailed
|
|
80
|
+
|
|
81
|
+
Unable to detect the repository type from the URL "%s". Use --repo-type to specify the repository type.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Add a stage to a DevOps Center pipeline.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Inserts an empty stage before the stage specified by `--next-stage-id`. The new stage doesn't include a branch or environment. Configure them separately after you create the stage.
|
|
8
|
+
|
|
9
|
+
# flags.target-org.summary
|
|
10
|
+
|
|
11
|
+
Username or alias of the DevOps Center org.
|
|
12
|
+
|
|
13
|
+
# flags.pipeline-id.summary
|
|
14
|
+
|
|
15
|
+
ID of the pipeline where the stage is added.
|
|
16
|
+
|
|
17
|
+
# flags.name.summary
|
|
18
|
+
|
|
19
|
+
Name of the pipeline stage, such as Integration, UAT, or Staging.
|
|
20
|
+
|
|
21
|
+
# flags.next-stage-id.summary
|
|
22
|
+
|
|
23
|
+
ID of the stage that follows the new stage in the pipeline.
|
|
24
|
+
|
|
25
|
+
# examples
|
|
26
|
+
|
|
27
|
+
- Add a Development stage before Integration in a specific pipeline.
|
|
28
|
+
|
|
29
|
+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --pipeline-id 0XB000000000001 --name "Development" --next-stage-id 0Xc000000000002
|
|
30
|
+
|
|
31
|
+
- Add a QA stage before UAT in a specific pipeline.
|
|
32
|
+
|
|
33
|
+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --pipeline-id 0XB000000000001 --name "QA" --next-stage-id 0Xc000000000003
|
|
34
|
+
|
|
35
|
+
# error.StageNotFound
|
|
36
|
+
|
|
37
|
+
Stage %s not found in pipeline %s. Check the stage ID and try again.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Create a DevOps Center project in a DevOps Center org.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Creates a new DevOps Center project with the specified name and optional description.
|
|
8
|
+
|
|
9
|
+
# flags.target-org.summary
|
|
10
|
+
|
|
11
|
+
Username or alias of the DevOps Center org.
|
|
12
|
+
|
|
13
|
+
# flags.name.summary
|
|
14
|
+
|
|
15
|
+
Name of the new DevOps Center project.
|
|
16
|
+
|
|
17
|
+
# flags.description.summary
|
|
18
|
+
|
|
19
|
+
Description of the new project; if not specified, the description is blank.
|
|
20
|
+
|
|
21
|
+
# examples
|
|
22
|
+
|
|
23
|
+
- Create a new DevOps Center project in the specified org.
|
|
24
|
+
|
|
25
|
+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --name "MyApp Release"
|
|
26
|
+
|
|
27
|
+
- Create a project with a name and description.
|
|
28
|
+
|
|
29
|
+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --name "Platform Update" --description "Platform services update"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
List all DevOps Center projects in a Salesforce org.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
This command queries the DevopsProject standard object and returns the project Id, Name, and Description for each project found.
|
|
8
|
+
|
|
9
|
+
# examples
|
|
10
|
+
|
|
11
|
+
- List all DevOps Center projects in an org with alias "my-devops-org":
|
|
12
|
+
|
|
13
|
+
<%= config.bin %> <%= command.id %> --target-org my-devops-org
|
|
14
|
+
|
|
15
|
+
- List projects using an org's username:
|
|
16
|
+
|
|
17
|
+
<%= config.bin %> <%= command.id %> --target-org devops-center@example.com
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Create a pull request for a work item branch.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
The pull request title defaults to the work item subject. The work item must have an associated branch and repository. Requires VCS authentication: set GITHUB_TOKEN (or use `gh auth login`) for GitHub, or set BITBUCKET_TOKEN for Bitbucket.
|
|
8
|
+
|
|
9
|
+
# flags.work-item-name.summary
|
|
10
|
+
|
|
11
|
+
Name of the work item, such as WI-000001.
|
|
12
|
+
|
|
13
|
+
# flags.work-item-id.summary
|
|
14
|
+
|
|
15
|
+
ID of the work item.
|
|
16
|
+
|
|
17
|
+
# flags.title.summary
|
|
18
|
+
|
|
19
|
+
Title of the pull request.
|
|
20
|
+
|
|
21
|
+
# flags.body.summary
|
|
22
|
+
|
|
23
|
+
Description of the pull request.
|
|
24
|
+
|
|
25
|
+
# examples
|
|
26
|
+
|
|
27
|
+
- Create a pull request for a work item using the default title.
|
|
28
|
+
|
|
29
|
+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --work-item-name WI-000001
|
|
30
|
+
|
|
31
|
+
- Create a pull request with a custom title and description.
|
|
32
|
+
|
|
33
|
+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --work-item-id 0Wx000000000001 --title "Fix: Login timeout" --body "Resolves the 30s timeout on the login page"
|
|
34
|
+
|
|
35
|
+
# error.NoBranch
|
|
36
|
+
|
|
37
|
+
Work item %s doesn't have an associated branch. Mark the work item as In Progress to create a branch, then try again.
|
|
38
|
+
|
|
39
|
+
# error.NoRepo
|
|
40
|
+
|
|
41
|
+
Work item %s doesn't have an associated repository. Verify the project is connected to a source control repository and try again.
|
|
42
|
+
|
|
43
|
+
# error.NoTargetBranch
|
|
44
|
+
|
|
45
|
+
Unable to determine the target branch for work item %s. Verify the pipeline stages are configured correctly.
|
|
46
|
+
|
|
47
|
+
# error.NoProvider
|
|
48
|
+
|
|
49
|
+
Unable to determine the VCS provider for work item %s. Verify the project is connected to a supported source control provider (GitHub or Bitbucket).
|
|
50
|
+
|
|
51
|
+
# flags.target-org.summary
|
|
52
|
+
|
|
53
|
+
Username or alias of the DevOps Center org.
|
|
54
|
+
|
|
55
|
+
# error.NoToken
|
|
56
|
+
|
|
57
|
+
No authentication token found for %s. For GitHub, set the GITHUB_TOKEN environment variable or run "gh auth login". For Bitbucket, set the BITBUCKET_TOKEN environment variable.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Create a new work item in a DevOps Center project.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
The command creates the work item using the Connect API. Requires a project ID and a subject for the new work item; run the `devops project list` command to get the IDs for all existing projects.
|
|
8
|
+
|
|
9
|
+
# flags.project-id.summary
|
|
10
|
+
|
|
11
|
+
ID of the DevOps Center project to create the work item in.
|
|
12
|
+
|
|
13
|
+
# flags.subject.summary
|
|
14
|
+
|
|
15
|
+
Subject (title) of the new work item.
|
|
16
|
+
|
|
17
|
+
# flags.description.summary
|
|
18
|
+
|
|
19
|
+
Description of the new work item; if not specified, the description is blank.
|
|
20
|
+
|
|
21
|
+
# examples
|
|
22
|
+
|
|
23
|
+
- Create a work item for the project with the specified ID and give the work item the specified subject (title); use the DevOps Center org with alias "my-devops-org":
|
|
24
|
+
|
|
25
|
+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --project-id 1Qg000000000001 --subject "Fix login bug"
|
|
26
|
+
|
|
27
|
+
- Create a work item with a subject and description:
|
|
28
|
+
|
|
29
|
+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --project-id 1Qg000000000001 --subject "Add dark mode" --description "Implement dark mode toggle in settings page"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
List all work items for a DevOps Center project.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Each work item displays the branch, environment, and repository details needed for checkout and promotion. Requires a project ID; run the `devops project list` command to get the IDs for all existing projects.
|
|
8
|
+
|
|
9
|
+
# flags.project-id.summary
|
|
10
|
+
|
|
11
|
+
ID of the DevOps Center project to list work items for.
|
|
12
|
+
|
|
13
|
+
# examples
|
|
14
|
+
|
|
15
|
+
- List work items for a specific project in the DevOps org with alias "my-devops-org":
|
|
16
|
+
|
|
17
|
+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --project-id 1Qg000000000001
|
|
18
|
+
|
|
19
|
+
- List work items using JSON output:
|
|
20
|
+
|
|
21
|
+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --project-id 1Qg000000000001 --json
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Update the status of a work item in DevOps Center.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Allowed statuses are "In Progress" and "Ready to Promote".
|
|
8
|
+
|
|
9
|
+
# flags.work-item-name.summary
|
|
10
|
+
|
|
11
|
+
Name of the work item, such as WI-000001.
|
|
12
|
+
|
|
13
|
+
# flags.work-item-id.summary
|
|
14
|
+
|
|
15
|
+
ID of the work item.
|
|
16
|
+
|
|
17
|
+
# flags.status.summary
|
|
18
|
+
|
|
19
|
+
Status to set for the work item. Allowed values: "In Progress", "Ready to Promote".
|
|
20
|
+
|
|
21
|
+
# examples
|
|
22
|
+
|
|
23
|
+
- Update a work item status by its name to indicate the work is underway:
|
|
24
|
+
|
|
25
|
+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --work-item-name WI-000001 --status "In Progress"
|
|
26
|
+
|
|
27
|
+
- Update a work item status by its ID to indicate the changes are ready for promotion:
|
|
28
|
+
|
|
29
|
+
<%= config.bin %> <%= command.id %> --target-org my-devops-org --work-item-id 0Wx000000000001 --status "Ready to Promote"
|