@salesforce/plugin-devops-center 2.2.0 → 2.3.2
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/README.md +45 -36
- package/lib/commands/devops/pipeline/create.js +6 -0
- package/lib/commands/devops/pipeline/create.js.map +1 -1
- package/lib/commands/devops/pipeline/update.js +1 -1
- package/lib/commands/devops/pipeline/update.js.map +1 -1
- package/lib/commands/devops/promote.d.ts +8 -0
- package/lib/commands/devops/promote.js +31 -1
- package/lib/commands/devops/promote.js.map +1 -1
- package/lib/commands/devops/stage/branch/add.d.ts +15 -0
- package/lib/commands/devops/stage/branch/add.js +48 -1
- package/lib/commands/devops/stage/branch/add.js.map +1 -1
- package/lib/commands/devops/stage/environment/add.d.ts +15 -0
- package/lib/commands/devops/stage/environment/add.js +51 -1
- package/lib/commands/devops/stage/environment/add.js.map +1 -1
- package/lib/commands/devops/work-item/create.js +1 -0
- package/lib/commands/devops/work-item/create.js.map +1 -1
- package/lib/commands/devops/work-item/list.js +2 -1
- package/lib/commands/devops/work-item/list.js.map +1 -1
- package/lib/common/base/abstractAsyncOperation.js +4 -1
- package/lib/common/base/abstractAsyncOperation.js.map +1 -1
- package/lib/common/base/abstractPromote.d.ts +2 -2
- package/lib/common/base/abstractPromote.js +4 -3
- package/lib/common/base/abstractPromote.js.map +1 -1
- package/lib/common/base/abstractQuick.js +2 -0
- package/lib/common/base/abstractQuick.js.map +1 -1
- package/lib/common/base/abstractReportOnPromote.js +0 -2
- package/lib/common/base/abstractReportOnPromote.js.map +1 -1
- package/lib/common/base/abstractResume.js +1 -2
- package/lib/common/base/abstractResume.js.map +1 -1
- package/lib/common/flags/flags.js +2 -0
- package/lib/common/flags/flags.js.map +1 -1
- package/lib/common/outputService/aorOutputService.js +1 -1
- package/lib/common/outputService/aorOutputService.js.map +1 -1
- package/lib/common/outputService/deployCommandOutputService.js +1 -1
- package/lib/common/outputService/deployCommandOutputService.js.map +1 -1
- package/lib/common/outputService/deploySummaryBuilder.js +5 -1
- package/lib/common/outputService/deploySummaryBuilder.js.map +1 -1
- package/lib/common/outputService/deploymentResultOutputService.js.map +1 -1
- package/lib/common/outputService/promoteOutputService.js +1 -1
- package/lib/common/outputService/promoteOutputService.js.map +1 -1
- package/lib/common/outputService/reportOutputService.js +0 -1
- package/lib/common/outputService/reportOutputService.js.map +1 -1
- package/lib/common/outputService/resumeCommandOutputService.js +1 -1
- package/lib/common/outputService/resumeCommandOutputService.js.map +1 -1
- package/lib/common/outputService/resumeOutputService.js +1 -0
- package/lib/common/outputService/resumeOutputService.js.map +1 -1
- package/lib/common/utils.js +0 -2
- package/lib/common/utils.js.map +1 -1
- package/lib/streamer/processors/asyncOpStream.js +0 -2
- package/lib/streamer/processors/asyncOpStream.js.map +1 -1
- package/lib/streamer/sObjectStream.js +2 -3
- package/lib/streamer/sObjectStream.js.map +1 -1
- package/lib/utils/addStageBranch.d.ts +20 -0
- package/lib/utils/addStageBranch.js +33 -0
- package/lib/utils/addStageBranch.js.map +1 -1
- package/lib/utils/addStageEnvironment.d.ts +21 -0
- package/lib/utils/addStageEnvironment.js +34 -1
- package/lib/utils/addStageEnvironment.js.map +1 -1
- package/lib/utils/createPipeline.d.ts +5 -0
- package/lib/utils/createPipeline.js +37 -0
- package/lib/utils/createPipeline.js.map +1 -1
- package/lib/utils/createPullRequest.js +1 -3
- package/lib/utils/createPullRequest.js.map +1 -1
- package/lib/utils/createWorkItem.js +21 -18
- package/lib/utils/createWorkItem.js.map +1 -1
- package/lib/utils/promoteStage.d.ts +20 -0
- package/lib/utils/promoteStage.js +25 -0
- package/lib/utils/promoteStage.js.map +1 -1
- package/lib/utils/updateWorkItem.d.ts +22 -2
- package/lib/utils/updateWorkItem.js +98 -20
- package/lib/utils/updateWorkItem.js.map +1 -1
- package/lib/utils/workItems.js +8 -5
- package/lib/utils/workItems.js.map +1 -1
- package/messages/devops.promote.md +12 -0
- package/messages/devops.stage.branch.add.md +17 -1
- package/messages/devops.stage.environment.add.md +16 -0
- package/oclif.manifest.json +276 -258
- package/package.json +16 -9
- package/schemas/devops-pipeline-create.json +19 -0
- package/npm-shrinkwrap.json +0 -16645
- package/oclif.lock +0 -8997
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { validateSalesforceId } from './soqlUtils.js';
|
|
16
17
|
/**
|
|
17
18
|
* Promotes work items to a target pipeline stage via the Connect API.
|
|
18
19
|
* POST /services/data/v{version}/connect/devops/pipelines/{pipelineId}/promote
|
|
@@ -43,4 +44,28 @@ export async function promoteStage(params) {
|
|
|
43
44
|
promotedWorkitemIds: response.promotedWorkitemIds ?? [],
|
|
44
45
|
};
|
|
45
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* DevopsPipelnStgProm.Status values that indicate a promotion has been submitted
|
|
49
|
+
* but has not yet finished (i.e. is still in flight).
|
|
50
|
+
*/
|
|
51
|
+
export const IN_FLIGHT_PROMOTION_STATUSES = ['NEW', 'IN_PROGRESS', 'FINALIZING'];
|
|
52
|
+
/**
|
|
53
|
+
* Returns any in-flight promotions targeting the given pipeline stage.
|
|
54
|
+
*
|
|
55
|
+
* DevopsPipelnStgProm (Pipeline Stage Promotion) records the target stage of a promotion
|
|
56
|
+
* (PipelineStageId) and links to its DevopsRequestInfo, so the check is scoped to the
|
|
57
|
+
* specific target stage — and therefore its pipeline — rather than the whole org. Used to
|
|
58
|
+
* block a duplicate promotion to the same stage while one is already running, without
|
|
59
|
+
* affecting promotions in other stages or pipelines.
|
|
60
|
+
*/
|
|
61
|
+
export async function findInFlightPromotions(connection, targetStageId) {
|
|
62
|
+
validateSalesforceId(targetStageId, 'target stage');
|
|
63
|
+
const statusList = IN_FLIGHT_PROMOTION_STATUSES.join("', '");
|
|
64
|
+
const result = await connection.query(`SELECT Id, Status, RequestInfoId, RequestInfo.RequestToken FROM DevopsPipelnStgProm WHERE PipelineStageId = '${targetStageId}' AND Status IN ('${statusList}') LIMIT 10`);
|
|
65
|
+
return (result.records ?? []).map((r) => ({
|
|
66
|
+
id: r.Id,
|
|
67
|
+
requestToken: r.RequestInfo?.RequestToken ?? r.RequestInfoId ?? '',
|
|
68
|
+
status: r.Status,
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
46
71
|
//# sourceMappingURL=promoteStage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promoteStage.js","sourceRoot":"","sources":["../../src/utils/promoteStage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"promoteStage.js","sourceRoot":"","sources":["../../src/utils/promoteStage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AA0BtD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAA0B;IAC3D,MAAM,EACJ,UAAU,EACV,UAAU,EACV,WAAW,EACX,aAAa,EACb,UAAU,GAAG,KAAK,EAClB,SAAS,GAAG,SAAS,EACrB,QAAQ,GACT,GAAG,MAAM,CAAC;IAEX,MAAM,IAAI,GAAG,mBAAmB,UAAU,CAAC,aAAa,EAAE,6BAA6B,UAAU,UAAU,CAAC;IAE5G,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,OAAO,CAAuB;QAC9D,MAAM,EAAE,MAAM;QACd,GAAG,EAAE,IAAI;QACT,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,WAAW,EAAE,WAAW;YACxB,aAAa;YACb,mBAAmB,EAAE,KAAK;YAC1B,aAAa,EAAE,KAAK;YACpB,aAAa,EAAE;gBACb,SAAS;gBACT,YAAY,EAAE,UAAU;gBACxB,QAAQ,EAAE,QAAQ,IAAI,EAAE;aACzB;SACF,CAAC;QACF,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;KAChD,CAAC,CAAC;IAEH,OAAO;QACL,SAAS,EAAE,QAAQ,CAAC,SAAS,IAAI,EAAE;QACnC,MAAM,EAAE,QAAQ,CAAC,MAAM,IAAI,EAAE;QAC7B,OAAO,EAAE,QAAQ,CAAC,OAAO,IAAI,EAAE;QAC/B,mBAAmB,EAAE,QAAQ,CAAC,mBAAmB,IAAI,EAAE;KACxD,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAAK,EAAE,aAAa,EAAE,YAAY,CAAU,CAAC;AAe1F;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,UAAsB,EACtB,aAAqB;IAErB,oBAAoB,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IACpD,MAAM,UAAU,GAAG,4BAA4B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,KAAK,CACnC,gHAAgH,aAAa,qBAAqB,UAAU,aAAa,CAC1K,CAAC;IACF,OAAO,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACxC,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,YAAY,EAAE,CAAC,CAAC,WAAW,EAAE,YAAY,IAAI,CAAC,CAAC,aAAa,IAAI,EAAE;QAClE,MAAM,EAAE,CAAC,CAAC,MAAM;KACjB,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -23,10 +23,30 @@ export type UpdateWorkItemResult = {
|
|
|
23
23
|
export declare const ALLOWED_STATUSES: readonly ["In Progress", "Ready to Promote"];
|
|
24
24
|
export type AllowedStatus = (typeof ALLOWED_STATUSES)[number];
|
|
25
25
|
export declare function toApiStatus(status: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Allowed current statuses for each target status a user can set. A work item may only move
|
|
28
|
+
* to IN_PROGRESS while it is NEW, and to READY_TO_PROMOTE while it is IN_REVIEW. Target statuses
|
|
29
|
+
* absent from this map have no precondition.
|
|
30
|
+
*/
|
|
31
|
+
export declare const STATUS_TRANSITION_PRECONDITIONS: Record<string, readonly string[]>;
|
|
32
|
+
/**
|
|
33
|
+
* Verifies that the work item's current status permits the requested transition. Throws with a
|
|
34
|
+
* descriptive error when it does not. Only runs a query when the target status has a precondition,
|
|
35
|
+
* so subject/description-only updates are unaffected.
|
|
36
|
+
*/
|
|
37
|
+
export declare function assertStatusTransitionAllowed(connection: Connection, workItemId: string, targetApiStatus: string): Promise<void>;
|
|
26
38
|
export declare function resolveWorkItemByName(connection: Connection, workItemName: string): Promise<WorkItemContext>;
|
|
27
39
|
export declare function resolveProjectIdForWorkItem(connection: Connection, workItemId: string): Promise<string>;
|
|
28
40
|
/**
|
|
29
|
-
* Updates
|
|
30
|
-
*
|
|
41
|
+
* Updates a DevOps Center work item.
|
|
42
|
+
*
|
|
43
|
+
* Subject and description are plain WorkItem sObject fields — the DevOps Center connect work item
|
|
44
|
+
* endpoint does not accept them — so they are written via the sObject API. Status changes go
|
|
45
|
+
* through the connect endpoint (PATCH /connect/devops/projects/{projectId}/workitem/{workItemId}),
|
|
46
|
+
* which is the only field that endpoint accepts, so platform-side status handling runs.
|
|
47
|
+
*
|
|
48
|
+
* The two writes hit different APIs with no shared transaction. Subject/description are committed
|
|
49
|
+
* first; if the status call then fails, this returns `{ success: false }` with an error that names
|
|
50
|
+
* the fields that did persist, rather than throwing and leaving the committed changes unreported.
|
|
31
51
|
*/
|
|
32
52
|
export declare function updateWorkItem(params: UpdateWorkItemParams): Promise<UpdateWorkItemResult>;
|
|
@@ -26,6 +26,36 @@ export function toApiStatus(status) {
|
|
|
26
26
|
}
|
|
27
27
|
return apiStatus;
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Allowed current statuses for each target status a user can set. A work item may only move
|
|
31
|
+
* to IN_PROGRESS while it is NEW, and to READY_TO_PROMOTE while it is IN_REVIEW. Target statuses
|
|
32
|
+
* absent from this map have no precondition.
|
|
33
|
+
*/
|
|
34
|
+
export const STATUS_TRANSITION_PRECONDITIONS = {
|
|
35
|
+
IN_PROGRESS: ['NEW'],
|
|
36
|
+
READY_TO_PROMOTE: ['IN_REVIEW'],
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Verifies that the work item's current status permits the requested transition. Throws with a
|
|
40
|
+
* descriptive error when it does not. Only runs a query when the target status has a precondition,
|
|
41
|
+
* so subject/description-only updates are unaffected.
|
|
42
|
+
*/
|
|
43
|
+
export async function assertStatusTransitionAllowed(connection, workItemId, targetApiStatus) {
|
|
44
|
+
const allowedFrom = STATUS_TRANSITION_PRECONDITIONS[targetApiStatus];
|
|
45
|
+
if (!allowedFrom) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
validateSalesforceId(workItemId, 'work item');
|
|
49
|
+
const result = await connection.query(`SELECT Status FROM WorkItem WHERE Id = '${workItemId}' LIMIT 1`);
|
|
50
|
+
const current = result.records?.[0]?.Status;
|
|
51
|
+
if (!current) {
|
|
52
|
+
throw new Error(`Work item with ID '${workItemId}' not found.`);
|
|
53
|
+
}
|
|
54
|
+
if (!allowedFrom.includes(current)) {
|
|
55
|
+
const allowed = allowedFrom.join(', ');
|
|
56
|
+
throw new Error(`Cannot change status to ${targetApiStatus}: the work item is currently ${current}, but this transition is only allowed from ${allowed}.`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
29
59
|
export async function resolveWorkItemByName(connection, workItemName) {
|
|
30
60
|
const result = await connection.query(`SELECT Id, DevopsProjectId FROM WorkItem WHERE Name = '${escapeSOQL(workItemName)}' LIMIT 1`);
|
|
31
61
|
const record = (result.records ?? [])[0];
|
|
@@ -44,32 +74,80 @@ export async function resolveProjectIdForWorkItem(connection, workItemId) {
|
|
|
44
74
|
return record.DevopsProjectId;
|
|
45
75
|
}
|
|
46
76
|
/**
|
|
47
|
-
* Updates
|
|
48
|
-
*
|
|
77
|
+
* Updates a DevOps Center work item.
|
|
78
|
+
*
|
|
79
|
+
* Subject and description are plain WorkItem sObject fields — the DevOps Center connect work item
|
|
80
|
+
* endpoint does not accept them — so they are written via the sObject API. Status changes go
|
|
81
|
+
* through the connect endpoint (PATCH /connect/devops/projects/{projectId}/workitem/{workItemId}),
|
|
82
|
+
* which is the only field that endpoint accepts, so platform-side status handling runs.
|
|
83
|
+
*
|
|
84
|
+
* The two writes hit different APIs with no shared transaction. Subject/description are committed
|
|
85
|
+
* first; if the status call then fails, this returns `{ success: false }` with an error that names
|
|
86
|
+
* the fields that did persist, rather than throwing and leaving the committed changes unreported.
|
|
49
87
|
*/
|
|
50
88
|
export async function updateWorkItem(params) {
|
|
51
89
|
const { connection, workItemId, projectId, status, subject, description } = params;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
90
|
+
// Validate the status transition before writing any field. This guard is read-only, so running it
|
|
91
|
+
// first avoids persisting subject/description when the status change would be rejected — otherwise
|
|
92
|
+
// a combined --subject/--status call could silently keep the subject change after throwing.
|
|
93
|
+
let apiStatus;
|
|
94
|
+
if (status !== undefined) {
|
|
95
|
+
apiStatus = toApiStatus(status);
|
|
96
|
+
await assertStatusTransitionAllowed(connection, workItemId, apiStatus);
|
|
97
|
+
}
|
|
98
|
+
if (subject !== undefined || description !== undefined) {
|
|
99
|
+
const fields = { Id: workItemId };
|
|
100
|
+
if (subject !== undefined)
|
|
101
|
+
fields.Subject = subject;
|
|
102
|
+
if (description !== undefined)
|
|
103
|
+
fields.Description = description;
|
|
104
|
+
const saveResult = await connection.sobject('WorkItem').update(fields);
|
|
105
|
+
if (!saveResult.success) {
|
|
106
|
+
const errorMsg = saveResult.errors
|
|
107
|
+
.map((e) => (typeof e === 'string' ? e : e.message))
|
|
108
|
+
.filter(Boolean)
|
|
109
|
+
.join('; ');
|
|
110
|
+
return { success: false, workItemId, error: errorMsg || 'Failed to update work item fields.' };
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (apiStatus) {
|
|
114
|
+
const path = `/services/data/v${connection.getApiVersion()}/connect/devops/projects/${projectId}/workitem/${workItemId}`;
|
|
115
|
+
try {
|
|
116
|
+
await connection.request({
|
|
117
|
+
method: 'PATCH',
|
|
118
|
+
url: path,
|
|
119
|
+
body: JSON.stringify({ status: apiStatus }),
|
|
120
|
+
headers: { 'Content-Type': 'application/json' },
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
// The subject/description sObject write above has already committed. The two writes go to
|
|
125
|
+
// different APIs with no shared transaction, so a status failure here can't roll them back.
|
|
126
|
+
// Report a partial success instead of throwing, so the caller can tell the user exactly which
|
|
127
|
+
// fields persisted rather than surfacing a bare error that hides the committed changes.
|
|
128
|
+
const statusError = error instanceof Error ? error.message : String(error);
|
|
129
|
+
const persisted = [
|
|
130
|
+
subject !== undefined ? 'subject' : undefined,
|
|
131
|
+
description !== undefined ? 'description' : undefined,
|
|
132
|
+
].filter(Boolean);
|
|
133
|
+
const persistedNote = persisted.length > 0
|
|
134
|
+
? ` The ${persisted.join(' and ')} ${persisted.length > 1 ? 'changes were' : 'change was'} already saved.`
|
|
135
|
+
: '';
|
|
136
|
+
return {
|
|
137
|
+
success: false,
|
|
138
|
+
workItemId,
|
|
139
|
+
subject,
|
|
140
|
+
description,
|
|
141
|
+
error: `Failed to update work item status: ${statusError}.${persistedNote}`,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
}
|
|
67
145
|
return {
|
|
68
146
|
success: true,
|
|
69
147
|
workItemId,
|
|
70
|
-
status:
|
|
71
|
-
subject
|
|
72
|
-
description
|
|
148
|
+
status: apiStatus,
|
|
149
|
+
subject,
|
|
150
|
+
description,
|
|
73
151
|
};
|
|
74
152
|
}
|
|
75
153
|
//# sourceMappingURL=updateWorkItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateWorkItem.js","sourceRoot":"","sources":["../../src/utils/updateWorkItem.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AA0BlE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,aAAa,EAAE,kBAAkB,CAAU,CAAC;AAG7E,MAAM,mBAAmB,GAA2B;IAClD,aAAa,EAAE,aAAa;IAC5B,kBAAkB,EAAE,kBAAkB;CACvC,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,MAAM,SAAS,GAAG,mBAAmB,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;IAC5D,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,sBAAsB,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChG,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,UAAsB,EAAE,YAAoB;IACtF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,KAAK,CACnC,0DAA0D,UAAU,CAAC,YAAY,CAAC,WAAW,CAC9F,CAAC;IACF,MAAM,MAAM,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,wBAAwB,YAAY,cAAc,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,eAAe,EAAE,CAAC;AACtE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,2BAA2B,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AC,SAAS;aACtD,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAClB,MAAM,aAAa,GACjB,SAAS,CAAC,MAAM,GAAG,CAAC;gBAClB,CAAC,CAAC,QAAQ,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,iBAAiB;gBAC1G,CAAC,CAAC,EAAE,CAAC;YACT,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,UAAU;gBACV,OAAO;gBACP,WAAW;gBACX,KAAK,EAAE,sCAAsC,WAAW,IAAI,aAAa,EAAE;aAC5E,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI;QACb,UAAU;QACV,MAAM,EAAE,SAAS;QACjB,OAAO;QACP,WAAW;KACZ,CAAC;AACJ,CAAC"}
|
package/lib/utils/workItems.js
CHANGED
|
@@ -41,7 +41,7 @@ function extractOwnerFromVcsPayload(payload) {
|
|
|
41
41
|
if (typeof obj.owner === 'string' && obj.owner.trim()) {
|
|
42
42
|
return obj.owner.trim();
|
|
43
43
|
}
|
|
44
|
-
const list = (obj.owners
|
|
44
|
+
const list = (obj.owners ?? obj.items ?? obj.records);
|
|
45
45
|
if (Array.isArray(list)) {
|
|
46
46
|
for (const candidate of list) {
|
|
47
47
|
if (typeof candidate === 'string' && candidate.trim())
|
|
@@ -147,10 +147,13 @@ function mapRawItemToWorkItem(item, ctx, providerOwnerMap) {
|
|
|
147
147
|
PipelineId: ctx?.pipelineId,
|
|
148
148
|
};
|
|
149
149
|
if (ctx) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
150
|
+
// A work item's changes are promoted into the branch of its *next* pipeline stage. Only fall
|
|
151
|
+
// back to the first stage when the work item hasn't entered the pipeline yet (no current stage);
|
|
152
|
+
// a work item already on the final stage has no next stage, so it has no target branch (e.g. a
|
|
153
|
+
// closed work item that reached the last stage), and the branch is left blank.
|
|
154
|
+
const targetStageId = mapped.PipelineStageId
|
|
155
|
+
? resolveTargetStageId(mapped.PipelineStageId, ctx.stages)
|
|
156
|
+
: ctx.firstStageId;
|
|
154
157
|
const targetStage = findStageById(ctx.stages, targetStageId);
|
|
155
158
|
mapped.TargetBranch = getBranchNameFromStage(targetStage);
|
|
156
159
|
mapped.TargetStageId = targetStageId;
|
|
@@ -1 +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;AAE5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,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,IA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QAC7F,iGAAiG;QACjG,+FAA+F;QAC/F,+EAA+E;QAC/E,MAAM,aAAa,GAAG,MAAM,CAAC,eAAe;YAC1C,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC;YAC1D,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC;QACrB,MAAM,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAC7D,MAAM,CAAC,YAAY,GAAG,sBAAsB,CAAC,WAAW,CAAC,CAAC;QAC1D,MAAM,CAAC,aAAa,GAAG,aAAa,CAAC;IACvC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,UAAsB,EAAE,SAAiB;IAC5E,oBAAoB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC3C,MAAM,KAAK,GAAG;;;;;;;;;;;;+BAYe,SAAS;GACrC,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,KAAK,CAAsB,KAAK,CAAC,CAAC;IAClE,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;IACrC,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAuC,CAAC;IAC1E,MAAM,GAAG,GAAG,MAAM,mBAAmB,CAAC,UAAU,EAAE,kBAAkB,EAAE,SAAS,CAAC,CAAC;IACjF,MAAM,gBAAgB,GAAG,MAAM,wBAAwB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAE7E,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAY,EAAE,CAAC,oBAAoB,CAAC,IAAI,EAAE,GAAG,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAC5F,CAAC"}
|
|
@@ -52,6 +52,18 @@ ID of the source pipeline stage whose approved work items will be promoted. Mutu
|
|
|
52
52
|
|
|
53
53
|
Skip pre-promote validation. By default, promotion is validated before proceeding to prevent promoting work items without an associated PR. Use this flag to bypass validation.
|
|
54
54
|
|
|
55
|
+
# flags.force.summary
|
|
56
|
+
|
|
57
|
+
Submit the promotion even if another promotion to the same target stage is already in progress. By default, the command blocks to avoid creating duplicate promotions.
|
|
58
|
+
|
|
59
|
+
# error.PromotionInFlight
|
|
60
|
+
|
|
61
|
+
A promotion to this stage is already in progress (request token%s: %s). Submitting now can create a duplicate promotion. Wait for it to finish (check with "%s devops request status --request-token <token>"), or pass --force to promote anyway.
|
|
62
|
+
|
|
63
|
+
# warn.InFlightCheckSkipped
|
|
64
|
+
|
|
65
|
+
Couldn't check for in-flight promotions to this stage, so a duplicate promotion may not be blocked: %s
|
|
66
|
+
|
|
55
67
|
# error.NoModeFlag
|
|
56
68
|
|
|
57
69
|
Provide either --work-item-id to promote specific work items or --stage-id to promote all approved work items from a stage.
|
|
@@ -5,7 +5,7 @@ Add a source code repository branch to a pipeline stage.
|
|
|
5
5
|
# description
|
|
6
6
|
|
|
7
7
|
By default, the branch must exist in the repository. Use --create-vcs-branch to create a branch if it doesn't exist.
|
|
8
|
-
Each pipeline stage supports only one branch.
|
|
8
|
+
Each pipeline stage supports only one branch. If the stage already has a branch, the command blocks so the existing branch isn't orphaned; pass --force to replace it.
|
|
9
9
|
|
|
10
10
|
# flags.pipeline-id.summary
|
|
11
11
|
|
|
@@ -23,6 +23,10 @@ Name of the repository branch to assign to the stage.
|
|
|
23
23
|
|
|
24
24
|
Create the branch in the remote repository if it doesn't already exist.
|
|
25
25
|
|
|
26
|
+
# flags.force.summary
|
|
27
|
+
|
|
28
|
+
Replace the stage's existing branch. By default, the command blocks if the stage already has a branch to avoid orphaning it. With this flag, the new branch is associated and the previous branch record is removed if no other stage references it.
|
|
29
|
+
|
|
26
30
|
# examples
|
|
27
31
|
|
|
28
32
|
- Add an existing branch to a stage:
|
|
@@ -44,3 +48,15 @@ You must set up a branch on stage "%s" before configuring stage "%s". Branches m
|
|
|
44
48
|
# error.BranchAttachFailed
|
|
45
49
|
|
|
46
50
|
Failed to associate branch with stage: %s
|
|
51
|
+
|
|
52
|
+
# error.BranchAlreadyExists
|
|
53
|
+
|
|
54
|
+
Stage "%s" already has a branch ("%s"). Adding another would leave the existing one orphaned. Remove it first with "%s devops stage branch delete", or pass --force to replace it.
|
|
55
|
+
|
|
56
|
+
# info.ReplacedBranchRemoved
|
|
57
|
+
|
|
58
|
+
Removed the stage's previous branch "%s".
|
|
59
|
+
|
|
60
|
+
# warn.ReplacedBranchCleanupFailed
|
|
61
|
+
|
|
62
|
+
Associated the new branch, but couldn't remove the previous branch record (%s). Remove it manually if it's no longer needed.
|
|
@@ -26,6 +26,10 @@ Type of the Salesforce org. Valid values: Production, Sandbox.
|
|
|
26
26
|
|
|
27
27
|
Don't auto-open the browser for OAuth authentication. The redirect URL is printed for manual use.
|
|
28
28
|
|
|
29
|
+
# flags.force.summary
|
|
30
|
+
|
|
31
|
+
Replace the stage's existing environment. By default, the command blocks if the stage already has an environment to avoid orphaning it. With this flag, the new environment is added first and the previous one is removed only after the new environment is associated successfully.
|
|
32
|
+
|
|
29
33
|
# examples
|
|
30
34
|
|
|
31
35
|
- Add a production environment to a stage using its ID:
|
|
@@ -60,6 +64,18 @@ Pipeline stage "%s" doesn't exist in pipeline "%s". Check the stage ID and try a
|
|
|
60
64
|
|
|
61
65
|
Failed to create environment for stage: %s
|
|
62
66
|
|
|
67
|
+
# error.EnvironmentAlreadyExists
|
|
68
|
+
|
|
69
|
+
Stage "%s" already has an environment ("%s", %s). Adding another would leave the existing one orphaned. Remove it first with "%s devops stage environment delete", or pass --force to replace it.
|
|
70
|
+
|
|
71
|
+
# info.ReplacedEnvironmentRemoved
|
|
72
|
+
|
|
73
|
+
Removed the stage's previous environment "%s".
|
|
74
|
+
|
|
75
|
+
# warn.ReplacedEnvironmentCleanupFailed
|
|
76
|
+
|
|
77
|
+
Associated the new environment, but couldn't remove the previous environment record (%s). Remove it manually if it's no longer needed.
|
|
78
|
+
|
|
63
79
|
# error.AuthTimeout
|
|
64
80
|
|
|
65
81
|
Authentication timed out. The environment was created but not yet authenticated. Re-run the command or authenticate manually via the org's DevOps Center setup.
|