@salesforce/plugin-devops-center 1.2.27 → 1.3.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/LICENSE.txt +200 -6
- package/README.md +515 -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/stage/add-branch.d.ts +17 -0
- package/lib/commands/devops/stage/add-branch.js +110 -0
- package/lib/commands/devops/stage/add-branch.js.map +1 -0
- package/lib/commands/devops/stage/add-environment.d.ts +18 -0
- package/lib/commands/devops/stage/add-environment.js +136 -0
- package/lib/commands/devops/stage/add-environment.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/addStageBranch.d.ts +22 -0
- package/lib/utils/addStageBranch.js +48 -0
- package/lib/utils/addStageBranch.js.map +1 -0
- package/lib/utils/addStageEnvironment.d.ts +92 -0
- package/lib/utils/addStageEnvironment.js +120 -0
- package/lib/utils/addStageEnvironment.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.stage.add-branch.md +46 -0
- package/messages/devops.stage.add-environment.md +61 -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 +4197 -4471
- package/oclif.lock +3380 -3272
- package/oclif.manifest.json +1056 -11
- package/package.json +53 -23
- 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-stage-add__branch.json +34 -0
- package/schemas/devops-stage-add__environment.json +47 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../../../src/commands/project/deploy/pipeline/validate.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../../../src/commands/project/deploy/pipeline/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,cAAc,MAAM,YAAY,CAAC;AAExC,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,kCAAkC,CAAC,CAAC;AAE/G;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,cAAc;IACzD,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,CAAU,KAAK,GAAG,MAAM,CAAC;IAC5B,WAAW,GAAG,yBAAyB,CAAC;IACjC,aAAa,GAAG,IAAI,CAAC;IAE/B,KAAK,CAAC,GAAG;QACd,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACjC,CAAC;IAED;;OAEG;IACO,iBAAiB;QACzB,OAAO,EAAE,GAAG,KAAK,CAAC,iBAAiB,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC;IAC3E,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Org, SfError } from '@salesforce/core';
|
|
2
2
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
3
|
import { Duration } from '@salesforce/kit';
|
|
4
|
-
import { AsyncOperationResultJson } from '../types';
|
|
5
|
-
import { PromoteOutputService } from '../outputService';
|
|
4
|
+
import { type AsyncOperationResultJson } from '../types.js';
|
|
5
|
+
import type { PromoteOutputService } from '../outputService/index.js';
|
|
6
6
|
export declare abstract class AsyncCommand extends SfCommand<AsyncOperationResultJson> {
|
|
7
7
|
static readonly enableJsonFlag = true;
|
|
8
8
|
protected targetOrg: Org;
|
|
@@ -23,7 +23,7 @@ export declare abstract class AsyncCommand extends SfCommand<AsyncOperationResul
|
|
|
23
23
|
* @param error
|
|
24
24
|
* @returns
|
|
25
25
|
*/
|
|
26
|
-
protected catch(error: Error | SfError): Promise<
|
|
26
|
+
protected catch(error: Error | SfError): Promise<never>;
|
|
27
27
|
/**
|
|
28
28
|
*
|
|
29
29
|
* Stores the AOR Id in cache.
|
|
@@ -1,20 +1,30 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AsyncCommand = void 0;
|
|
4
1
|
/*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the
|
|
8
|
-
*
|
|
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.
|
|
9
15
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const messages =
|
|
17
|
-
class AsyncCommand extends
|
|
16
|
+
import { Messages } from '@salesforce/core';
|
|
17
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
18
|
+
import { DeployPipelineCache } from '../deployPipelineCache.js';
|
|
19
|
+
import { AsyncOperationStatus } from '../types.js';
|
|
20
|
+
import { fetchAsyncOperationResult, getAsyncOperationStreamer } from '../../common/index.js';
|
|
21
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
22
|
+
const messages = Messages.loadMessages('@salesforce/plugin-devops-center', 'commonErrors');
|
|
23
|
+
export class AsyncCommand extends SfCommand {
|
|
24
|
+
static enableJsonFlag = true;
|
|
25
|
+
targetOrg;
|
|
26
|
+
asyncOperationId;
|
|
27
|
+
outputService;
|
|
18
28
|
setAsyncOperationId(aorId) {
|
|
19
29
|
this.asyncOperationId = aorId;
|
|
20
30
|
}
|
|
@@ -35,7 +45,7 @@ class AsyncCommand extends sf_plugins_core_1.SfCommand {
|
|
|
35
45
|
return this.getOperationState();
|
|
36
46
|
}
|
|
37
47
|
await this.startMonitoring(wait);
|
|
38
|
-
if (this.outputService.getStatus() ===
|
|
48
|
+
if (this.outputService.getStatus() === AsyncOperationStatus.Completed) {
|
|
39
49
|
this.outputService.displayEndResults();
|
|
40
50
|
}
|
|
41
51
|
return this.getOperationState();
|
|
@@ -58,14 +68,14 @@ class AsyncCommand extends sf_plugins_core_1.SfCommand {
|
|
|
58
68
|
* Stores the AOR Id in cache.
|
|
59
69
|
*/
|
|
60
70
|
async cacheOperation() {
|
|
61
|
-
await
|
|
71
|
+
await DeployPipelineCache.set(this.asyncOperationId, {});
|
|
62
72
|
}
|
|
63
73
|
/**
|
|
64
74
|
*
|
|
65
75
|
* Executes a query to get the state of the AOR record.
|
|
66
76
|
*/
|
|
67
77
|
async getOperationState() {
|
|
68
|
-
const asyncJob = await
|
|
78
|
+
const asyncJob = await fetchAsyncOperationResult(this.targetOrg.getConnection(), this.asyncOperationId);
|
|
69
79
|
return {
|
|
70
80
|
jobId: this.asyncOperationId,
|
|
71
81
|
status: asyncJob.sf_devops__Status__c,
|
|
@@ -79,10 +89,10 @@ class AsyncCommand extends sf_plugins_core_1.SfCommand {
|
|
|
79
89
|
* @param wait
|
|
80
90
|
*/
|
|
81
91
|
async startMonitoring(wait) {
|
|
82
|
-
const asyncJob = await
|
|
92
|
+
const asyncJob = await fetchAsyncOperationResult(this.targetOrg.getConnection(), this.asyncOperationId);
|
|
83
93
|
if (asyncJob.sf_devops__Status__c === undefined ||
|
|
84
|
-
asyncJob.sf_devops__Status__c ===
|
|
85
|
-
const streamer =
|
|
94
|
+
asyncJob.sf_devops__Status__c === AsyncOperationStatus.InProgress) {
|
|
95
|
+
const streamer = getAsyncOperationStreamer(this.targetOrg, wait, this.asyncOperationId, this.outputService);
|
|
86
96
|
await streamer.monitor();
|
|
87
97
|
}
|
|
88
98
|
else {
|
|
@@ -90,6 +100,4 @@ class AsyncCommand extends sf_plugins_core_1.SfCommand {
|
|
|
90
100
|
}
|
|
91
101
|
}
|
|
92
102
|
}
|
|
93
|
-
exports.AsyncCommand = AsyncCommand;
|
|
94
|
-
AsyncCommand.enableJsonFlag = true;
|
|
95
103
|
//# sourceMappingURL=abstractAsyncOperation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstractAsyncOperation.js","sourceRoot":"","sources":["../../../src/common/base/abstractAsyncOperation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"abstractAsyncOperation.js","sourceRoot":"","sources":["../../../src/common/base/abstractAsyncOperation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,QAAQ,EAAgB,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAA4D,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC7G,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAG7F,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,cAAc,CAAC,CAAC;AAE3F,MAAM,OAAgB,YAAa,SAAQ,SAAmC;IACrE,MAAM,CAAU,cAAc,GAAG,IAAI,CAAC;IACnC,SAAS,CAAM;IACjB,gBAAgB,CAAS;IACzB,aAAa,CAAuB;IAIlC,mBAAmB,CAAC,KAAa;QACzC,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;IAChC,CAAC;IAES,gBAAgB,CAAC,OAA6B;QACtD,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACO,KAAK,CAAC,gBAAgB,CAAC,OAAgB,EAAE,IAAc;QAC/D,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QAC5B,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACnD,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;QAChC,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,CAAC;QAEpC,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,IAAI,CAAC,i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AE,QAAQ,CAAC,qBAA+B;YACjD,YAAY,EAAE,QAAQ,CAAC,2BAAqC;SAC7D,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,eAAe,CAAC,IAAc;QAC1C,MAAM,QAAQ,GAAyB,MAAM,yBAAyB,CACpE,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,EAC9B,IAAI,CAAC,gBAAgB,CACtB,CAAC;QACF,IACE,QAAQ,CAAC,oBAAoB,KAAK,SAAS;YAC3C,QAAQ,CAAC,oBAAoB,KAAK,oBAAoB,CAAC,UAAU,EACjE,CAAC;YACD,MAAM,QAAQ,GAAgB,yBAAyB,CACrD,IAAI,CAAC,SAAS,EACd,IAAI,EACJ,IAAI,CAAC,gBAAgB,EACrB,IAAI,CAAC,aAAa,CACnB,CAAC;YACF,MAAM,QAAQ,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
2
|
import { Interfaces } from '@oclif/core';
|
|
3
|
-
import { PipelineStage, PromoteOptions } from '
|
|
4
|
-
import { AsyncOperationResultJson } from '../../common';
|
|
5
|
-
import { AsyncCommand } from './abstractAsyncOperation';
|
|
3
|
+
import { PipelineStage, PromoteOptions, TestLevel } from '../index.js';
|
|
4
|
+
import type { AsyncOperationResultJson } from '../../common/index.js';
|
|
5
|
+
import { AsyncCommand } from './abstractAsyncOperation.js';
|
|
6
6
|
export type Flags<T extends typeof SfCommand> = Interfaces.InferredFlags<(typeof PromoteCommand)['baseFlags'] & T['flags']>;
|
|
7
7
|
export declare abstract class PromoteCommand<T extends typeof SfCommand> extends AsyncCommand {
|
|
8
8
|
static readonly enableJsonFlag = true;
|
|
@@ -13,11 +13,12 @@ export declare abstract class PromoteCommand<T extends typeof SfCommand> extends
|
|
|
13
13
|
'devops-center-project-name': Interfaces.OptionFlag<string>;
|
|
14
14
|
'devops-center-username': Interfaces.OptionFlag<import("@salesforce/core").Org, Interfaces.CustomOptions>;
|
|
15
15
|
tests: Interfaces.OptionFlag<string[] | undefined>;
|
|
16
|
-
'test-level': Interfaces.OptionFlag<
|
|
16
|
+
'test-level': Interfaces.OptionFlag<TestLevel | undefined, Interfaces.CustomOptions>;
|
|
17
17
|
async: Interfaces.BooleanFlag<boolean>;
|
|
18
18
|
wait: Interfaces.OptionFlag<import("@salesforce/kit").Duration>;
|
|
19
19
|
verbose: Interfaces.BooleanFlag<boolean>;
|
|
20
20
|
concise: Interfaces.BooleanFlag<boolean>;
|
|
21
|
+
'flags-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
22
|
};
|
|
22
23
|
protected flags: Flags<T>;
|
|
23
24
|
private targetStage;
|
|
@@ -1,18 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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 { SfCommand } from '@salesforce/sf-plugins-core';
|
|
17
|
+
import { fetchAndValidatePipelineStage, validateTestFlags, } from '../index.js';
|
|
18
|
+
import { devopsCenterProjectName, requiredDoceOrgFlag, wait, verbose, concise } from '../flags/flags.js';
|
|
19
|
+
import { branchName, bundleVersionName, deployAll, specificTests, testLevel, async, } from '../flags/promote/promoteFlags.js';
|
|
20
|
+
import { REST_PROMOTE_BASE_URL, HTTP_CONFLICT_CODE } from '../constants.js';
|
|
21
|
+
import { OutputServiceFactory } from '../outputService/index.js';
|
|
22
|
+
import { sleep } from '../utils.js';
|
|
23
|
+
import { AsyncCommand } from './abstractAsyncOperation.js';
|
|
24
|
+
export class PromoteCommand extends AsyncCommand {
|
|
25
|
+
static enableJsonFlag = true;
|
|
26
|
+
// common flags that can be inherited by any command that extends PromoteCommand
|
|
27
|
+
static baseFlags = {
|
|
28
|
+
...SfCommand.baseFlags,
|
|
29
|
+
'branch-name': branchName,
|
|
30
|
+
'bundle-version-name': bundleVersionName,
|
|
31
|
+
'deploy-all': deployAll,
|
|
32
|
+
'devops-center-project-name': devopsCenterProjectName,
|
|
33
|
+
'devops-center-username': requiredDoceOrgFlag(),
|
|
34
|
+
tests: specificTests,
|
|
35
|
+
'test-level': testLevel(),
|
|
36
|
+
async,
|
|
37
|
+
wait,
|
|
38
|
+
verbose,
|
|
39
|
+
concise,
|
|
40
|
+
};
|
|
41
|
+
flags;
|
|
42
|
+
targetStage;
|
|
43
|
+
sourceStageId;
|
|
44
|
+
deployOptions;
|
|
45
|
+
numRetries409 = 50; // this is the number of times we retry if we get a http-409-Conflict response
|
|
16
46
|
async init() {
|
|
17
47
|
await super.init();
|
|
18
48
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
@@ -24,11 +54,11 @@ class PromoteCommand extends abstractAsyncOperation_1.AsyncCommand {
|
|
|
24
54
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
25
55
|
this.flags = flags;
|
|
26
56
|
this.targetOrg = this.flags['devops-center-username'];
|
|
27
|
-
this.setOutputService(new
|
|
57
|
+
this.setOutputService(new OutputServiceFactory().forDeployment(this.flags, this.targetOrg.getConnection()));
|
|
28
58
|
}
|
|
29
59
|
async executePromotion() {
|
|
30
|
-
|
|
31
|
-
this.targetStage = await
|
|
60
|
+
validateTestFlags(this.flags['test-level'], this.flags.tests);
|
|
61
|
+
this.targetStage = await fetchAndValidatePipelineStage(this.targetOrg, this.flags['devops-center-project-name'], this.flags['branch-name']);
|
|
32
62
|
this.sourceStageId = this.getSourceStageId();
|
|
33
63
|
this.setAsyncOperationId(await this.requestPromotionFlow());
|
|
34
64
|
return this.monitorOperation(this.flags.async, this.flags.wait);
|
|
@@ -47,7 +77,7 @@ class PromoteCommand extends abstractAsyncOperation_1.AsyncCommand {
|
|
|
47
77
|
catch (error) {
|
|
48
78
|
const err = error;
|
|
49
79
|
// if we get a 409 error then call the retry flow
|
|
50
|
-
if (err.errorCode ===
|
|
80
|
+
if (err.errorCode === HTTP_CONFLICT_CODE) {
|
|
51
81
|
this.spinner.start('Synchronization of source control system events in progress');
|
|
52
82
|
spinnerStarted = true;
|
|
53
83
|
return await this.retryRequestPromotion(this.numRetries409);
|
|
@@ -71,13 +101,13 @@ class PromoteCommand extends abstractAsyncOperation_1.AsyncCommand {
|
|
|
71
101
|
async retryRequestPromotion(numRetries) {
|
|
72
102
|
try {
|
|
73
103
|
// Sleep 2 seconds before requesting promotion again.
|
|
74
|
-
await
|
|
104
|
+
await sleep(2000);
|
|
75
105
|
return await this.requestPromotion();
|
|
76
106
|
}
|
|
77
107
|
catch (error) {
|
|
78
108
|
const err = error;
|
|
79
109
|
// if we still get a 409 error and haven't run out of retry attempts then retry again
|
|
80
|
-
if (err.errorCode ===
|
|
110
|
+
if (err.errorCode === HTTP_CONFLICT_CODE && numRetries > 1) {
|
|
81
111
|
return this.retryRequestPromotion(numRetries - 1);
|
|
82
112
|
}
|
|
83
113
|
throw error;
|
|
@@ -90,7 +120,7 @@ class PromoteCommand extends abstractAsyncOperation_1.AsyncCommand {
|
|
|
90
120
|
this.buildPromoteOptions();
|
|
91
121
|
const req = {
|
|
92
122
|
method: 'POST',
|
|
93
|
-
url: `${
|
|
123
|
+
url: `${REST_PROMOTE_BASE_URL}${this.targetStage.sf_devops__Pipeline__r.sf_devops__Project__c}/pipelineName/${this.sourceStageId}`,
|
|
94
124
|
body: JSON.stringify({
|
|
95
125
|
changeBundleName: this.flags['bundle-version-name'],
|
|
96
126
|
promoteOptions: this.deployOptions,
|
|
@@ -109,20 +139,4 @@ class PromoteCommand extends abstractAsyncOperation_1.AsyncCommand {
|
|
|
109
139
|
};
|
|
110
140
|
}
|
|
111
141
|
}
|
|
112
|
-
exports.PromoteCommand = PromoteCommand;
|
|
113
|
-
PromoteCommand.enableJsonFlag = true;
|
|
114
|
-
// common flags that can be inherited by any command that extends PromoteCommand
|
|
115
|
-
PromoteCommand.baseFlags = {
|
|
116
|
-
'branch-name': promoteFlags_1.branchName,
|
|
117
|
-
'bundle-version-name': promoteFlags_1.bundleVersionName,
|
|
118
|
-
'deploy-all': promoteFlags_1.deployAll,
|
|
119
|
-
'devops-center-project-name': flags_1.devopsCenterProjectName,
|
|
120
|
-
'devops-center-username': (0, flags_1.requiredDoceOrgFlag)(),
|
|
121
|
-
tests: promoteFlags_1.specificTests,
|
|
122
|
-
'test-level': (0, promoteFlags_1.testLevel)(),
|
|
123
|
-
async: promoteFlags_1.async,
|
|
124
|
-
wait: flags_1.wait,
|
|
125
|
-
verbose: flags_1.verbose,
|
|
126
|
-
concise: flags_1.concise,
|
|
127
|
-
};
|
|
128
142
|
//# sourceMappingURL=abstractPromote.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstractPromote.js","sourceRoot":"","sources":["../../../src/common/base/abstractPromote.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"abstractPromote.js","sourceRoot":"","sources":["../../../src/common/base/abstractPromote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AE;YACrC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,gBAAgB,EAAE,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC;gBACnD,cAAc,EAAE,IAAI,CAAC,aAAa;aACnC,CAAC;SACH,CAAC;QACF,MAAM,QAAQ,GAAuB,MAAM,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACvF,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;IAEO,mBAAmB;QACzB,IAAI,CAAC,aAAa,GAAG;YACnB,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAY;YAC/C,SAAS,EAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAY,IAAI,SAAS;YAC5D,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;YACnE,sEAAsE;YACtE,GAAG,IAAI,CAAC,iBAAiB,EAAE;SAC5B,CAAC;IACJ,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Interfaces } from '@oclif/core';
|
|
2
2
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
-
import { PipelineStage, PromoteOptions } from '
|
|
4
|
-
import { AsyncOperationResultJson } from '../../common';
|
|
5
|
-
import { AsyncCommand } from './abstractAsyncOperation';
|
|
3
|
+
import { PipelineStage, PromoteOptions } from '../index.js';
|
|
4
|
+
import type { AsyncOperationResultJson } from '../../common/index.js';
|
|
5
|
+
import { AsyncCommand } from './abstractAsyncOperation.js';
|
|
6
6
|
export type Flags<T extends typeof SfCommand> = Interfaces.InferredFlags<(typeof QuickPromotionCommand)['baseFlags'] & T['flags']>;
|
|
7
7
|
export default abstract class QuickPromotionCommand<T extends typeof SfCommand> extends AsyncCommand {
|
|
8
8
|
static readonly enableJsonFlag = true;
|
|
@@ -14,6 +14,7 @@ export default abstract class QuickPromotionCommand<T extends typeof SfCommand>
|
|
|
14
14
|
'devops-center-username': Interfaces.OptionFlag<import("@salesforce/core").Org, Interfaces.CustomOptions>;
|
|
15
15
|
'job-id': Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
|
|
16
16
|
'use-most-recent': Interfaces.BooleanFlag<boolean>;
|
|
17
|
+
'flags-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
18
|
};
|
|
18
19
|
protected flags: Flags<T>;
|
|
19
20
|
private targetStage;
|
|
@@ -1,19 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { Messages } from '@salesforce/core';
|
|
2
|
+
import { Flags as SfFlags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
+
import { AsyncOperationStatus } from '../index.js';
|
|
4
|
+
import { REST_PROMOTE_BASE_URL } from '../constants.js';
|
|
5
|
+
import { DeployPipelineCache } from '../deployPipelineCache.js';
|
|
6
|
+
import { async } from '../flags/promote/promoteFlags.js';
|
|
7
|
+
import { concise, requiredDoceOrgFlag, verbose, wait } from '../flags/flags.js';
|
|
8
|
+
import { OutputServiceFactory } from '../outputService/index.js';
|
|
9
|
+
import { selectOneDeploymentResultWithChangeBundleInstallsByAsyncJobId, } from '../selectors/deploymentResultsSelector.js';
|
|
10
|
+
import { selectOnePipelineStageByEnvironmentId } from '../selectors/pipelineStageSelector.js';
|
|
11
|
+
import { AsyncCommand } from './abstractAsyncOperation.js';
|
|
12
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
13
|
+
const messages = Messages.loadMessages('@salesforce/plugin-devops-center', 'project.deploy.pipeline.quick');
|
|
14
|
+
export default class QuickPromotionCommand extends AsyncCommand {
|
|
15
|
+
static enableJsonFlag = true;
|
|
16
|
+
static baseFlags = {
|
|
17
|
+
...SfCommand.baseFlags,
|
|
18
|
+
async,
|
|
19
|
+
concise,
|
|
20
|
+
verbose,
|
|
21
|
+
wait,
|
|
22
|
+
'devops-center-username': requiredDoceOrgFlag(),
|
|
23
|
+
'job-id': SfFlags.salesforceId({
|
|
24
|
+
char: 'i',
|
|
25
|
+
description: messages.getMessage('flags.job-id.description'),
|
|
26
|
+
summary: messages.getMessage('flags.job-id.summary'),
|
|
27
|
+
exactlyOne: ['use-most-recent', 'job-id'],
|
|
28
|
+
}),
|
|
29
|
+
'use-most-recent': SfFlags.boolean({
|
|
30
|
+
char: 'r',
|
|
31
|
+
description: messages.getMessage('flags.use-most-recent.description'),
|
|
32
|
+
summary: messages.getMessage('flags.use-most-recent.summary'),
|
|
33
|
+
exactlyOne: ['use-most-recent', 'job-id'],
|
|
34
|
+
}),
|
|
35
|
+
};
|
|
36
|
+
flags;
|
|
37
|
+
targetStage;
|
|
38
|
+
deployOptions;
|
|
17
39
|
async init() {
|
|
18
40
|
await super.init();
|
|
19
41
|
const { flags } = await this.parse({
|
|
@@ -31,8 +53,8 @@ class QuickPromotionCommand extends abstractAsyncOperation_1.AsyncCommand {
|
|
|
31
53
|
async executeQuickPromotion() {
|
|
32
54
|
const deploymentResult = await this.getDeploymentResultForQuickDeploy();
|
|
33
55
|
const envId = deploymentResult.sf_devops__Change_Bundle_Installs__r.records[0].sf_devops__Environment__c;
|
|
34
|
-
this.targetStage = (await
|
|
35
|
-
this.setOutputService(new
|
|
56
|
+
this.targetStage = (await selectOnePipelineStageByEnvironmentId(this.targetOrg.getConnection(), envId));
|
|
57
|
+
this.setOutputService(new OutputServiceFactory().forQuickDeployment(this.flags, this.flags['devops-center-username'].getConnection(), this.targetStage.sf_devops__Branch__r.sf_devops__Name__c));
|
|
36
58
|
this.setAsyncOperationId(await this.requestPromotion(this.targetStage.sf_devops__Pipeline__r.sf_devops__Project__c, this.getSourceStageId(), deploymentResult.sf_devops__Deployment_Id__c));
|
|
37
59
|
return this.monitorOperation(this.flags.async, this.flags.wait);
|
|
38
60
|
}
|
|
@@ -51,7 +73,7 @@ class QuickPromotionCommand extends abstractAsyncOperation_1.AsyncCommand {
|
|
|
51
73
|
this.buildPromoteOptions(deploymentId);
|
|
52
74
|
const req = {
|
|
53
75
|
method: 'POST',
|
|
54
|
-
url: `${
|
|
76
|
+
url: `${REST_PROMOTE_BASE_URL}${projectId}/pipelineName/${sourceStageId}`,
|
|
55
77
|
body: JSON.stringify({
|
|
56
78
|
promoteOptions: this.deployOptions,
|
|
57
79
|
}),
|
|
@@ -65,13 +87,13 @@ class QuickPromotionCommand extends abstractAsyncOperation_1.AsyncCommand {
|
|
|
65
87
|
*/
|
|
66
88
|
async getDeploymentResultForQuickDeploy() {
|
|
67
89
|
const asyncJobId = this.flags['use-most-recent']
|
|
68
|
-
? (await
|
|
90
|
+
? (await DeployPipelineCache.create()).getLatestKeyOrThrow()
|
|
69
91
|
: this.flags['job-id'];
|
|
70
|
-
const deploymentResult = await
|
|
92
|
+
const deploymentResult = await selectOneDeploymentResultWithChangeBundleInstallsByAsyncJobId(this.targetOrg.getConnection(), asyncJobId);
|
|
71
93
|
if (!deploymentResult) {
|
|
72
94
|
throw messages.createError('error.JobIsNotValidationDeployment');
|
|
73
95
|
}
|
|
74
|
-
if (deploymentResult.sf_devops__Check_Deploy_Status__r.sf_devops__Status__c !==
|
|
96
|
+
if (deploymentResult.sf_devops__Check_Deploy_Status__r.sf_devops__Status__c !== AsyncOperationStatus.Completed) {
|
|
75
97
|
throw messages.createError('error.JobIsNotValidated');
|
|
76
98
|
}
|
|
77
99
|
return deploymentResult;
|
|
@@ -88,25 +110,4 @@ class QuickPromotionCommand extends abstractAsyncOperation_1.AsyncCommand {
|
|
|
88
110
|
};
|
|
89
111
|
}
|
|
90
112
|
}
|
|
91
|
-
QuickPromotionCommand.enableJsonFlag = true;
|
|
92
|
-
QuickPromotionCommand.baseFlags = {
|
|
93
|
-
async: promoteFlags_1.async,
|
|
94
|
-
concise: flags_1.concise,
|
|
95
|
-
verbose: flags_1.verbose,
|
|
96
|
-
wait: flags_1.wait,
|
|
97
|
-
'devops-center-username': (0, flags_1.requiredDoceOrgFlag)(),
|
|
98
|
-
'job-id': sf_plugins_core_1.Flags.salesforceId({
|
|
99
|
-
char: 'i',
|
|
100
|
-
description: messages.getMessage('flags.job-id.description'),
|
|
101
|
-
summary: messages.getMessage('flags.job-id.summary'),
|
|
102
|
-
exactlyOne: ['use-most-recent', 'job-id'],
|
|
103
|
-
}),
|
|
104
|
-
'use-most-recent': sf_plugins_core_1.Flags.boolean({
|
|
105
|
-
char: 'r',
|
|
106
|
-
description: messages.getMessage('flags.use-most-recent.description'),
|
|
107
|
-
summary: messages.getMessage('flags.use-most-recent.summary'),
|
|
108
|
-
exactlyOne: ['use-most-recent', 'job-id'],
|
|
109
|
-
}),
|
|
110
|
-
};
|
|
111
|
-
exports.default = QuickPromotionCommand;
|
|
112
113
|
//# sourceMappingURL=abstractQuick.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstractQuick.js","sourceRoot":"","sources":["../../../src/common/base/abstractQuick.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"abstractQuick.js","sourceRoot":"","sources":["../../../src/common/base/abstractQuick.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAE1E,OAAO,EAAsB,oBAAoB,EAAiC,MAAM,aAAa,CAAC;AACtG,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAA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AAoB,CAAC,SAAS,EAAE,CAAC;YAC/G,MAAM,QAAQ,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC;QACxD,CAAC;QACD,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACK,mBAAmB,CAAC,QAAgB;QAC1C,IAAI,CAAC,aAAa,GAAG;YACnB,YAAY,EAAE,QAAQ;YACtB,sEAAsE;YACtE,GAAG,IAAI,CAAC,iBAAiB,EAAE;SAC5B,CAAC;IACJ,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
2
|
import { Interfaces } from '@oclif/core';
|
|
3
|
-
import { PromotePipelineResult } from '../../common';
|
|
3
|
+
import type { PromotePipelineResult } from '../../common/index.js';
|
|
4
4
|
export type Flags<T extends typeof SfCommand> = Interfaces.InferredFlags<(typeof ReportOnPromoteCommand)['baseFlags'] & T['flags']>;
|
|
5
5
|
export declare abstract class ReportOnPromoteCommand<T extends typeof SfCommand> extends SfCommand<PromotePipelineResult> {
|
|
6
6
|
static readonly enableJsonFlag = true;
|
|
7
7
|
static baseFlags: {
|
|
8
8
|
'devops-center-username': Interfaces.OptionFlag<import("@salesforce/core").Org, Interfaces.CustomOptions>;
|
|
9
|
+
'flags-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
};
|
|
10
11
|
protected flags: Flags<T>;
|
|
11
12
|
protected abstract operationName: string;
|
|
@@ -1,21 +1,33 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReportOnPromoteCommand = void 0;
|
|
4
1
|
/*
|
|
5
|
-
* Copyright
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the
|
|
8
|
-
*
|
|
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.
|
|
9
15
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const messages =
|
|
18
|
-
class ReportOnPromoteCommand extends
|
|
16
|
+
import { Messages } from '@salesforce/core';
|
|
17
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
18
|
+
import { DeployPipelineCache } from '../../common/deployPipelineCache.js';
|
|
19
|
+
import { requiredDoceOrgFlag } from '../../common/flags/flags.js';
|
|
20
|
+
import { selectOneDeploymentResultByAsyncJobId } from './../selectors/deploymentResultsSelector.js';
|
|
21
|
+
import { OutputServiceFactory } from './../outputService/outputServiceFactory.js';
|
|
22
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
23
|
+
const messages = Messages.loadMessages('@salesforce/plugin-devops-center', 'commonErrors');
|
|
24
|
+
export class ReportOnPromoteCommand extends SfCommand {
|
|
25
|
+
static enableJsonFlag = true;
|
|
26
|
+
static baseFlags = {
|
|
27
|
+
...SfCommand.baseFlags,
|
|
28
|
+
'devops-center-username': requiredDoceOrgFlag(),
|
|
29
|
+
};
|
|
30
|
+
flags;
|
|
19
31
|
async init() {
|
|
20
32
|
await super.init();
|
|
21
33
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
@@ -32,13 +44,13 @@ class ReportOnPromoteCommand extends sf_plugins_core_1.SfCommand {
|
|
|
32
44
|
*/
|
|
33
45
|
async getOperationReport() {
|
|
34
46
|
const asyncJobId = this.flags['use-most-recent']
|
|
35
|
-
? (await
|
|
47
|
+
? (await DeployPipelineCache.create()).getLatestKeyOrThrow()
|
|
36
48
|
: this.flags['job-id'];
|
|
37
49
|
const org = this.flags['devops-center-username'];
|
|
38
50
|
// query the deployment result related to the promote operation.
|
|
39
|
-
const operationResult = await
|
|
51
|
+
const operationResult = await selectOneDeploymentResultByAsyncJobId(org.getConnection(), asyncJobId);
|
|
40
52
|
if (operationResult && !this.jsonEnabled()) {
|
|
41
|
-
const displayer = new
|
|
53
|
+
const displayer = new OutputServiceFactory().forPromotionReport(this.flags, operationResult, this.operationName);
|
|
42
54
|
displayer.printOpSummary();
|
|
43
55
|
}
|
|
44
56
|
else if (!operationResult) {
|
|
@@ -52,9 +64,4 @@ class ReportOnPromoteCommand extends sf_plugins_core_1.SfCommand {
|
|
|
52
64
|
};
|
|
53
65
|
}
|
|
54
66
|
}
|
|
55
|
-
exports.ReportOnPromoteCommand = ReportOnPromoteCommand;
|
|
56
|
-
ReportOnPromoteCommand.enableJsonFlag = true;
|
|
57
|
-
ReportOnPromoteCommand.baseFlags = {
|
|
58
|
-
'devops-center-username': (0, flags_1.requiredDoceOrgFlag)(),
|
|
59
|
-
};
|
|
60
67
|
//# sourceMappingURL=abstractReportOnPromote.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstractReportOnPromote.js","sourceRoot":"","sources":["../../../src/common/base/abstractReportOnPromote.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"abstractReportOnPromote.js","sourceRoot":"","sources":["../../../src/common/base/abstractReportOnPromote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;A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gEAAgE;QAChE,MAAM,eAAe,GAA4B,MAAM,qCAAqC,CAC1F,GAAG,CAAC,aAAa,EAAE,EACnB,UAAU,CACX,CAAC;QACF,IAAI,eAAe,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YAC3C,MAAM,SAAS,GAAkB,IAAI,oBAAoB,EAAE,CAAC,kBAAkB,CAC5E,IAAI,CAAC,KAAK,EACV,eAAe,EACf,IAAI,CAAC,aAAa,CACnB,CAAC;YACF,SAAS,CAAC,cAAc,EAAE,CAAC;QAC7B,CAAC;aAAM,IAAI,CAAC,eAAe,EAAE,CAAC;YAC5B,MAAM,QAAQ,CAAC,WAAW,CAAC,oBAAoB,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;QACjE,CAAC;QAED,OAAO;YACL,KAAK,EAAE,UAAU;YACjB,MAAM,EAAE,eAAe,CAAC,oBAAoB,CAAC,oBAAoB;YACjE,OAAO,EAAE,eAAe,CAAC,oBAAoB,CAAC,qBAAqB;YACnE,YAAY,EAAE,eAAe,CAAC,oBAAoB,CAAC,2BAA2B;SAC/E,CAAC;IACJ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
2
|
import { Interfaces } from '@oclif/core';
|
|
3
|
-
import { AsyncOperationResultJson, AsyncOperationStatus } from '../../common';
|
|
4
|
-
import { AsyncCommand } from './abstractAsyncOperation';
|
|
3
|
+
import { AsyncOperationResultJson, AsyncOperationStatus } from '../../common/index.js';
|
|
4
|
+
import { AsyncCommand } from './abstractAsyncOperation.js';
|
|
5
5
|
/**
|
|
6
6
|
* Helper to determine if an operation has finished and therefore is not resumable
|
|
7
7
|
*
|
|
@@ -23,6 +23,7 @@ export declare abstract class ResumeCommand<T extends typeof SfCommand> extends
|
|
|
23
23
|
concise: Interfaces.BooleanFlag<boolean>;
|
|
24
24
|
verbose: Interfaces.BooleanFlag<boolean>;
|
|
25
25
|
wait: Interfaces.OptionFlag<import("@salesforce/kit").Duration>;
|
|
26
|
+
'flags-dir': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
27
|
};
|
|
27
28
|
protected flags: Flags<T>;
|
|
28
29
|
protected abstract operationType: string;
|