sfdx-git-delta 7.4.1 → 7.4.3
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 +15 -2
- package/lib/constant/metadataConstants.d.ts +5 -0
- package/lib/constant/metadataConstants.js +22 -1
- package/lib/constant/metadataConstants.js.map +1 -1
- package/lib/main.js +13 -0
- package/lib/main.js.map +1 -1
- package/lib/post-processor/changesManifestProcessor.js +14 -1
- package/lib/post-processor/changesManifestProcessor.js.map +1 -1
- package/lib/utils/changeSet.d.ts +7 -0
- package/lib/utils/changeSet.js +112 -41
- package/lib/utils/changeSet.js.map +1 -1
- package/lib/utils/ignoreHelper.js +0 -5
- package/lib/utils/ignoreHelper.js.map +1 -1
- package/lib/utils/metadataBoundaryResolver.d.ts +4 -0
- package/lib/utils/metadataBoundaryResolver.js +40 -29
- package/lib/utils/metadataBoundaryResolver.js.map +1 -1
- package/lib/utils/metadataDiff/deepEqualJson.js +51 -44
- package/lib/utils/metadataDiff/deepEqualJson.js.map +1 -1
- package/lib/utils/metadataDiff/xmlEventReader.js +59 -49
- package/lib/utils/metadataDiff/xmlEventReader.js.map +1 -1
- package/lib/utils/renameResolver.d.ts +7 -3
- package/lib/utils/renameResolver.js +19 -7
- package/lib/utils/renameResolver.js.map +1 -1
- package/lib/utils/repoGitDiff.d.ts +3 -0
- package/lib/utils/repoGitDiff.js +66 -53
- package/lib/utils/repoGitDiff.js.map +1 -1
- package/lib/utils/treeIndexScope.js +20 -23
- package/lib/utils/treeIndexScope.js.map +1 -1
- package/messages/delta.md +4 -0
- package/oclif.manifest.json +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -214,7 +214,7 @@ FLAG DESCRIPTIONS
|
|
|
214
214
|
`--source-dir force-app` does not match `nested/force-app/...`.
|
|
215
215
|
```
|
|
216
216
|
|
|
217
|
-
_See code: [src/commands/sgd/source/delta.ts](https://github.com/scolladon/sfdx-git-delta/blob/v7.4.
|
|
217
|
+
_See code: [src/commands/sgd/source/delta.ts](https://github.com/scolladon/sfdx-git-delta/blob/v7.4.3/src/commands/sgd/source/delta.ts)_
|
|
218
218
|
<!-- commandsstop -->
|
|
219
219
|
|
|
220
220
|
### Windows users
|
|
@@ -487,6 +487,12 @@ If SGD cannot read the file listing at `--to`, the move check is skipped, the de
|
|
|
487
487
|
|
|
488
488
|
Note: when only using the `--ignore-file [-i]` parameter (and not `--ignore-destructive-file [-D]`) the plugin will apply it to added/changed/deleted elements.
|
|
489
489
|
|
|
490
|
+
Independently of any ignore file, SGD also keeps components of a type the Metadata API cannot delete — today only `RecordType` — out of `destructiveChanges.xml` on every route: an ordinary deletion, a rename, and `--include-destructive-file` alike. A destructive entry for one of these is a component failure (`Cannot delete record type through API`) that fails the whole deployment. The component is not deleted anywhere; it is only omitted from the manifest SGD would otherwise emit, so it remains in the target org until you remove it by hand in Setup. SGD raises a warning naming the type and the affected members:
|
|
491
|
+
|
|
492
|
+
```
|
|
493
|
+
Warning: The Metadata API cannot delete 'RecordType' components, so destructiveChanges.xml omits 'Account.Alpha'. Remove them from the target org manually in Setup.
|
|
494
|
+
```
|
|
495
|
+
|
|
490
496
|
### Explicitly including specific files for inclusion or destruction regardless of diff
|
|
491
497
|
|
|
492
498
|
The `--include-file [-n]` parameter allows you to specify a file based on [gitignore glob matching](https://git-scm.com/docs/gitignore) to include specific files. Regardless whether they appears in the diff or not.
|
|
@@ -603,7 +609,14 @@ Produces (bare form example) `incremental/changes.manifest.json`. Setting `--cha
|
|
|
603
609
|
}
|
|
604
610
|
```
|
|
605
611
|
|
|
606
|
-
`package.xml` still lists `NewName` and `destructiveChanges.xml` still lists `OldName` for renames — the deployment contract is unchanged.
|
|
612
|
+
`package.xml` still lists `NewName` and `destructiveChanges.xml` still lists `OldName` for renames — the deployment contract is unchanged, and the manifests are identical whether or not `--changes-manifest` is set. Both sides of a rename still pass through the ignore files: a `from` path covered by `--ignore-destructive-file` keeps its member out of `destructiveChanges.xml`, a `to` path covered by `--ignore-file` keeps its member out of `package.xml`, and the change is then reported in `changes.manifest.json` as a plain addition or deletion rather than a rename: an ignored `from` leaves `to` in the `add` bucket, an ignored `to` leaves `from` in the `delete` bucket. When the move keeps the component name, the deletion is cancelled against the ignored addition and neither side is reported at all.
|
|
613
|
+
|
|
614
|
+
Two default-configuration behaviours changed with no dedicated changelog entry — the kind of thing you notice the first time you diff a JSON manifest across the upgrade:
|
|
615
|
+
|
|
616
|
+
- a **renamed** record type is still reported in the `rename` bucket, but its former name is no longer emitted into `destructiveChanges.xml` — that entry previously made the whole deployment fail;
|
|
617
|
+
- a **deleted** record type now appears in the `delete` bucket, where previously it appeared nowhere.
|
|
618
|
+
|
|
619
|
+
Both are consequences of the undeletable-component warning described above: `RecordType` (today's only such type) is kept out of `destructiveChanges.xml`, but still reported in `changes.manifest.json` for review.
|
|
607
620
|
|
|
608
621
|
Works for file-backed metadata, in-file sub-components (CustomLabels members, Workflow rules, etc.), decomposed metadata, in-resource bundles and in-folder metadata.
|
|
609
622
|
|
|
@@ -2,6 +2,7 @@ export declare const BOT_TYPE = "Bot";
|
|
|
2
2
|
export declare const BOT_VERSION_TYPE = "BotVersion";
|
|
3
3
|
export declare const CUSTOM_APPLICATION_SUFFIX = "app";
|
|
4
4
|
export declare const CUSTOM_METADATA_SUFFIX = "md";
|
|
5
|
+
export declare const DASHBOARD_TYPE = "Dashboard";
|
|
5
6
|
export declare const DEFAULT_CONTAINER_DEPTH = 1;
|
|
6
7
|
export declare const DIGITAL_EXPERIENCE_ADAPTER = "digitalExperience";
|
|
7
8
|
export declare const CONTENT_CONTAINER_ADAPTERS: Set<string>;
|
|
@@ -23,8 +24,12 @@ export declare const OBJECT_TRANSLATION_META_XML_SUFFIX = "objectTranslation-met
|
|
|
23
24
|
export declare const OBJECT_TRANSLATION_TYPE = "CustomObjectTranslation";
|
|
24
25
|
export declare const OBJECT_TYPE = "CustomObject";
|
|
25
26
|
export declare const PERMISSIONSET_TYPE = "PermissionSet";
|
|
27
|
+
export declare const RECORD_TYPE = "RecordType";
|
|
28
|
+
export declare const REPORT_TYPE = "Report";
|
|
29
|
+
export declare const FOLDER_MOVE_ON_DEPLOY_TYPES: ReadonlySet<string>;
|
|
26
30
|
export declare const SHARING_RULE_TYPE = "SharingRules";
|
|
27
31
|
export declare const SUB_OBJECT_TYPES: string[];
|
|
32
|
+
export declare const UNDELETABLE_TYPES: ReadonlySet<string>;
|
|
28
33
|
export declare const TRANSLATION_EXTENSION = "translation";
|
|
29
34
|
export declare const TRANSLATION_TYPE = "Translations";
|
|
30
35
|
export declare const VIRTUAL_BOT_TYPE = "VirtualBot";
|
|
@@ -3,6 +3,7 @@ export const BOT_TYPE = 'Bot';
|
|
|
3
3
|
export const BOT_VERSION_TYPE = 'BotVersion';
|
|
4
4
|
export const CUSTOM_APPLICATION_SUFFIX = 'app';
|
|
5
5
|
export const CUSTOM_METADATA_SUFFIX = 'md';
|
|
6
|
+
export const DASHBOARD_TYPE = 'Dashboard';
|
|
6
7
|
// A component named by the single segment below its type directory: every
|
|
7
8
|
// content-container adapter except digitalExperience (depths below), and the
|
|
8
9
|
// holder-scoped composed types, whose every file keys on that one segment.
|
|
@@ -39,6 +40,17 @@ export const OBJECT_TRANSLATION_META_XML_SUFFIX = `objectTranslation${METAFILE_S
|
|
|
39
40
|
export const OBJECT_TRANSLATION_TYPE = 'CustomObjectTranslation';
|
|
40
41
|
export const OBJECT_TYPE = 'CustomObject';
|
|
41
42
|
export const PERMISSIONSET_TYPE = 'PermissionSet';
|
|
43
|
+
export const RECORD_TYPE = 'RecordType';
|
|
44
|
+
export const REPORT_TYPE = 'Report';
|
|
45
|
+
// The Metadata API relocates these when the package lists them under a new
|
|
46
|
+
// folder, so their former path must not be destroyed alongside the move.
|
|
47
|
+
// Declared out of alphabetical order on purpose: the Set dereferences both
|
|
48
|
+
// members at module evaluation, so filing it under F would read REPORT_TYPE
|
|
49
|
+
// before its initialiser has run.
|
|
50
|
+
export const FOLDER_MOVE_ON_DEPLOY_TYPES = new Set([
|
|
51
|
+
REPORT_TYPE,
|
|
52
|
+
DASHBOARD_TYPE,
|
|
53
|
+
]);
|
|
42
54
|
export const SHARING_RULE_TYPE = 'SharingRules';
|
|
43
55
|
export const SUB_OBJECT_TYPES = [
|
|
44
56
|
'BusinessProcess',
|
|
@@ -47,7 +59,7 @@ export const SUB_OBJECT_TYPES = [
|
|
|
47
59
|
'FieldSet',
|
|
48
60
|
'Index',
|
|
49
61
|
'ListView',
|
|
50
|
-
|
|
62
|
+
RECORD_TYPE,
|
|
51
63
|
'SharingCriteriaRule',
|
|
52
64
|
'SharingGuestRule',
|
|
53
65
|
'SharingOwnerRule',
|
|
@@ -65,6 +77,15 @@ export const SUB_OBJECT_TYPES = [
|
|
|
65
77
|
'WorkflowSend',
|
|
66
78
|
'WorkflowTask',
|
|
67
79
|
];
|
|
80
|
+
// The Metadata API cannot delete these, so a destructive entry for one is a
|
|
81
|
+
// component failure that fails the whole deploy: the destructive view omits
|
|
82
|
+
// them and a warning names them instead.
|
|
83
|
+
// See: https://github.com/scolladon/sfdx-git-delta/wiki/Metadata-Specificities#recordtype-destructive-changes
|
|
84
|
+
// Must stay disjoint from FOLDER_MOVE_ON_DEPLOY_TYPES, BOT_TYPE and
|
|
85
|
+
// BOT_VERSION_TYPE: undeletableDeletions() reports from the pre-suppressor
|
|
86
|
+
// view, so an overlap would let the warning name a member those suppressors
|
|
87
|
+
// drop anyway, and the manifest and the warning would disagree.
|
|
88
|
+
export const UNDELETABLE_TYPES = new Set([RECORD_TYPE]);
|
|
68
89
|
export const TRANSLATION_EXTENSION = 'translation';
|
|
69
90
|
export const TRANSLATION_TYPE = 'Translations';
|
|
70
91
|
export const VIRTUAL_BOT_TYPE = 'VirtualBot';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadataConstants.js","sourceRoot":"","sources":["../../src/constant/metadataConstants.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,MAAM,CAAC,MAAM,QAAQ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,IAAI,GAAG,CAAC;IACtE,WAAW;IACX,cAAc;CACf,CAAC,CAAA;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAA;AAC/C,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,iBAAiB;IACjB,eAAe;IACf,aAAa;IACb,UAAU;IACV,OAAO;IACP,UAAU;IACV,WAAW;IACX,qBAAqB;IACrB,kBAAkB;IAClB,kBAAkB;IAClB,eAAe;IACf,YAAY;IACZ,gBAAgB;IAChB,gBAAgB;IAChB,SAAS;IACT,eAAe;IACf,qBAAqB;IACrB,oBAAoB;IACpB,0BAA0B;IAC1B,yBAAyB;IACzB,cAAc;IACd,cAAc;IACd,cAAc;CACf,CAAA;AACD,4EAA4E;AAC5E,4EAA4E;AAC5E,yCAAyC;AACzC,8GAA8G;AAC9G,oEAAoE;AACpE,2EAA2E;AAC3E,4EAA4E;AAC5E,gEAAgE;AAChE,MAAM,CAAC,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAA;AAC5E,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAA;AAClD,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAA;AAC9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,YAAY,CAAA;AAC5C,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAA"}
|
package/lib/main.js
CHANGED
|
@@ -22,6 +22,18 @@ const collectLines = async (lines) => {
|
|
|
22
22
|
}
|
|
23
23
|
return materialized;
|
|
24
24
|
};
|
|
25
|
+
// The Metadata API refuses to delete these, so the destructive manifest
|
|
26
|
+
// omits them — but the components really are gone from the source and
|
|
27
|
+
// stay in the org, so the user has to remove them by hand. One warning
|
|
28
|
+
// per type, listing its members: fifty orphaned record types must not
|
|
29
|
+
// produce fifty lines.
|
|
30
|
+
const undeletableWarnings = (changes, messages) => [...changes.undeletableDeletions()].map(([type, members]) => new Error(messages.getMessage('warning.UndeletableComponentsOmitted', [
|
|
31
|
+
type,
|
|
32
|
+
// Sanitize each member before joining: the length cap in
|
|
33
|
+
// sanitizeForMessage applies per value, so a single long member
|
|
34
|
+
// name would otherwise silently elide every member after it.
|
|
35
|
+
[...members].map(sanitizeForMessage).join(', '),
|
|
36
|
+
])));
|
|
25
37
|
export default async (configInput) => {
|
|
26
38
|
// Stryker disable next-line StringLiteral -- equivalent: log content is observability only; tests assert on the returned Work, not lazy log lines
|
|
27
39
|
Logger.trace('main: entry');
|
|
@@ -127,6 +139,7 @@ export default async (configInput) => {
|
|
|
127
139
|
...sourceScopeWarnings,
|
|
128
140
|
...ignoredMoveWarnings,
|
|
129
141
|
...treeIndexWarnings,
|
|
142
|
+
...undeletableWarnings(changes, messages),
|
|
130
143
|
],
|
|
131
144
|
};
|
|
132
145
|
// Stryker disable next-line StringLiteral -- equivalent: log content is observability only
|
package/lib/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,OAAO,UAAU,MAAM,yBAAyB,CAAA;AAChD,OAAO,UAAU,MAAM,yBAAyB,CAAA;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAA;AAC5E,OAAO,mBAAmB,MAAM,kCAAkC,CAAA;AAIlE,OAAO,SAAS,MAAM,sBAAsB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,eAAe,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,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AAoE;QACpE,MAAM,iBAAiB,GAAG,MAAM,CAC9B,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,EAC7B,8BAA8B,EAC9B,GAAG,EAAE,CAAC,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC,CACxC,CAAA;QAED,MAAM,IAAI,GAAS;YACjB,MAAM;YACN,OAAO;YACP,QAAQ,EAAE;gBACR,GAAG,cAAc;gBACjB,GAAG,gBAAgB;gBACnB,GAAG,iBAAiB;gBACpB,GAAG,mBAAmB;gBACtB,GAAG,mBAAmB;gBACtB,GAAG,iBAAiB;gBACpB,GAAG,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC;aAC1C;SACF,CAAA;QACD,2FAA2F;QAC3F,MAAM,CAAC,KAAK,CAAC,IAAI,CAAA,gBAAgB,IAAI,EAAE,CAAC,CAAA;QACxC,2FAA2F;QAC3F,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;QAC1B,OAAO,IAAI,CAAA;IACb,CAAC;YAAS,CAAC;QACT,MAAM,UAAU,CAAC,QAAQ,EAAE,CAAA;IAC7B,CAAC;AACH,CAAC,CAAA"}
|
|
@@ -44,7 +44,20 @@ export default class ChangesManifestProcessor extends BaseProcessor {
|
|
|
44
44
|
for (const type of [...renames.keys()].sort()) {
|
|
45
45
|
const pairs = [...renames.get(type).values()]
|
|
46
46
|
.map(({ from, to }) => ({ from, to }))
|
|
47
|
-
|
|
47
|
+
// Code-unit order, matching the bare .sort() on the type keys above:
|
|
48
|
+
// a locale-aware comparison would order the emitted manifest
|
|
49
|
+
// differently depending on the machine that generated it. Written
|
|
50
|
+
// branchlessly so the equal case needs no separate arm.
|
|
51
|
+
// The `>` term only ever needs to signal "not before" (0 or
|
|
52
|
+
// positive) to Array.prototype.sort's swap-iff-negative contract, so
|
|
53
|
+
// forcing it to `false`/0 or widening it to `>=` changes no
|
|
54
|
+
// reachable pairwise swap decision and thus no output order —
|
|
55
|
+
// confirmed empirically against the unmutated comparator over
|
|
56
|
+
// randomised arrays from 8 to 2000 entries, spanning the size at
|
|
57
|
+
// which the engine stops using insertion sort and starts merging.
|
|
58
|
+
// The `<` term is the one load-bearing half; it is covered by the
|
|
59
|
+
// equal-`to` stability test below.
|
|
60
|
+
.sort((a, b) => Number(a.to > b.to) - Number(a.to < b.to));
|
|
48
61
|
bucket[type] = pairs;
|
|
49
62
|
}
|
|
50
63
|
return bucket;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changesManifestProcessor.js","sourceRoot":"","sources":["../../src/post-processor/changesManifestProcessor.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;;;;;;;AAEZ,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAItD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,8BAA8B,CAAA;AAClD,OAAO,aAAa,EAAE,EACpB,YAAY,GAEb,MAAM,oBAAoB,CAAA;AAY3B,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,aAAa;IAE3C,AAAN,KAAK,CAAC,OAAO,CAAC,OAAkB;QAC9C,sDAAsD;QACtD,2EAA2E;QAC3E,sEAAsE;QACtE,yDAAyD;QACzD,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,CAAA;QAC9C,IAAI,CAAC,UAAU;YAAE,OAAO,YAAY,EAAE,CAAA;QAEtC,uEAAuE;QACvE,yEAAyE;QACzE,sDAAsD;QACtD,MAAM,IAAI,GAAG,OAAO,CAAC,YAAY,EAAE,CAAA;QACnC,MAAM,OAAO,GAA0B;YACrC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;YAC7D,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,MAA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;IACf,CAAC;CACF;AAtDuB;IADrB,GAAG;uDAqBH"}
|
package/lib/utils/changeSet.d.ts
CHANGED
|
@@ -34,10 +34,17 @@ export default class ChangeSet {
|
|
|
34
34
|
static from(elements: readonly ManifestElement[], renames?: readonly RenameTriple[]): ChangeSet;
|
|
35
35
|
private _addElement;
|
|
36
36
|
toElements(): ManifestElement[];
|
|
37
|
+
private _targetElements;
|
|
38
|
+
private _memberElements;
|
|
37
39
|
private _recordRename;
|
|
38
40
|
forPackageManifest(): Manifest;
|
|
39
41
|
forDestructiveManifest(): Manifest;
|
|
42
|
+
private _orphanedDeletes;
|
|
43
|
+
private _stripUndeletableTypes;
|
|
44
|
+
undeletableDeletions(): Manifest;
|
|
45
|
+
private _withoutDeletedHolders;
|
|
40
46
|
private _suppressVersionsOfDeletedBots;
|
|
47
|
+
private _suppressMovedFolderMembers;
|
|
41
48
|
isEmpty(): boolean;
|
|
42
49
|
byChangeKind(): Readonly<{
|
|
43
50
|
[ChangeKind.Add]: Manifest;
|
package/lib/utils/changeSet.js
CHANGED
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
import { DOT } from '../constant/fsConstants.js';
|
|
3
|
-
import { BOT_TYPE, BOT_VERSION_TYPE } from '../constant/metadataConstants.js';
|
|
2
|
+
import { DOT, PATH_SEP } from '../constant/fsConstants.js';
|
|
3
|
+
import { BOT_TYPE, BOT_VERSION_TYPE, FOLDER_MOVE_ON_DEPLOY_TYPES, OBJECT_TYPE, UNDELETABLE_TYPES, } from '../constant/metadataConstants.js';
|
|
4
4
|
import { ChangeKind, ManifestTarget, } from '../types/handlerResult.js';
|
|
5
5
|
const KEY_SEPARATOR = '\0';
|
|
6
|
+
const MANIFEST_TARGETS = [
|
|
7
|
+
ManifestTarget.Package,
|
|
8
|
+
ManifestTarget.DestructiveChanges,
|
|
9
|
+
];
|
|
10
|
+
const ADD_KINDS = [
|
|
11
|
+
ChangeKind.Add,
|
|
12
|
+
ChangeKind.Modify,
|
|
13
|
+
ChangeKind.Delete,
|
|
14
|
+
];
|
|
6
15
|
const renameKey = (from, to) => `${from}${KEY_SEPARATOR}${to}`;
|
|
16
|
+
// Locale-invariant on purpose: Salesforce API names are ASCII and the
|
|
17
|
+
// manifest must not depend on the machine that generated it.
|
|
18
|
+
// The direction is load-bearing, not a coin flip: upper-casing is not
|
|
19
|
+
// injective, so it would merge distinct components (both 'ss' and 'ß' fold
|
|
20
|
+
// to 'SS', and 'ff' and 'ff' to 'FF') and suppress a deletion that must
|
|
21
|
+
// survive. Lower-casing keeps them apart.
|
|
22
|
+
const developerName = (member) => member.slice(member.lastIndexOf(PATH_SEP) + 1).toLowerCase();
|
|
7
23
|
/**
|
|
8
24
|
* Domain object that collects every component change observed in a diff and
|
|
9
25
|
* derives the views consumed downstream:
|
|
@@ -59,35 +75,18 @@ export default class ChangeSet {
|
|
|
59
75
|
// maintained as a hot-path structure, so call it once per pass, not per
|
|
60
76
|
// element.
|
|
61
77
|
toElements() {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
];
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
for (const member of members) {
|
|
75
|
-
let kind;
|
|
76
|
-
for (const k of kinds) {
|
|
77
|
-
if (this.byKind[k].get(type)?.has(member)) {
|
|
78
|
-
kind = k;
|
|
79
|
-
break;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
// Stryker disable next-line ConditionalExpression -- equivalent: see v8 ignore — the kind === undefined branch is unreachable because addElement keeps byTarget and byKind in lockstep
|
|
83
|
-
/* v8 ignore next -- defensive: addElement always pairs byTarget and byKind, so every (type, member) in byTarget has a corresponding byKind entry */
|
|
84
|
-
if (kind !== undefined) {
|
|
85
|
-
out.push({ target, type, member, changeKind: kind });
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return out;
|
|
78
|
+
return MANIFEST_TARGETS.flatMap(target => this._targetElements(target));
|
|
79
|
+
}
|
|
80
|
+
_targetElements(target) {
|
|
81
|
+
return [...this.byTarget[target]].flatMap(([type, members]) => [...members].flatMap(member => this._memberElements(target, type, member)));
|
|
82
|
+
}
|
|
83
|
+
_memberElements(target, type, member) {
|
|
84
|
+
const changeKind = ADD_KINDS.find(kind => this.byKind[kind].get(type)?.has(member));
|
|
85
|
+
// Stryker disable next-line ConditionalExpression,ArrayDeclaration -- equivalent: see v8 ignore — the changeKind === undefined branch is unreachable because addElement keeps byTarget and byKind in lockstep
|
|
86
|
+
/* v8 ignore next -- defensive: addElement always pairs byTarget and byKind, so every (type, member) in byTarget has a corresponding byKind entry */
|
|
87
|
+
if (changeKind === undefined)
|
|
88
|
+
return [];
|
|
89
|
+
return [{ target, type, member, changeKind }];
|
|
91
90
|
}
|
|
92
91
|
_recordRename(type, from, to) {
|
|
93
92
|
if (from === to)
|
|
@@ -104,11 +103,58 @@ export default class ChangeSet {
|
|
|
104
103
|
]);
|
|
105
104
|
}
|
|
106
105
|
forDestructiveManifest() {
|
|
107
|
-
const
|
|
106
|
+
const packaged = this.forPackageManifest();
|
|
107
|
+
return this._suppressVersionsOfDeletedBots(this._suppressMovedFolderMembers(this._stripUndeletableTypes(this._orphanedDeletes(packaged)), packaged));
|
|
108
|
+
}
|
|
109
|
+
// Everything the destructive view would carry before any suppressor runs:
|
|
110
|
+
// the destructive-target members unioned with the rename sources, minus
|
|
111
|
+
// whatever the package view already covers. Extracted because the
|
|
112
|
+
// undeletable-type strip and its reporting query must agree on exactly
|
|
113
|
+
// this input.
|
|
114
|
+
_orphanedDeletes(packaged) {
|
|
115
|
+
return this._subtractByType(this._unionByType([
|
|
108
116
|
this.byTarget[ManifestTarget.DestructiveChanges],
|
|
109
117
|
this._renameSourcesByType(),
|
|
110
|
-
]);
|
|
111
|
-
|
|
118
|
+
]), packaged);
|
|
119
|
+
}
|
|
120
|
+
// The Metadata API refuses to delete these types, and one such member
|
|
121
|
+
// fails the whole deploy — so the destructive view drops the type
|
|
122
|
+
// wholesale. The review view (byChangeKind) deliberately keeps it,
|
|
123
|
+
// mirroring _suppressVersionsOfDeletedBots: the file really was deleted.
|
|
124
|
+
_stripUndeletableTypes(deletes) {
|
|
125
|
+
const result = new Map(deletes);
|
|
126
|
+
for (const type of UNDELETABLE_TYPES)
|
|
127
|
+
result.delete(type);
|
|
128
|
+
return result;
|
|
129
|
+
}
|
|
130
|
+
// Members omitted from the destructive view because their type cannot be
|
|
131
|
+
// deleted through the Metadata API, and which therefore need removing by
|
|
132
|
+
// hand. Reads the same input the strip consumes, so a member the package
|
|
133
|
+
// view already covers is neither stripped nor reported here. A query,
|
|
134
|
+
// never an emitter: main.ts turns the result into a warning.
|
|
135
|
+
undeletableDeletions() {
|
|
136
|
+
const orphaned = this._orphanedDeletes(this.forPackageManifest());
|
|
137
|
+
const deletedHolders = orphaned.get(OBJECT_TYPE);
|
|
138
|
+
const result = new Map();
|
|
139
|
+
for (const type of UNDELETABLE_TYPES) {
|
|
140
|
+
const members = orphaned.get(type);
|
|
141
|
+
if (!members)
|
|
142
|
+
continue;
|
|
143
|
+
const orphans = this._withoutDeletedHolders(members, deletedHolders);
|
|
144
|
+
if (orphans.size > 0)
|
|
145
|
+
result.set(type, orphans);
|
|
146
|
+
}
|
|
147
|
+
return result;
|
|
148
|
+
}
|
|
149
|
+
// A deleted CustomObject takes its record types with it, so a member whose
|
|
150
|
+
// holder the same deploy destroys needs no manual cleanup and must not be
|
|
151
|
+
// reported. Same shape as _suppressVersionsOfDeletedBots: the member is
|
|
152
|
+
// `<holder>.<name>` and an API name cannot contain a dot, so the segment
|
|
153
|
+
// before the first one names the holder.
|
|
154
|
+
_withoutDeletedHolders(members, deletedHolders) {
|
|
155
|
+
if (!deletedHolders?.size)
|
|
156
|
+
return new Set(members);
|
|
157
|
+
return new Set([...members].filter(member => !deletedHolders.has(member.split(DOT)[0])));
|
|
112
158
|
}
|
|
113
159
|
// A deleted Bot takes its versions with it, so a BotVersion listed beside
|
|
114
160
|
// its own deleted parent is redundant. A BotVersion member is
|
|
@@ -133,6 +179,30 @@ export default class ChangeSet {
|
|
|
133
179
|
}
|
|
134
180
|
return result;
|
|
135
181
|
}
|
|
182
|
+
// For Report/Dashboard, the Metadata API relocates the component when the
|
|
183
|
+
// package lists it under a new folder, so a destructive entry for its
|
|
184
|
+
// former path would delete the component the same deploy just moved.
|
|
185
|
+
// Membership is compared on DeveloperName alone, deliberately not as a
|
|
186
|
+
// rename-pair match, so it also fires in the default run where no rename
|
|
187
|
+
// pair exists.
|
|
188
|
+
_suppressMovedFolderMembers(deletes, surviving) {
|
|
189
|
+
const result = new Map(deletes);
|
|
190
|
+
for (const type of FOLDER_MOVE_ON_DEPLOY_TYPES) {
|
|
191
|
+
const members = result.get(type);
|
|
192
|
+
const kept = surviving.get(type);
|
|
193
|
+
if (!members || !kept)
|
|
194
|
+
continue;
|
|
195
|
+
// A member whose last segment is empty yields an empty name, which
|
|
196
|
+
// would otherwise match every other malformed member.
|
|
197
|
+
const names = new Set([...kept].map(developerName).filter(Boolean));
|
|
198
|
+
const remaining = new Set([...members].filter(member => !names.has(developerName(member))));
|
|
199
|
+
if (remaining.size > 0)
|
|
200
|
+
result.set(type, remaining);
|
|
201
|
+
else
|
|
202
|
+
result.delete(type);
|
|
203
|
+
}
|
|
204
|
+
return result;
|
|
205
|
+
}
|
|
136
206
|
// Whether either manifest view would carry at least one member — the
|
|
137
207
|
// "did this run actually produce anything" signal callers need without
|
|
138
208
|
// reaching into both views themselves.
|
|
@@ -146,17 +216,18 @@ export default class ChangeSet {
|
|
|
146
216
|
// Delete subtracts Add ∪ Modify (cancelled deletions) and rename sources.
|
|
147
217
|
const targets = this._renameTargetsByType();
|
|
148
218
|
const sources = this._renameSourcesByType();
|
|
219
|
+
const surviving = this._unionByType([
|
|
220
|
+
this.byKind[ChangeKind.Add],
|
|
221
|
+
this.byKind[ChangeKind.Modify],
|
|
222
|
+
]);
|
|
149
223
|
return {
|
|
150
224
|
[ChangeKind.Add]: this._subtractByType(this.byKind[ChangeKind.Add], targets),
|
|
151
225
|
// Clone so callers that mutate the returned Modify view cannot corrupt
|
|
152
|
-
// ChangeSet internal state. Add
|
|
153
|
-
//
|
|
226
|
+
// ChangeSet internal state. Add is the new Map returned by
|
|
227
|
+
// _subtractByType, Delete the one returned by
|
|
228
|
+
// _suppressMovedFolderMembers.
|
|
154
229
|
[ChangeKind.Modify]: this._cloneManifest(this.byKind[ChangeKind.Modify]),
|
|
155
|
-
[ChangeKind.Delete]: this._subtractByType(this.byKind[ChangeKind.Delete], this._unionByType([
|
|
156
|
-
this.byKind[ChangeKind.Add],
|
|
157
|
-
this.byKind[ChangeKind.Modify],
|
|
158
|
-
sources,
|
|
159
|
-
])),
|
|
230
|
+
[ChangeKind.Delete]: this._suppressMovedFolderMembers(this._subtractByType(this.byKind[ChangeKind.Delete], this._unionByType([surviving, sources])), surviving),
|
|
160
231
|
[ChangeKind.Rename]: this._cloneRenames(),
|
|
161
232
|
};
|
|
162
233
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeSet.js","sourceRoot":"","sources":["../../src/utils/changeSet.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"changeSet.js","sourceRoot":"","sources":["../../src/utils/changeSet.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,2BAA2B,EAC3B,WAAW,EACX,iBAAiB,GAClB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAEL,UAAU,EAEV,cAAc,GACf,MAAM,2BAA2B,CAAA;AAWlC,MAAM,aAAa,GAAG,IAAI,CAAA;AAC1B,MA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M,CAAC,CAAA;gBACvB,CAAC;YACH,CAAC;YACD,IAAI,SAAS,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;gBACvB,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;YAC7B,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;CACF"}
|
|
@@ -8,10 +8,6 @@ import ignore from 'ignore';
|
|
|
8
8
|
import { ADDITION, DELETION, GIT_DIFF_TYPE_REGEX, MODIFICATION, } from '../constant/gitConstants.js';
|
|
9
9
|
import { readFile } from './fsUtils.js';
|
|
10
10
|
import { log } from './LoggingDecorator.js';
|
|
11
|
-
// RATIONALE: Why are recordTypes excluded from destructive changes?
|
|
12
|
-
// The Metadata API does not support deleting RecordType via destructiveChanges.xml.
|
|
13
|
-
// See: https://github.com/scolladon/sfdx-git-delta/wiki/Metadata-Specificities#recordtype-destructive-changes
|
|
14
|
-
const BASE_DESTRUCTIVE_IGNORE = ['recordTypes/'];
|
|
15
11
|
export class IgnoreHelper {
|
|
16
12
|
globalIgnore;
|
|
17
13
|
destructiveIgnore;
|
|
@@ -49,7 +45,6 @@ export class IgnoreHelper {
|
|
|
49
45
|
const destructiveIgnore = await _buildIgnore(
|
|
50
46
|
// Stryker disable next-line ConditionalExpression,LogicalOperator -- equivalent: ignoreDestructive falls back to the global ignorePath when not set; flipping || to && would only use the destructive path when global is also set, but the cached singleton observable behavior remains stable for the test surface that always provides one of the two
|
|
51
47
|
ignoreDestructive || ignorePath);
|
|
52
|
-
destructiveIgnore.add(BASE_DESTRUCTIVE_IGNORE);
|
|
53
48
|
IgnoreHelper.ignoreInstance = new IgnoreHelper(globalIgnore, destructiveIgnore);
|
|
54
49
|
}
|
|
55
50
|
return IgnoreHelper.ignoreInstance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignoreHelper.js","sourceRoot":"","sources":["../../src/utils/ignoreHelper.ts"],"names":[],"mappings":";;;;;;AAAA,OAA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AAC,UAAU,EAAE,iBAAiB,CAAC,CAAA;AAEzD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EACjC,OAAO,EACP,kBAAkB,GAInB,EAAyB,EAAE,CAC1B,YAAY,CAAC,YAAY,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAA;AAExD,MAAM,YAAY,GAAG,KAAK,EAAE,UAA8B,EAAE,EAAE;IAC5D,MAAM,GAAG,GAAG,MAAM,EAAE,CAAA;IACpB,wQAAwQ;IACxQ,IAAI,UAAU,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,UAAU,CAAC,CAAA;QAC1C,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC7B,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA"}
|
|
@@ -11,6 +11,10 @@ export declare class MetadataBoundaryResolver {
|
|
|
11
11
|
protected get trees(): TreeReader;
|
|
12
12
|
createElement(path: string, metadataDef: Metadata, revision: string): Promise<MetadataElement>;
|
|
13
13
|
protected scanAndCreateElement(path: string, metadataDef: Metadata, revision: string): Promise<MetadataElement>;
|
|
14
|
+
protected findNameUnderTypeDirectory(parts: string[], dirIndex: number, suffix: string, revision: string): string | null;
|
|
15
|
+
protected componentNamesUnder(typeDir: string, suffix: string, revision: string): Set<string>;
|
|
16
|
+
protected findNameInAncestors(path: string, parts: string[], revision: string): string | null;
|
|
17
|
+
protected siblingsOf(dir: string, revision: string): string[];
|
|
14
18
|
protected isNameInPath(parts: string[], componentName: string): boolean;
|
|
15
19
|
protected findComponentName(siblings: string[], parts: string[]): string | null;
|
|
16
20
|
protected extractName(fileName: string, suffix: string): string;
|
|
@@ -45,42 +45,53 @@ export class MetadataBoundaryResolver {
|
|
|
45
45
|
async scanAndCreateElement(path, metadataDef, revision) {
|
|
46
46
|
const parts = path.split(PATH_SEP);
|
|
47
47
|
const dirIndex = parts.lastIndexOf(metadataDef.directoryName);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
48
|
+
const componentName = dirIndex >= 0 && metadataDef.suffix
|
|
49
|
+
? this.findNameUnderTypeDirectory(parts, dirIndex, metadataDef.suffix, revision)
|
|
50
|
+
: this.findNameInAncestors(path, parts, revision);
|
|
51
|
+
return MetadataElement.fromScan(path, metadataDef, this.metadata, componentName ?? parse(path).name);
|
|
52
|
+
}
|
|
53
|
+
findNameUnderTypeDirectory(parts, dirIndex, suffix, revision) {
|
|
54
|
+
const typeDir = parts.slice(0, dirIndex + 1).join(PATH_SEP);
|
|
55
|
+
const componentNames = this.componentNamesUnder(typeDir, suffix, revision);
|
|
56
|
+
const pathAfterType = parts.slice(dirIndex + 1);
|
|
57
|
+
// Stryker disable next-line UpdateOperator -- unaffordable rather than equivalent: with two or more segments after the type directory, i++ keeps `i >= 0` true forever and the mutant hangs until Stryker's timeout; with fewer, the loop never runs in either direction
|
|
58
|
+
for (let i = pathAfterType.length - 2; i >= 0; i--) {
|
|
59
|
+
if (componentNames.has(pathAfterType[i]))
|
|
60
|
+
return pathAfterType[i];
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
componentNamesUnder(typeDir, suffix, revision) {
|
|
65
|
+
const metaSuffix = `.${suffix}${METAFILE_SUFFIX}`;
|
|
66
|
+
const componentNames = new Set();
|
|
67
|
+
for (const file of this.trees.filesUnder(revision, typeDir)) {
|
|
68
|
+
if (file.endsWith(metaSuffix)) {
|
|
69
|
+
const fileName = file.split(PATH_SEP).pop();
|
|
70
|
+
componentNames.add(this.extractName(fileName, suffix));
|
|
65
71
|
}
|
|
66
|
-
return MetadataElement.fromScan(path, metadataDef, this.metadata, parse(path).name);
|
|
67
72
|
}
|
|
73
|
+
return componentNames;
|
|
74
|
+
}
|
|
75
|
+
findNameInAncestors(path, parts, revision) {
|
|
68
76
|
let currentDir = dirname(path);
|
|
69
|
-
// Stryker disable next-line ConditionalExpression,LogicalOperator,BlockStatement,StringLiteral -- equivalent:
|
|
77
|
+
// Stryker disable next-line ConditionalExpression,LogicalOperator,BlockStatement,StringLiteral -- unaffordable rather than equivalent: an emptied body, the `''` literal, the `||` swap and the operand true-flip never let `currentDir` reach '.', so those mutants hang until Stryker's timeout (dirname('.') is '.'). The whole-condition false-flip is suppressed as a side effect; it skips the walk, and the tests asserting pathAfterType[0] from a walk would kill it
|
|
70
78
|
while (currentDir && currentDir !== '.') {
|
|
71
|
-
const
|
|
72
|
-
let siblings = this.dirCache.get(cacheKey);
|
|
73
|
-
if (siblings === undefined) {
|
|
74
|
-
siblings = this.trees.children(revision, currentDir);
|
|
75
|
-
this.dirCache.set(cacheKey, siblings);
|
|
76
|
-
}
|
|
79
|
+
const siblings = this.siblingsOf(currentDir, revision);
|
|
77
80
|
const componentName = this.findComponentName(siblings, parts);
|
|
78
|
-
if (componentName)
|
|
79
|
-
return
|
|
80
|
-
}
|
|
81
|
+
if (componentName)
|
|
82
|
+
return componentName;
|
|
81
83
|
currentDir = dirname(currentDir);
|
|
82
84
|
}
|
|
83
|
-
return
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
siblingsOf(dir, revision) {
|
|
88
|
+
const cacheKey = `${revision}:${dir}`;
|
|
89
|
+
let siblings = this.dirCache.get(cacheKey);
|
|
90
|
+
if (siblings === undefined) {
|
|
91
|
+
siblings = this.trees.children(revision, dir);
|
|
92
|
+
this.dirCache.set(cacheKey, siblings);
|
|
93
|
+
}
|
|
94
|
+
return siblings;
|
|
84
95
|
}
|
|
85
96
|
isNameInPath(parts, componentName) {
|
|
86
97
|
return parts.some(part => part === componentName || part.startsWith(`${componentName}.`));
|