sfdx-hardis 6.6.0 → 6.6.1-beta202510111519.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/CHANGELOG.md +8 -0
- package/lib/commands/hardis/doc/project2markdown.js +1 -1
- package/lib/commands/hardis/doc/project2markdown.js.map +1 -1
- package/lib/commands/hardis/project/metadata/activate-decomposed.d.ts +38 -0
- package/lib/commands/hardis/project/metadata/activate-decomposed.js +453 -0
- package/lib/commands/hardis/project/metadata/activate-decomposed.js.map +1 -0
- package/lib/common/docBuilder/docBuilderObject.js +1 -1
- package/lib/common/docBuilder/docBuilderObject.js.map +1 -1
- package/lib/common/gitProvider/azureDevops.js +41 -1
- package/lib/common/gitProvider/azureDevops.js.map +1 -1
- package/lib/common/gitProvider/bitbucket.js +18 -11
- package/lib/common/gitProvider/bitbucket.js.map +1 -1
- package/lib/common/gitProvider/gitProviderRoot.js +7 -1
- package/lib/common/gitProvider/gitProviderRoot.js.map +1 -1
- package/lib/common/notifProvider/apiProvider.d.ts +6 -0
- package/lib/common/notifProvider/apiProvider.js +138 -13
- package/lib/common/notifProvider/apiProvider.js.map +1 -1
- package/oclif.lock +43 -23
- package/oclif.manifest.json +260 -169
- package/package.json +5 -5
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
/* jscpd:ignore-start */
|
|
2
|
+
import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
|
|
3
|
+
import { Messages } from '@salesforce/core';
|
|
4
|
+
import c from 'chalk';
|
|
5
|
+
import { execCommand, uxLog } from '../../../../common/utils/index.js';
|
|
6
|
+
import { getConfig } from '../../../../config/index.js';
|
|
7
|
+
import fs from 'fs-extra';
|
|
8
|
+
import path from 'path';
|
|
9
|
+
import { prompts } from '../../../../common/utils/prompts.js';
|
|
10
|
+
import { isSfdxProject } from '../../../../common/utils/projectUtils.js';
|
|
11
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
12
|
+
const messages = Messages.loadMessages('sfdx-hardis', 'org');
|
|
13
|
+
const METADATA_TYPES = [
|
|
14
|
+
{
|
|
15
|
+
name: 'CustomLabels',
|
|
16
|
+
behavior: 'decomposeCustomLabelsBeta2',
|
|
17
|
+
directory: 'labels',
|
|
18
|
+
filePattern: 'CustomLabels.labels-meta.xml'
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'PermissionSet',
|
|
22
|
+
behavior: 'decomposePermissionSetBeta2',
|
|
23
|
+
directory: 'permissionsets'
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'ExternalServiceRegistration',
|
|
27
|
+
behavior: 'decomposeExternalServiceRegistrationBeta',
|
|
28
|
+
directory: 'externalServiceRegistrations'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'SharingRules',
|
|
32
|
+
behavior: 'decomposeSharingRulesBeta',
|
|
33
|
+
directory: 'sharingRules'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'Workflow',
|
|
37
|
+
behavior: 'decomposeWorkflowBeta',
|
|
38
|
+
directory: 'workflows'
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
export default class ActivateDecomposedMetadata extends SfCommand {
|
|
42
|
+
static title = 'Activate Decomposed Metadata (Beta)';
|
|
43
|
+
static description = `
|
|
44
|
+
## Command Behavior
|
|
45
|
+
|
|
46
|
+
**Activate decomposed metadata types in Salesforce DX projects.**
|
|
47
|
+
|
|
48
|
+
This command helps manage decomposed metadata types that can be split into multiple files in source format. It automatically decomposes all supported metadata types that exist in your project.
|
|
49
|
+
|
|
50
|
+
Supported metadata types (Beta):
|
|
51
|
+
- CustomLabels
|
|
52
|
+
- PermissionSet
|
|
53
|
+
- ExternalServiceRegistration
|
|
54
|
+
- SharingRules
|
|
55
|
+
- Workflow
|
|
56
|
+
|
|
57
|
+
See [Salesforce documentation on decomposed metadata](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_decomposed_md_types.htm)
|
|
58
|
+
|
|
59
|
+
Key features:
|
|
60
|
+
- Automatically detects and decomposes all applicable metadata types
|
|
61
|
+
- Decomposes only metadata types that exist in your project
|
|
62
|
+
- Interactive confirmation for decomposition operations
|
|
63
|
+
- Handles all confirmation prompts automatically
|
|
64
|
+
|
|
65
|
+
<details markdown="1">
|
|
66
|
+
<summary>Technical explanations</summary>
|
|
67
|
+
|
|
68
|
+
This command utilizes Salesforce CLI's decomposed metadata feature to split complex metadata types into smaller, more manageable components:
|
|
69
|
+
|
|
70
|
+
- **CustomLabels**: Each custom label becomes a separate file, making it easier to track changes and manage translations.
|
|
71
|
+
- **PermissionSets**: Permission sets are decomposed into multiple files based on the permissions they contain (field permissions, object permissions, etc.).
|
|
72
|
+
- **ExternalServiceRegistration**: Decomposes external service registrations.
|
|
73
|
+
- **SharingRules**: Decomposes sharing rules into individual components.
|
|
74
|
+
- **Workflow**: Decomposes workflow rules into individual components.
|
|
75
|
+
|
|
76
|
+
The command wraps the underlying Salesforce CLI functionality and provides a more user-friendly interface with additional validation and error handling.
|
|
77
|
+
|
|
78
|
+
Note: All decomposed metadata features are currently in Beta in Salesforce CLI.
|
|
79
|
+
</details>
|
|
80
|
+
`;
|
|
81
|
+
static examples = [
|
|
82
|
+
'$ sf hardis:project:metadata:activate-decomposed',
|
|
83
|
+
'$ sf hardis:project:metadata:activate-decomposed --debug'
|
|
84
|
+
];
|
|
85
|
+
static flags = {
|
|
86
|
+
debug: Flags.boolean({
|
|
87
|
+
char: 'd',
|
|
88
|
+
description: 'Run command in debug mode',
|
|
89
|
+
default: false
|
|
90
|
+
}),
|
|
91
|
+
websocket: Flags.string({
|
|
92
|
+
description: messages.getMessage('websocket'),
|
|
93
|
+
}),
|
|
94
|
+
skipauth: Flags.boolean({
|
|
95
|
+
description: 'Skip authentication check when a default username is required',
|
|
96
|
+
}),
|
|
97
|
+
};
|
|
98
|
+
configInfo;
|
|
99
|
+
sourceBehaviorOptionsCache;
|
|
100
|
+
async run() {
|
|
101
|
+
const { flags } = await this.parse(ActivateDecomposedMetadata);
|
|
102
|
+
// Initialize configuration
|
|
103
|
+
this.configInfo = await getConfig('user');
|
|
104
|
+
const results = {
|
|
105
|
+
success: true,
|
|
106
|
+
cancelled: false,
|
|
107
|
+
decomposedTypes: [],
|
|
108
|
+
alreadyDecomposedTypes: [],
|
|
109
|
+
errors: []
|
|
110
|
+
};
|
|
111
|
+
try {
|
|
112
|
+
// Start main action section
|
|
113
|
+
uxLog("action", this, c.cyan(`Checking for metadata types eligible for decomposition (Beta feature)`));
|
|
114
|
+
// Preliminary check: identify already decomposed and remaining metadata types
|
|
115
|
+
const decompositionStatus = this.checkDecompositionStatus();
|
|
116
|
+
// Build names once to avoid duplicate mapping (Optimization #1)
|
|
117
|
+
const alreadyDecomposedNames = decompositionStatus.alreadyDecomposed.length > 0
|
|
118
|
+
? decompositionStatus.alreadyDecomposed.map(t => t.name).join(', ')
|
|
119
|
+
: '';
|
|
120
|
+
// Detect which metadata types exist in the project and need decomposition
|
|
121
|
+
const applicableTypes = await this.detectApplicableMetadataTypes();
|
|
122
|
+
// Display already decomposed types as a separate section (always visible)
|
|
123
|
+
if (alreadyDecomposedNames) {
|
|
124
|
+
uxLog("action", this, c.grey(`Already decomposed: ${alreadyDecomposedNames}`));
|
|
125
|
+
results.alreadyDecomposedTypes = decompositionStatus.alreadyDecomposed.map(t => t.name);
|
|
126
|
+
}
|
|
127
|
+
// Display eligible types as a log entry under the last action
|
|
128
|
+
if (applicableTypes.length > 0) {
|
|
129
|
+
const remainingNames = applicableTypes.map(t => t.name).join(', ');
|
|
130
|
+
uxLog("log", this, c.cyan(`Eligible for decomposition: ${remainingNames}`));
|
|
131
|
+
}
|
|
132
|
+
if (applicableTypes.length === 0) {
|
|
133
|
+
if (alreadyDecomposedNames) {
|
|
134
|
+
uxLog("warning", this, c.yellow(`All supported metadata types are already decomposed in this project`));
|
|
135
|
+
uxLog("log", this, c.grey(`Already decomposed: ${alreadyDecomposedNames}`));
|
|
136
|
+
return {
|
|
137
|
+
success: true,
|
|
138
|
+
message: 'All metadata types already decomposed',
|
|
139
|
+
alreadyDecomposed: true,
|
|
140
|
+
alreadyDecomposedTypes: results.alreadyDecomposedTypes
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
uxLog("warning", this, c.yellow(`No supported metadata types found in this project`));
|
|
145
|
+
return { success: false, message: 'No supported metadata types found' };
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// Let user select which metadata types to decompose
|
|
149
|
+
const selectionResult = await prompts({
|
|
150
|
+
type: 'multiselect',
|
|
151
|
+
name: 'selectedTypes',
|
|
152
|
+
message: c.cyan('Select metadata types to decompose:'),
|
|
153
|
+
description: 'Use space to select/deselect, Enter to confirm',
|
|
154
|
+
choices: applicableTypes.map(type => ({
|
|
155
|
+
title: type.name,
|
|
156
|
+
value: type.name,
|
|
157
|
+
selected: true // All selected by default
|
|
158
|
+
}))
|
|
159
|
+
});
|
|
160
|
+
// Check if user cancelled the selection
|
|
161
|
+
if (!selectionResult.selectedTypes || selectionResult.selectedTypes.length === 0) {
|
|
162
|
+
uxLog("warning", this, c.yellow('Operation cancelled by user'));
|
|
163
|
+
results.cancelled = true;
|
|
164
|
+
return results;
|
|
165
|
+
}
|
|
166
|
+
// Filter to only selected types
|
|
167
|
+
const selectedMetadataTypes = applicableTypes.filter(type => selectionResult.selectedTypes.includes(type.name));
|
|
168
|
+
uxLog("log", this, c.cyan(`Selected for decomposition: ${selectedMetadataTypes.map(t => t.name).join(', ')}`));
|
|
169
|
+
// Process each selected metadata type
|
|
170
|
+
for (const metadataType of selectedMetadataTypes) {
|
|
171
|
+
const operationResult = await this.decomposeMetadataType(metadataType, flags);
|
|
172
|
+
if (operationResult.success) {
|
|
173
|
+
results.decomposedTypes.push(metadataType.name);
|
|
174
|
+
}
|
|
175
|
+
else if (operationResult.error) {
|
|
176
|
+
results.errors.push(`${metadataType.name}: ${operationResult.error}`);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
// Send success status to UI if any types were decomposed
|
|
180
|
+
if (results.decomposedTypes.length > 0) {
|
|
181
|
+
uxLog("action", this, c.green(`Successfully decomposed: ${results.decomposedTypes.join(', ')}`));
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
uxLog("action", this, c.yellow(`No metadata types were decomposed`));
|
|
185
|
+
}
|
|
186
|
+
// Log errors if any
|
|
187
|
+
if (results.errors.length > 0) {
|
|
188
|
+
uxLog("action", this, c.red(`Errors summary:`));
|
|
189
|
+
results.errors.forEach((error, index) => {
|
|
190
|
+
uxLog("error", this, c.red(`\nError ${index + 1}:\n${error}`));
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
catch (error) {
|
|
195
|
+
results.success = false;
|
|
196
|
+
// Build comprehensive error information
|
|
197
|
+
const errorMessage = error?.message || 'Unknown error';
|
|
198
|
+
const errorStack = error?.stack || '';
|
|
199
|
+
const errorStdout = error?.stdout || '';
|
|
200
|
+
const errorStderr = error?.stderr || '';
|
|
201
|
+
// Build detailed error report
|
|
202
|
+
const errorDetails = [];
|
|
203
|
+
errorDetails.push(`Error Type: Unexpected error during metadata decomposition`);
|
|
204
|
+
if (errorMessage && errorMessage !== 'Unknown error') {
|
|
205
|
+
errorDetails.push(`Error Message: ${errorMessage}`);
|
|
206
|
+
}
|
|
207
|
+
if (errorStdout && errorStdout.trim()) {
|
|
208
|
+
errorDetails.push(`Standard Output:\n${errorStdout.trim()}`);
|
|
209
|
+
}
|
|
210
|
+
if (errorStderr && errorStderr.trim()) {
|
|
211
|
+
errorDetails.push(`Standard Error:\n${errorStderr.trim()}`);
|
|
212
|
+
}
|
|
213
|
+
if (errorStack) {
|
|
214
|
+
errorDetails.push(`Stack Trace:\n${errorStack}`);
|
|
215
|
+
}
|
|
216
|
+
const detailedErrorReport = errorDetails.join('\n');
|
|
217
|
+
results.errors.push(detailedErrorReport);
|
|
218
|
+
// Send error status to UI with detailed message
|
|
219
|
+
let uiErrorMessage = 'Error during metadata decomposition';
|
|
220
|
+
if (errorStderr && errorStderr.trim()) {
|
|
221
|
+
const firstErrorLine = errorStderr.trim().split('\n')[0];
|
|
222
|
+
uiErrorMessage += `: ${firstErrorLine}`;
|
|
223
|
+
}
|
|
224
|
+
else if (errorMessage && errorMessage !== 'Unknown error') {
|
|
225
|
+
uiErrorMessage += `: ${errorMessage}`;
|
|
226
|
+
}
|
|
227
|
+
// Log detailed error report
|
|
228
|
+
uxLog("error", this, c.red(uiErrorMessage));
|
|
229
|
+
}
|
|
230
|
+
return results;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Read the sfdx-project.json file and get existing sourceBehaviorOptions (with caching)
|
|
234
|
+
*/
|
|
235
|
+
getExistingSourceBehaviorOptions() {
|
|
236
|
+
// Return cached value if available
|
|
237
|
+
if (this.sourceBehaviorOptionsCache !== undefined) {
|
|
238
|
+
return this.sourceBehaviorOptionsCache ?? [];
|
|
239
|
+
}
|
|
240
|
+
if (!isSfdxProject()) {
|
|
241
|
+
this.sourceBehaviorOptionsCache = null;
|
|
242
|
+
return [];
|
|
243
|
+
}
|
|
244
|
+
try {
|
|
245
|
+
const projectJsonPath = path.join(process.cwd(), 'sfdx-project.json');
|
|
246
|
+
if (!fs.existsSync(projectJsonPath)) {
|
|
247
|
+
this.sourceBehaviorOptionsCache = null;
|
|
248
|
+
return [];
|
|
249
|
+
}
|
|
250
|
+
const projectConfig = JSON.parse(fs.readFileSync(projectJsonPath, 'utf8'));
|
|
251
|
+
const options = Array.isArray(projectConfig.sourceBehaviorOptions) ?
|
|
252
|
+
projectConfig.sourceBehaviorOptions : [];
|
|
253
|
+
this.sourceBehaviorOptionsCache = options;
|
|
254
|
+
return options;
|
|
255
|
+
}
|
|
256
|
+
catch (error) {
|
|
257
|
+
// If there's an error reading the file, assume no options exist
|
|
258
|
+
this.sourceBehaviorOptionsCache = null;
|
|
259
|
+
uxLog("warning", this, c.yellow(`Warning: Unable to read sfdx-project.json for sourceBehaviorOptions (error: ${error instanceof Error ? error.message : 'unknown error'})`));
|
|
260
|
+
return [];
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Get package directories from project
|
|
265
|
+
* Supports custom package directory structures (Optimization #3)
|
|
266
|
+
* Returns base package paths (e.g., 'force-app'), not including 'main/default'
|
|
267
|
+
*/
|
|
268
|
+
getPackageDirectories() {
|
|
269
|
+
try {
|
|
270
|
+
// Use the project's getPackageDirectories method if available
|
|
271
|
+
const packageDirs = this.project?.getPackageDirectories();
|
|
272
|
+
if (packageDirs && packageDirs.length > 0) {
|
|
273
|
+
// Map to get just the path property from each package directory object
|
|
274
|
+
return packageDirs.map((pd) => pd.path);
|
|
275
|
+
}
|
|
276
|
+
// Fallback to default if no project or no package directories
|
|
277
|
+
return ['force-app'];
|
|
278
|
+
}
|
|
279
|
+
catch (error) {
|
|
280
|
+
uxLog("warning", this, c.yellow(`Warning: Unable to read package directories from sfdx-project.json (error: ${error instanceof Error ? error.message : 'unknown error'})`));
|
|
281
|
+
// Fallback to default on error
|
|
282
|
+
return ['force-app'];
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Check decomposition status: identify which metadata types are already decomposed and which remain
|
|
287
|
+
*/
|
|
288
|
+
checkDecompositionStatus() {
|
|
289
|
+
const existingOptions = this.getExistingSourceBehaviorOptions();
|
|
290
|
+
const alreadyDecomposed = [];
|
|
291
|
+
const remaining = [];
|
|
292
|
+
for (const metadataType of METADATA_TYPES) {
|
|
293
|
+
if (existingOptions.includes(metadataType.behavior)) {
|
|
294
|
+
alreadyDecomposed.push(metadataType);
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
remaining.push(metadataType);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return { alreadyDecomposed, remaining };
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Detect which metadata types exist in the project
|
|
304
|
+
* Uses parallel file checks for better performance (Optimization #2)
|
|
305
|
+
*/
|
|
306
|
+
async detectApplicableMetadataTypes() {
|
|
307
|
+
const existingOptions = this.getExistingSourceBehaviorOptions();
|
|
308
|
+
const packageDirs = this.getPackageDirectories();
|
|
309
|
+
// Filter out already decomposed types first
|
|
310
|
+
const typesToCheck = METADATA_TYPES.filter(metadataType => !existingOptions.includes(metadataType.behavior));
|
|
311
|
+
// Check all metadata types in all package directories in parallel
|
|
312
|
+
const checkPromises = typesToCheck.map(async (metadataType) => {
|
|
313
|
+
// Check all package directories for this metadata type
|
|
314
|
+
for (const pkgDir of packageDirs) {
|
|
315
|
+
// Construct full path: packageDir/main/default/metadataDirectory
|
|
316
|
+
const directory = path.join(pkgDir, 'main', 'default', metadataType.directory);
|
|
317
|
+
const dirExists = await fs.pathExists(directory);
|
|
318
|
+
if (!dirExists) {
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
if (metadataType.filePattern) {
|
|
322
|
+
const filePath = path.join(directory, metadataType.filePattern);
|
|
323
|
+
const fileExists = await fs.pathExists(filePath);
|
|
324
|
+
if (fileExists) {
|
|
325
|
+
return metadataType;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
const files = await fs.readdir(directory);
|
|
330
|
+
if (files.length > 0) {
|
|
331
|
+
return metadataType;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return null;
|
|
336
|
+
});
|
|
337
|
+
const results = await Promise.all(checkPromises);
|
|
338
|
+
// Filter out nulls and return applicable types
|
|
339
|
+
const applicableTypes = results.filter((type) => type !== null);
|
|
340
|
+
return applicableTypes;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Execute a Salesforce CLI command with automatic confirmation (cross-platform)
|
|
344
|
+
* Uses the framework's execCommand utility with auto-confirmation via echo
|
|
345
|
+
*/
|
|
346
|
+
async execSfCommandWithConfirmation(command, flags) {
|
|
347
|
+
// Use echo y | command for cross-platform auto-confirmation
|
|
348
|
+
const commandWithAutoConfirm = `echo y | ${command}`;
|
|
349
|
+
try {
|
|
350
|
+
// Use the framework's execCommand utility which handles cross-platform execution
|
|
351
|
+
const result = await execCommand(commandWithAutoConfirm, this, {
|
|
352
|
+
fail: true,
|
|
353
|
+
output: flags.output || flags.debug,
|
|
354
|
+
debug: flags.debug
|
|
355
|
+
});
|
|
356
|
+
return result;
|
|
357
|
+
}
|
|
358
|
+
catch (error) {
|
|
359
|
+
// Enhance error with more context
|
|
360
|
+
const enhancedError = new Error(error.message || 'Unknown error');
|
|
361
|
+
enhancedError.stdout = error.stdout || '';
|
|
362
|
+
enhancedError.stderr = error.stderr || '';
|
|
363
|
+
enhancedError.exitCode = error.exitCode || error.code || 1;
|
|
364
|
+
enhancedError.command = command;
|
|
365
|
+
throw enhancedError;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Decompose a specific metadata type
|
|
370
|
+
*/
|
|
371
|
+
async decomposeMetadataType(metadataType, flags) {
|
|
372
|
+
uxLog("action", this, c.cyan(`Attempting to decompose metadata ${metadataType.name}...`));
|
|
373
|
+
// Run sf project convert source-behavior command
|
|
374
|
+
const command = `sf project convert source-behavior --behavior ${metadataType.behavior}`;
|
|
375
|
+
try {
|
|
376
|
+
// Use cross-platform method to handle confirmation
|
|
377
|
+
await this.execSfCommandWithConfirmation(command, flags);
|
|
378
|
+
uxLog("success", this, c.green(`Successfully decomposed ${metadataType.name}`));
|
|
379
|
+
return { success: true };
|
|
380
|
+
}
|
|
381
|
+
catch (error) {
|
|
382
|
+
// Extract all error information
|
|
383
|
+
const errorMessage = error?.message || 'Unknown error';
|
|
384
|
+
const errorStdout = error?.stdout || '';
|
|
385
|
+
const errorStderr = error?.stderr || '';
|
|
386
|
+
const exitCode = error?.exitCode || '';
|
|
387
|
+
const commandExecuted = error?.command || command;
|
|
388
|
+
// Check if error is due to behavior already existing
|
|
389
|
+
if (errorMessage.includes('sourceBehaviorOptionAlreadyExists') ||
|
|
390
|
+
errorStdout.includes('sourceBehaviorOptionAlreadyExists') ||
|
|
391
|
+
errorStderr.includes('sourceBehaviorOptionAlreadyExists')) {
|
|
392
|
+
uxLog("log", this, c.grey(`${metadataType.name} is already decomposed (${metadataType.behavior} found in sfdx-project.json)`));
|
|
393
|
+
return { success: true, error: 'Already decomposed' };
|
|
394
|
+
}
|
|
395
|
+
if (errorMessage.includes('TrackingNotSupportedError')) {
|
|
396
|
+
const retryRes = await prompts({
|
|
397
|
+
type: 'confirm',
|
|
398
|
+
name: 'retry',
|
|
399
|
+
message: c.yellow(`You can not decompose metadata when default org has source tracking enabled. Do you want to unselect the default org and retry?`),
|
|
400
|
+
description: 'This will unset the default org for this project and try the command again',
|
|
401
|
+
initial: true
|
|
402
|
+
});
|
|
403
|
+
if (retryRes.retry) {
|
|
404
|
+
// Unset default org
|
|
405
|
+
await execCommand('sf config unset target-org', this, { fail: true, debug: flags.debug });
|
|
406
|
+
uxLog("log", this, c.green(`Default org unset successfully. Retrying decomposition of ${metadataType.name}...`));
|
|
407
|
+
// Retry decomposition
|
|
408
|
+
return await this.decomposeMetadataType(metadataType, flags);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
// Build comprehensive error report
|
|
412
|
+
const errorDetails = [];
|
|
413
|
+
errorDetails.push(`Metadata Type: ${metadataType.name}`);
|
|
414
|
+
errorDetails.push(`Behavior: ${metadataType.behavior}`);
|
|
415
|
+
errorDetails.push(`Command: ${commandExecuted}`);
|
|
416
|
+
if (exitCode) {
|
|
417
|
+
errorDetails.push(`Exit Code: ${exitCode}`);
|
|
418
|
+
}
|
|
419
|
+
if (errorMessage && errorMessage !== 'Unknown error') {
|
|
420
|
+
errorDetails.push(`Error Message: ${errorMessage}`);
|
|
421
|
+
}
|
|
422
|
+
if (errorStdout && errorStdout.trim()) {
|
|
423
|
+
errorDetails.push(`Standard Output:\n${errorStdout.trim()}`);
|
|
424
|
+
}
|
|
425
|
+
if (errorStderr && errorStderr.trim()) {
|
|
426
|
+
errorDetails.push(`Standard Error:\n${errorStderr.trim()}`);
|
|
427
|
+
}
|
|
428
|
+
const detailedErrorReport = errorDetails.join('\n');
|
|
429
|
+
// Create user-friendly error message for UI
|
|
430
|
+
let uiErrorMessage = `Error decomposing ${metadataType.name}`;
|
|
431
|
+
if (exitCode) {
|
|
432
|
+
uiErrorMessage += ` (exit code ${exitCode})`;
|
|
433
|
+
}
|
|
434
|
+
if (errorStderr && errorStderr.trim()) {
|
|
435
|
+
// Include first line of stderr in UI message
|
|
436
|
+
const firstErrorLine = errorStderr.trim().split('\n')[0];
|
|
437
|
+
uiErrorMessage += `: ${firstErrorLine}`;
|
|
438
|
+
}
|
|
439
|
+
else if (errorMessage && errorMessage !== 'Unknown error') {
|
|
440
|
+
uiErrorMessage += `: ${errorMessage}`;
|
|
441
|
+
}
|
|
442
|
+
// Log detailed error report
|
|
443
|
+
uxLog("error", this, c.red(uiErrorMessage));
|
|
444
|
+
// Also log to help with debugging
|
|
445
|
+
if (flags.debug) {
|
|
446
|
+
uxLog("error", this, c.grey(`Full error object: ${JSON.stringify(error, null, 2)}`));
|
|
447
|
+
}
|
|
448
|
+
return { success: false, error: detailedErrorReport };
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
/* jscpd:ignore-end */
|
|
453
|
+
//# sourceMappingURL=activate-decomposed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activate-decomposed.js","sourceRoot":"","sources":["../../../../../src/commands/hardis/project/metadata/activate-decomposed.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,CAAC,MAAM,OAAO,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,mCAA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AAE,CAAC,CAAC,IAAI,CAAC,sBAAsB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YACvF,CAAC;YAED,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,EAAE,CAAC;QACxD,CAAC;IACH,CAAC;;AAGH,sBAAsB"}
|
|
@@ -39,7 +39,7 @@ export class DocBuilderObject extends DocBuilderRoot {
|
|
|
39
39
|
]);
|
|
40
40
|
for (const field of fields) {
|
|
41
41
|
lines.push(...[
|
|
42
|
-
`| ${field.fullName} | ${field.label || ""} | ${field.type || ""} | ${mdTableCell(field.description)} |`
|
|
42
|
+
`| ${field.fullName} | ${field.label || ""} | ${field.type || ""} | ${mdTableCell(String(field.description))} |`
|
|
43
43
|
]);
|
|
44
44
|
}
|
|
45
45
|
lines.push("");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docBuilderObject.js","sourceRoot":"","sources":["../../../src/common/docBuilder/docBuilderObject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,MAAM,OAAO,gBAAiB,SAAQ,cAAc;IAE3C,OAAO,GAAG,QAAQ,CAAC;IACnB,SAAS,GAAmB,wBAAwB,CAAC;IACrD,WAAW,GAAG,6BAA6B,CAAC;IAC5C,UAAU,GAAG,cAAc,CAAC;IAE5B,MAAM,CAAC,eAAe,CAAC,MAAc,EAAE,kBAAyB;QACrE,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,GAAG;YACZ,YAAY;YACZ,EAAE;YACF,qCAAqC;YACrC,sCAAsC;SACvC,CAAC,CAAC;QACH,KAAK,MAAM,iBAAiB,IAAI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YAAY,EAAE,SAAS,EAAE,CAAC;YACpC,OAAO,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC;QACvC,CAAC;QACD,MAAM,WAAW,GAAG,IAAI,UAAU,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACnD,OAAO,WAAW,CAAA;IACpB,CAAC;CAEF"}
|
|
@@ -521,9 +521,49 @@ _Powered by [sfdx-hardis](${CONSTANTS.DOC_URL_ROOT}) from job [${azureJobName}](
|
|
|
521
521
|
const workItemIds = (queryResult.workItems || []).map(item => item.id);
|
|
522
522
|
if (workItemIds.length > 0) {
|
|
523
523
|
this.attachmentsWorkItemId = Number(workItemIds[0]);
|
|
524
|
+
// Check the number of attached images: if too many, rename the work item with (full) then create a new one by cloning its parameters
|
|
525
|
+
const workItem = await witApi.getWorkItem(this.attachmentsWorkItemId, undefined, undefined, 1); // WorkItemExpand.Relations = 1
|
|
526
|
+
const attachedImages = (workItem.relations || []).filter(rel => rel.rel === "AttachedFile");
|
|
527
|
+
if (attachedImages.length >= 90) {
|
|
528
|
+
// Rename the work item
|
|
529
|
+
const newTitle = this.attachmentsWorkItemTitle + " (full)";
|
|
530
|
+
await witApi.updateWorkItem([], [
|
|
531
|
+
{
|
|
532
|
+
op: "replace",
|
|
533
|
+
path: "/fields/System.Title",
|
|
534
|
+
value: newTitle
|
|
535
|
+
}
|
|
536
|
+
], this.attachmentsWorkItemId, process.env.SYSTEM_TEAMPROJECT);
|
|
537
|
+
uxLog("log", this, c.grey(`[Azure Integration] Renamed work item ${this.attachmentsWorkItemId} to '${newTitle}'`));
|
|
538
|
+
// Create a new work item by cloning the old one's parameters
|
|
539
|
+
const newWorkItem = await witApi.createWorkItem([], [
|
|
540
|
+
{
|
|
541
|
+
op: "add",
|
|
542
|
+
path: "/fields/System.Title",
|
|
543
|
+
value: this.attachmentsWorkItemTitle
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
op: "add",
|
|
547
|
+
path: "/fields/System.WorkItemType",
|
|
548
|
+
value: workItem.fields?.["System.WorkItemType"] || "Task"
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
op: "add",
|
|
552
|
+
path: "/fields/System.Description",
|
|
553
|
+
value: "Technical work item used by sfdx-hardis to attach images for PR comments"
|
|
554
|
+
}
|
|
555
|
+
], process.env.SYSTEM_TEAMPROJECT, workItem.fields?.["System.WorkItemType"] || "Task");
|
|
556
|
+
if (newWorkItem && newWorkItem.id) {
|
|
557
|
+
this.attachmentsWorkItemId = newWorkItem.id;
|
|
558
|
+
uxLog("log", this, c.grey(`[Azure Integration] Created new work item ${this.attachmentsWorkItemId} with title '${this.attachmentsWorkItemTitle}'`));
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
else {
|
|
562
|
+
uxLog("log", this, c.grey(`[Azure Integration] Found existing work item ${this.attachmentsWorkItemId} with title '${this.attachmentsWorkItemTitle}'`));
|
|
563
|
+
}
|
|
524
564
|
return this.attachmentsWorkItemId;
|
|
525
565
|
}
|
|
526
|
-
uxLog("error", this, c.red(`[Azure Integration] You need to create a technical work item exactly named '${this.attachmentsWorkItemTitle}',
|
|
566
|
+
uxLog("error", this, c.red(`[Azure Integration] You need to create a technical work item exactly named '${this.attachmentsWorkItemTitle}', that will be used to attach images for comments.`));
|
|
527
567
|
return null;
|
|
528
568
|
}
|
|
529
569
|
}
|