sfdx-git-delta 7.3.0 → 7.4.1
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 +23 -4
- package/lib/adapter/GitAdapter.d.ts +9 -4
- package/lib/adapter/GitAdapter.js +147 -52
- package/lib/adapter/GitAdapter.js.map +1 -1
- package/lib/adapter/pathMatching.d.ts +2 -1
- package/lib/adapter/pathMatching.js +35 -3
- package/lib/adapter/pathMatching.js.map +1 -1
- package/lib/adapter/treeReader.d.ts +1 -0
- package/lib/adapter/treeReader.js +10 -0
- package/lib/adapter/treeReader.js.map +1 -1
- package/lib/adapter/tsgitErrorMap.d.ts +6 -3
- package/lib/adapter/tsgitErrorMap.js +55 -16
- package/lib/adapter/tsgitErrorMap.js.map +1 -1
- package/lib/constant/metadataConstants.d.ts +9 -1
- package/lib/constant/metadataConstants.js +17 -3
- package/lib/constant/metadataConstants.js.map +1 -1
- package/lib/main.js +66 -63
- package/lib/main.js.map +1 -1
- package/lib/metadata/MetadataRepositoryImpl.d.ts +14 -2
- package/lib/metadata/MetadataRepositoryImpl.js +192 -50
- package/lib/metadata/MetadataRepositoryImpl.js.map +1 -1
- package/lib/post-processor/includeProcessor.js +8 -9
- package/lib/post-processor/includeProcessor.js.map +1 -1
- package/lib/service/botHandler.js +1 -1
- package/lib/service/botHandler.js.map +1 -1
- package/lib/service/inBundleHandler.js +10 -23
- package/lib/service/inBundleHandler.js.map +1 -1
- package/lib/service/inFolderHandler.js +1 -2
- package/lib/service/inFolderHandler.js.map +1 -1
- package/lib/service/objectTranslationHandler.d.ts +0 -1
- package/lib/service/objectTranslationHandler.js +11 -4
- package/lib/service/objectTranslationHandler.js.map +1 -1
- package/lib/types/runContext.d.ts +16 -5
- package/lib/types/runContext.js +17 -5
- package/lib/types/runContext.js.map +1 -1
- package/lib/utils/__mocks__/LoggingService.d.ts +2 -7
- package/lib/utils/__mocks__/LoggingService.js.map +1 -1
- package/lib/utils/changeSet.d.ts +1 -0
- package/lib/utils/changeSet.js +26 -1
- package/lib/utils/changeSet.js.map +1 -1
- package/lib/utils/configValidator.d.ts +14 -1
- package/lib/utils/configValidator.js +144 -72
- package/lib/utils/configValidator.js.map +1 -1
- package/lib/utils/errorUtils.d.ts +8 -0
- package/lib/utils/errorUtils.js +14 -0
- package/lib/utils/errorUtils.js.map +1 -1
- package/lib/utils/messageSanitizer.d.ts +1 -0
- package/lib/utils/messageSanitizer.js +46 -0
- package/lib/utils/messageSanitizer.js.map +1 -1
- package/lib/utils/metadataDiff/xmlEventReader.js +1 -1
- package/lib/utils/metadataDiff/xmlEventReader.js.map +1 -1
- package/lib/utils/repoGitDiff.d.ts +17 -2
- package/lib/utils/repoGitDiff.js +93 -12
- package/lib/utils/repoGitDiff.js.map +1 -1
- package/lib/utils/treeIndexScope.js +5 -14
- package/lib/utils/treeIndexScope.js.map +1 -1
- package/lib/utils/treeReaderBuilder.d.ts +8 -0
- package/lib/utils/treeReaderBuilder.js +34 -0
- package/lib/utils/treeReaderBuilder.js.map +1 -0
- package/lib/utils/txmlAdapter.js +1 -1
- package/lib/utils/txmlAdapter.js.map +1 -1
- package/messages/delta.md +16 -5
- package/oclif.manifest.json +1 -1
- package/package.json +105 -49
|
@@ -26,6 +26,52 @@ const escapeControlChar = (char) => {
|
|
|
26
26
|
const codePoint = char.codePointAt(0);
|
|
27
27
|
return `\\u{${codePoint.toString(16)}}`;
|
|
28
28
|
};
|
|
29
|
+
// Some network errors echo the offending proxy verbatim, credentials included:
|
|
30
|
+
// proxy-agent's "Unsupported protocol for proxy URL: <url>" carries a URL's
|
|
31
|
+
// user:password userinfo, and pac-proxy-agent's "Failed to establish a socket
|
|
32
|
+
// connection to proxies: [...]" lists a PAC resolver's entries as written.
|
|
33
|
+
// Redact both before the value reaches a message; both patterns stay linear
|
|
34
|
+
// because they run on network-supplied text before any length cap.
|
|
35
|
+
//
|
|
36
|
+
// The URL userinfo match runs up to the last '@' before an authority terminator
|
|
37
|
+
// ('/', '?', '#') and deliberately crosses whitespace, because a URL parser
|
|
38
|
+
// accepts a password with a space in it; over-redacting a later '@' fails safe.
|
|
39
|
+
// The scheme is capped at 32 characters: an uncapped scheme backtracks
|
|
40
|
+
// quadratically on a long letter run.
|
|
41
|
+
const URL_USERINFO_REGEX = /([a-z][a-z\d+.-]{0,31}:\/{2,})[^/?#]*@/gi;
|
|
42
|
+
// A PAC entry has no scheme to anchor on, so its keyword anchors instead,
|
|
43
|
+
// matched case-insensitively because a mis-cased or unsupported entry (such as
|
|
44
|
+
// SOCKS5H) is rejected yet still echoed. pac-proxy-agent splits an entry on any
|
|
45
|
+
// whitespace but echoes the list through JSON.stringify, so the separator
|
|
46
|
+
// arrives either as whitespace or as a JSON escape (\t, \n, \r, \f, \u000b).
|
|
47
|
+
// The separator is consumed atomically (lookahead then backreference) so the
|
|
48
|
+
// engine can never hand it back to the userinfo run. That run stops at
|
|
49
|
+
// whitespace, at a closing quote and at an escaped separator, and reads any
|
|
50
|
+
// other backslash pair (such as an escaped quote in a password) as one
|
|
51
|
+
// character: a match stays inside its own entry, which keeps every other
|
|
52
|
+
// entry's host visible and the scan linear over a long echoed list. Ordinary
|
|
53
|
+
// text shaped like a keyword followed by "<word>@" is over-redacted, which
|
|
54
|
+
// fails safe.
|
|
55
|
+
const PAC_ENTRY_USERINFO_REGEX = /\b((?:PROXY|HTTPS?|SOCKS(?:4A?|5H?)?)(?=((?:\s|\\[tnrf]|\\u000b)+))\2)(?:[^\s"\\]|\\(?![tnrf]|u000b)\S)*@/gi;
|
|
56
|
+
// Still not covered, and why each stays open. A raw '/', '?' or '#' inside a
|
|
57
|
+
// password is echoed only under a scheme proxy-agent rejects, with nothing but
|
|
58
|
+
// digits before the delimiter; closing it would redact URL paths. A special
|
|
59
|
+
// scheme written with fewer than two slashes ("ftp:user:pass@host") reaches a
|
|
60
|
+
// message only when the value also carries a later "://", because
|
|
61
|
+
// proxy-from-env prefixes a scheme to any value without one; closing it would
|
|
62
|
+
// mean matching any "word:" followed by an '@' in ordinary message text.
|
|
63
|
+
// Entries that never parse as a working proxy are echoed yet may stay
|
|
64
|
+
// unredacted: a literal backslash escape used as the separator
|
|
65
|
+
// ("PROXY\\tuser:pass@host"), a password containing whitespace (the target
|
|
66
|
+
// then has no '@'), or a non-whitespace character before the keyword or as the
|
|
67
|
+
// separator. Letting the userinfo run cross escaped separators would cover a
|
|
68
|
+
// tab, newline, carriage return, form feed or vertical tab inside a password
|
|
69
|
+
// (a space arrives raw and stays uncovered either way), but it backtracks
|
|
70
|
+
// quadratically.
|
|
71
|
+
const REDACTED_USERINFO = '<redacted>';
|
|
72
|
+
export const redactProxyCredentials = (value) => value
|
|
73
|
+
.replace(URL_USERINFO_REGEX, `$1${REDACTED_USERINFO}@`)
|
|
74
|
+
.replace(PAC_ENTRY_USERINFO_REGEX, `$1${REDACTED_USERINFO}@`);
|
|
29
75
|
export const sanitizeForMessage = (value) => {
|
|
30
76
|
// Truncate on code points (not UTF-16 code units) before escaping: a
|
|
31
77
|
// surrogate pair must never be split, and escaping only the already-
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageSanitizer.js","sourceRoot":"","sources":["../../src/utils/messageSanitizer.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,4EAA4E;AAC5E,0EAA0E;AAC1E,4EAA4E;AAC5E,uEAAuE;AACvE,uEAAuE;AACvE,uEAAuE;AACvE,yEAAyE;AACzE,qEAAqE;AACrE,2EAA2E;AAC3E,WAAW;AACX,MAAM,mBAAmB,GAAG,8BAA8B,CAAA;AAC1D,MAAM,eAAe,GAAG,KAAK,CAAA;AAC7B,MAAM,wBAAwB,GAAG,GAAG,CAAA;AACpC,MAAM,iBAAiB,GAAG,GAAG,CAAA;AAE7B,oEAAoE;AACpE,wEAAwE;AACxE,wEAAwE;AACxE,2EAA2E;AAC3E,yEAAyE;AACzE,yEAAyE;AACzE,6DAA6D;AAC7D,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAU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AkB,EAAE,KAAK,iBAAiB,GAAG,CAAC;KACtD,OAAO,CAAC,wBAAwB,EAAE,KAAK,iBAAiB,GAAG,CAAC,CAAA;AAEjE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAU,EAAE;IAC1D,qEAAqE;IACrE,qEAAqE;IACrE,yEAAyE;IACzE,kEAAkE;IAClE,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACpC,MAAM,WAAW,GAAG,UAAU,CAAC,MAAM,GAAG,wBAAwB,CAAA;IAChE,MAAM,MAAM,GAAG,WAAW;QACxB,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,wBAAwB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QACxD,CAAC,CAAC,KAAK,CAAA;IACT,wEAAwE;IACxE,oEAAoE;IACpE,kEAAkE;IAClE,6CAA6C;IAC7C,MAAM,OAAO,GAAG,MAAM;SACnB,OAAO,CAAC,eAAe,EAAE,MAAM,CAAC;SAChC,OAAO,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAA;IAClD,OAAO,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,iBAAiB,EAAE,CAAC,CAAC,CAAC,OAAO,CAAA;AACjE,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
import { parse as txmlParse } from 'txml';
|
|
2
|
+
import { parse as txmlParse } from 'txml/txml';
|
|
3
3
|
import { getErrorMessage } from '../errorUtils.js';
|
|
4
4
|
import { Logger, lazy } from '../LoggingService.js';
|
|
5
5
|
import { tNodeToXmlContent, } from '../txmlAdapter.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xmlEventReader.js","sourceRoot":"","sources":["../../../src/utils/metadataDiff/xmlEventReader.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE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AC,CAAA;IACzD,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
|
|
@@ -1,31 +1,46 @@
|
|
|
1
1
|
import GitAdapter from '../adapter/GitAdapter.js';
|
|
2
2
|
import { MetadataRepository } from '../metadata/MetadataRepository.js';
|
|
3
3
|
import type { Config } from '../types/config.js';
|
|
4
|
+
import { type IgnoreHelper } from './ignoreHelper.js';
|
|
4
5
|
export type RenamePathPair = Readonly<{
|
|
5
6
|
fromPath: string;
|
|
6
7
|
toPath: string;
|
|
7
8
|
}>;
|
|
9
|
+
export type HeldAdditionProbeFailure = Readonly<{
|
|
10
|
+
candidateCount: number;
|
|
11
|
+
}>;
|
|
12
|
+
type DeferredDeletion = Readonly<{
|
|
13
|
+
line: string;
|
|
14
|
+
name: string;
|
|
15
|
+
}>;
|
|
8
16
|
export default class RepoGitDiff {
|
|
9
17
|
protected readonly config: Config;
|
|
10
18
|
protected readonly metadata: MetadataRepository;
|
|
11
19
|
protected readonly gitAdapter: GitAdapter;
|
|
12
20
|
private renamePairs;
|
|
13
21
|
private readonly diffScopeVerdict;
|
|
22
|
+
private probeFailure;
|
|
14
23
|
constructor(config: Config, metadata: MetadataRepository);
|
|
15
24
|
/**
|
|
16
25
|
* Streams the filtered, rename-expanded diff lines. Yields A/M lines as
|
|
17
26
|
* they arrive from git so handlers can start working immediately; D
|
|
18
27
|
* lines are buffered until upstream EOF because the deleted-renamed
|
|
19
|
-
* cancellation rule needs the full A-name set
|
|
20
|
-
*
|
|
28
|
+
* cancellation rule needs the full A-name set — including ignored
|
|
29
|
+
* additions, which are held and resolved against the `to` tree at EOF —
|
|
30
|
+
* before any D line can be classified.
|
|
21
31
|
*
|
|
22
32
|
* Rename pairs are captured along the way and exposed via
|
|
23
33
|
* getRenamePairs() once iteration completes.
|
|
24
34
|
*/
|
|
25
35
|
getLines(): AsyncGenerator<string>;
|
|
26
36
|
getRenamePairs(): readonly RenamePathPair[];
|
|
37
|
+
getHeldAdditionProbeFailure(): HeldAdditionProbeFailure | undefined;
|
|
27
38
|
getUnmatchedSourceScopes(): readonly string[];
|
|
28
39
|
protected _expandRename(line: string): Iterable<string>;
|
|
29
40
|
protected _extractComparisonName(line: string): string;
|
|
41
|
+
protected _vouchingHeldNames(held: ReadonlySet<string>, deferred: readonly DeferredDeletion[], registered: ReadonlySet<string>, ignoreHelper: IgnoreHelper): Promise<ReadonlySet<string>>;
|
|
42
|
+
protected _visibleNamesAtTo(candidates: ReadonlySet<string>, ignoreHelper: IgnoreHelper): Promise<ReadonlySet<string>>;
|
|
43
|
+
protected _listFilesAt(revision: string): Promise<readonly string[] | undefined>;
|
|
30
44
|
private diffSpec;
|
|
31
45
|
}
|
|
46
|
+
export {};
|
package/lib/utils/repoGitDiff.js
CHANGED
|
@@ -3,6 +3,7 @@ import GitAdapter from '../adapter/GitAdapter.js';
|
|
|
3
3
|
import { TAB } from '../constant/cliConstants.js';
|
|
4
4
|
import { ADDITION, DELETION, RENAMED } from '../constant/gitConstants.js';
|
|
5
5
|
import { buildIgnoreHelper } from './ignoreHelper.js';
|
|
6
|
+
import { Logger, lazy } from './LoggingService.js';
|
|
6
7
|
export default class RepoGitDiff {
|
|
7
8
|
config;
|
|
8
9
|
metadata;
|
|
@@ -17,6 +18,12 @@ export default class RepoGitDiff {
|
|
|
17
18
|
changesSeen: 0,
|
|
18
19
|
linesYielded: 0,
|
|
19
20
|
};
|
|
21
|
+
// Set when the `to` listing could not be read while held additions were
|
|
22
|
+
// still pending, so the run can tell the user its move detection was
|
|
23
|
+
// degraded instead of silently falling back to the uncancelled output.
|
|
24
|
+
// Reset per getLines() call, like the verdict above, and read after the
|
|
25
|
+
// diff is drained.
|
|
26
|
+
probeFailure;
|
|
20
27
|
constructor(config, metadata) {
|
|
21
28
|
this.config = config;
|
|
22
29
|
this.metadata = metadata;
|
|
@@ -26,8 +33,9 @@ export default class RepoGitDiff {
|
|
|
26
33
|
* Streams the filtered, rename-expanded diff lines. Yields A/M lines as
|
|
27
34
|
* they arrive from git so handlers can start working immediately; D
|
|
28
35
|
* lines are buffered until upstream EOF because the deleted-renamed
|
|
29
|
-
* cancellation rule needs the full A-name set
|
|
30
|
-
*
|
|
36
|
+
* cancellation rule needs the full A-name set — including ignored
|
|
37
|
+
* additions, which are held and resolved against the `to` tree at EOF —
|
|
38
|
+
* before any D line can be classified.
|
|
31
39
|
*
|
|
32
40
|
* Rename pairs are captured along the way and exposed via
|
|
33
41
|
* getRenamePairs() once iteration completes.
|
|
@@ -36,8 +44,10 @@ export default class RepoGitDiff {
|
|
|
36
44
|
this.renamePairs = [];
|
|
37
45
|
this.diffScopeVerdict.changesSeen = 0;
|
|
38
46
|
this.diffScopeVerdict.linesYielded = 0;
|
|
47
|
+
this.probeFailure = undefined;
|
|
39
48
|
const ignoreHelper = await buildIgnoreHelper(this.config);
|
|
40
49
|
const additionNames = new Set();
|
|
50
|
+
const heldAdditionNames = new Set();
|
|
41
51
|
const deferredDeletions = [];
|
|
42
52
|
for await (const rawLine of this.gitAdapter.streamDiffLines({
|
|
43
53
|
spec: this.diffSpec(),
|
|
@@ -52,33 +62,55 @@ export default class RepoGitDiff {
|
|
|
52
62
|
/* v8 ignore next -- defensive: upstream RepoGitDiff already filters non-metadata paths via _expandRename, but kept as safety net */
|
|
53
63
|
if (!this.metadata.has(expanded))
|
|
54
64
|
continue;
|
|
55
|
-
|
|
56
|
-
continue;
|
|
57
|
-
// Stryker disable ConditionalExpression -- equivalent: else-if for DELETION; flipping to true treats any non-ADDITION as a deferred deletion, but only A/M/D lines reach this branch (renames are decomposed by _expandRename), so M lines hit the else (yield directly)
|
|
65
|
+
const kept = ignoreHelper.keep(expanded);
|
|
58
66
|
if (expanded.startsWith(ADDITION)) {
|
|
59
|
-
|
|
67
|
+
const name = this._extractComparisonName(expanded);
|
|
68
|
+
// An ignored addition is held rather than dropped: it may be the
|
|
69
|
+
// destination of a move into the ignore set, which can only be
|
|
70
|
+
// told from a stale copy once the whole diff has been seen.
|
|
71
|
+
if (!kept) {
|
|
72
|
+
heldAdditionNames.add(name);
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
additionNames.add(name);
|
|
60
76
|
yield expanded;
|
|
61
77
|
}
|
|
78
|
+
else if (!kept) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
62
81
|
else if (expanded.startsWith(DELETION)) {
|
|
63
82
|
// Defer: the D line might cancel against an A line we haven't
|
|
64
83
|
// seen yet (rename-collapse case).
|
|
65
|
-
deferredDeletions.push(
|
|
84
|
+
deferredDeletions.push({
|
|
85
|
+
line: expanded,
|
|
86
|
+
name: this._extractComparisonName(expanded),
|
|
87
|
+
});
|
|
66
88
|
}
|
|
67
89
|
else {
|
|
68
90
|
yield expanded;
|
|
69
91
|
}
|
|
70
|
-
// Stryker restore ConditionalExpression
|
|
71
92
|
}
|
|
72
93
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
94
|
+
const vouching = await this._vouchingHeldNames(heldAdditionNames, deferredDeletions, additionNames, ignoreHelper);
|
|
95
|
+
if (vouching.size > 0) {
|
|
96
|
+
// A cancelled deletion appears in neither manifest, so without this
|
|
97
|
+
// line a debug run cannot explain why a destructive entry is missing.
|
|
98
|
+
Logger.debug(lazy `getLines: held addition(s) '${[...vouching].join("', '")}' survive only under ignored paths at '${this.config.to}', cancelling their deletions`);
|
|
99
|
+
}
|
|
100
|
+
for (const name of vouching)
|
|
101
|
+
additionNames.add(name);
|
|
102
|
+
for (const { line, name } of deferredDeletions) {
|
|
103
|
+
if (!additionNames.has(name))
|
|
104
|
+
yield line;
|
|
77
105
|
}
|
|
78
106
|
}
|
|
79
107
|
getRenamePairs() {
|
|
80
108
|
return this.renamePairs;
|
|
81
109
|
}
|
|
110
|
+
// Meaningful only once the diff is drained, like getUnmatchedSourceScopes().
|
|
111
|
+
getHeldAdditionProbeFailure() {
|
|
112
|
+
return this.probeFailure;
|
|
113
|
+
}
|
|
82
114
|
getUnmatchedSourceScopes() {
|
|
83
115
|
return this.gitAdapter.getUnmatchedSourceScopes(this.diffScopeVerdict, this.config.source);
|
|
84
116
|
}
|
|
@@ -106,6 +138,55 @@ export default class RepoGitDiff {
|
|
|
106
138
|
_extractComparisonName(line) {
|
|
107
139
|
return this.metadata.getFullyQualifiedName(line).toLocaleLowerCase();
|
|
108
140
|
}
|
|
141
|
+
// A held name vouches for its component only when nothing of that
|
|
142
|
+
// component is visible at `to`: a component still alive under an
|
|
143
|
+
// unignored path keeps its deletions, because the ignored copy is then a
|
|
144
|
+
// stale duplicate rather than a move into the ignore set.
|
|
145
|
+
async _vouchingHeldNames(held, deferred, registered, ignoreHelper) {
|
|
146
|
+
// A name a kept addition already registered is cancelled whatever the
|
|
147
|
+
// tree says, so excluding it keeps the read to the names whose answer
|
|
148
|
+
// can still change an outcome.
|
|
149
|
+
const candidates = new Set(deferred
|
|
150
|
+
.map(({ name }) => name)
|
|
151
|
+
.filter(name => held.has(name) && !registered.has(name)));
|
|
152
|
+
if (candidates.size === 0)
|
|
153
|
+
return candidates;
|
|
154
|
+
const visible = await this._visibleNamesAtTo(candidates, ignoreHelper);
|
|
155
|
+
return new Set([...candidates].filter(name => !visible.has(name)));
|
|
156
|
+
}
|
|
157
|
+
// Visibility is decided by the global ignore, never the destructive one:
|
|
158
|
+
// the question is whether sgd would still treat a file of the component
|
|
159
|
+
// as live source, which is the A/M routing.
|
|
160
|
+
async _visibleNamesAtTo(candidates, ignoreHelper) {
|
|
161
|
+
const listing = await this._listFilesAt(this.config.to);
|
|
162
|
+
if (!listing) {
|
|
163
|
+
// Fail closed: a tree that cannot be read lets nothing vouch, so a
|
|
164
|
+
// read failure keeps the uncancelled output rather than silently
|
|
165
|
+
// suppressing a real deletion. Recorded so the run can warn — a
|
|
166
|
+
// degraded result the user never sees is the failure worth avoiding.
|
|
167
|
+
this.probeFailure = { candidateCount: candidates.size };
|
|
168
|
+
Logger.debug(lazy `_visibleNamesAtTo: '${this.config.to}' could not be listed, ${candidates.size} candidate component(s) cannot vouch`);
|
|
169
|
+
return candidates;
|
|
170
|
+
}
|
|
171
|
+
const visible = new Set();
|
|
172
|
+
for (const path of listing) {
|
|
173
|
+
const line = `${ADDITION}${TAB}${path}`;
|
|
174
|
+
if (!this.metadata.has(line))
|
|
175
|
+
continue;
|
|
176
|
+
const name = this._extractComparisonName(line);
|
|
177
|
+
if (candidates.has(name) && ignoreHelper.keep(line))
|
|
178
|
+
visible.add(name);
|
|
179
|
+
}
|
|
180
|
+
return visible;
|
|
181
|
+
}
|
|
182
|
+
// The one seam that touches git. `undefined` is buildTreeIndex's own
|
|
183
|
+
// failure signal and passes through untouched. Protected so a benchmark
|
|
184
|
+
// can drive the visibility pass over a synthetic listing without a
|
|
185
|
+
// repository, the way the cancellation-key bench reaches the key.
|
|
186
|
+
async _listFilesAt(revision) {
|
|
187
|
+
const index = await this.gitAdapter.buildTreeIndex(revision, this.config.source);
|
|
188
|
+
return index?.getFilesPath(this.config.source);
|
|
189
|
+
}
|
|
109
190
|
// Built fresh on every getLines() call (not cached at construction) so a
|
|
110
191
|
// later rewrite of config.from (ConfigValidator resolves SHAs after
|
|
111
192
|
// RepoGitDiff may already exist) is still visible when the diff runs.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repoGitDiff.js","sourceRoot":"","sources":["../../src/utils/repoGitDiff.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,OAAO,UAGN,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,6BAA6B,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAIzE,OAAO,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"repoGitDiff.js","sourceRoot":"","sources":["../../src/utils/repoGitDiff.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ,OAAO,UAGN,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,GAAG,EAAE,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,CAAC,YAAY,CAC1B,QAAgB;QAEhB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,cAAc,CAChD,QAAQ,EACR,IAAI,CAAC,MAAM,CAAC,MAAM,CACnB,CAAA;QACD,OAAO,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAChD,CAAC;IAED,yEAAyE;IACzE,oEAAoE;IACpE,sEAAsE;IAC9D,QAAQ;QACd,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;YACtB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE;YAClB,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;YACnD,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,gBAAgB;SAC/C,CAAA;IACH,CAAC;CACF"}
|
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
import { PATH_SEP } from '../constant/fsConstants.js';
|
|
3
3
|
import { GIT_DIFF_TYPE_REGEX } from '../constant/gitConstants.js';
|
|
4
4
|
import { CONTENT_CONTAINER_ADAPTERS } from '../constant/metadataConstants.js';
|
|
5
|
-
// Bundle-style adapters get a deeper scope slice in scopeForType than the
|
|
6
|
-
// flat mixedContent containers, so this stays distinct from the broader
|
|
7
|
-
// CONTENT_CONTAINER_ADAPTERS membership used by needsTreeIndex.
|
|
8
|
-
const BUNDLE_ADAPTERS = new Set(['bundle', 'digitalExperience']);
|
|
9
5
|
const TREE_INDEX_XML_NAMES = new Set([
|
|
10
6
|
'CustomObject',
|
|
11
7
|
'Dashboard',
|
|
@@ -35,20 +31,15 @@ const buildParentIndex = (metadata) => {
|
|
|
35
31
|
}
|
|
36
32
|
return index;
|
|
37
33
|
};
|
|
34
|
+
// Every tree-index-needing type scopes to its type directory, regardless of
|
|
35
|
+
// adapter: a bundle's liveness check (pathExists on its component directory)
|
|
36
|
+
// answers identically whether the index was built from just that component
|
|
37
|
+
// or from the whole type directory, so there is no need to slice deeper for
|
|
38
|
+
// bundle-style adapters.
|
|
38
39
|
const scopeForType = (parts, type) => {
|
|
39
40
|
const dirIndex = parts.indexOf(type.directoryName);
|
|
40
|
-
// Stryker disable next-line ConditionalExpression -- equivalent: dir-not-found guard; flipping to false continues with dirIndex=-1 and slice(0, 0) returns an empty string that the caller's scope set absorbs as a useless entry not asserted on
|
|
41
41
|
if (dirIndex < 0)
|
|
42
42
|
return null;
|
|
43
|
-
if (type.adapter && BUNDLE_ADAPTERS.has(type.adapter)) {
|
|
44
|
-
// Stryker disable next-line ConditionalExpression,EqualityOperator,ArithmeticOperator -- equivalent: bundle-vs-non-bundle slice gate; for bundles the scope expands by one segment if the path has another segment, otherwise stays at dirIndex+1; the mutants flip the boundary by one position which still produces a valid scope path that the test surface accepts as either the parent dir or the bundle dir — both are observed as the same set membership in scope
|
|
45
|
-
if (dirIndex + 1 < parts.length) {
|
|
46
|
-
return parts.slice(0, dirIndex + 2).join(PATH_SEP);
|
|
47
|
-
}
|
|
48
|
-
// Stryker disable next-line MethodExpression -- equivalent: this branch fires only when `dirIndex + 1 >= parts.length`, i.e. parts ends at the type directory; in that case `parts.slice(0, dirIndex + 1)` is reference-distinct but value-identical to `parts`, so the join produces the same string
|
|
49
|
-
return parts.slice(0, dirIndex + 1).join(PATH_SEP);
|
|
50
|
-
}
|
|
51
|
-
// Stryker disable next-line MethodExpression -- equivalent: parts.slice(0, dirIndex + 1).join(PATH_SEP) computes the scope path; mutating slice to return parts wholesale would yield the full path joined, but the consuming Set absorbs both forms and tests assert on the directory-prefix membership which both forms satisfy
|
|
52
43
|
return parts.slice(0, dirIndex + 1).join(PATH_SEP);
|
|
53
44
|
};
|
|
54
45
|
export const computeTreeIndexScope = (lines, metadata) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"treeIndexScope.js","sourceRoot":"","sources":["../../src/utils/treeIndexScope.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AACZ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AM,EAAE,CAAC;oBACX,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;gBACnB,CAAC;YACH,CAAC;YACD,SAAQ;QACV,CAAC;QAED,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC;YAAE,SAAQ;QAEnC,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QACxC,IAAI,MAAM,EAAE,CAAC;YACX,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type GitAdapter from '../adapter/GitAdapter.js';
|
|
2
|
+
import { type TreeReader } from '../adapter/treeReader.js';
|
|
3
|
+
import type { Config } from '../types/config.js';
|
|
4
|
+
export type TreeReaderBuildResult = Readonly<{
|
|
5
|
+
trees: TreeReader;
|
|
6
|
+
unindexed: readonly string[];
|
|
7
|
+
}>;
|
|
8
|
+
export declare const buildRunTreeReader: (gitAdapter: Pick<GitAdapter, 'buildTreeIndex'>, config: Pick<Config, 'to' | 'from'>, scopePaths: readonly string[]) => Promise<TreeReaderBuildResult>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
import { createTreeReader, EMPTY_TREE_READER, } from '../adapter/treeReader.js';
|
|
3
|
+
// One TreeIndex per revision, built once per run under the run's own scope
|
|
4
|
+
// and threaded to every reader through RunContext rather than cached on
|
|
5
|
+
// GitAdapter: a reader can never see a different scope than the one this
|
|
6
|
+
// build ran under (a shared, scope-keyed cache — the design this replaced —
|
|
7
|
+
// is an implicit contract that drifts). An empty scope means the run
|
|
8
|
+
// touches nothing index-backed, so no tree is walked at all — nothing was
|
|
9
|
+
// attempted, so nothing is reported unindexed.
|
|
10
|
+
export const buildRunTreeReader = async (gitAdapter, config, scopePaths) => {
|
|
11
|
+
if (scopePaths.length === 0) {
|
|
12
|
+
return { trees: EMPTY_TREE_READER, unindexed: [] };
|
|
13
|
+
}
|
|
14
|
+
const [toIndex, fromIndex] = await Promise.all([
|
|
15
|
+
gitAdapter.buildTreeIndex(config.to, scopePaths),
|
|
16
|
+
gitAdapter.buildTreeIndex(config.from, scopePaths),
|
|
17
|
+
]);
|
|
18
|
+
const entries = new Map();
|
|
19
|
+
const unindexed = [];
|
|
20
|
+
if (toIndex) {
|
|
21
|
+
entries.set(config.to, toIndex);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
unindexed.push(config.to);
|
|
25
|
+
}
|
|
26
|
+
if (fromIndex) {
|
|
27
|
+
entries.set(config.from, fromIndex);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
unindexed.push(config.from);
|
|
31
|
+
}
|
|
32
|
+
return { trees: createTreeReader(entries), unindexed };
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=treeReaderBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"treeReaderBuilder.js","sourceRoot":"","sources":["../../src/utils/treeReaderBuilder.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAGZ,OAAO,EACL,gBAAgB,EAChB,iBAAiB,GAElB,MAAM,0BAA0B,CAAA;AAajC,2EAA2E;AAC3E,wEAAwE;AACxE,yEAAyE;AACzE,4EAA4E;AAC5E,qEAAqE;AACrE,0EAA0E;AAC1E,+CAA+C;AAC/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EACrC,UAA8C,EAC9C,MAAmC,EACnC,UAA6B,EACG,EAAE;IAClC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,EAAE,EAAE,CAAA;IACpD,CAAC;IACD,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC7C,UAAU,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,EAAE,UAAU,CAAC;QAChD,UAAU,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC;KACnD,CAAC,CAAA;IACF,MAAM,OAAO,GAAG,IAAI,GAAG,EAAqB,CAAA;IAC5C,MAAM,SAAS,GAAa,EAAE,CAAA;IAC9B,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,CAAA;IACjC,CAAC;SAAM,CAAC;QACN,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IAC3B,CAAC;IACD,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;IACrC,CAAC;SAAM,CAAC;QACN,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC7B,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAA;AACxD,CAAC,CAAA"}
|
package/lib/utils/txmlAdapter.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
import { parse as txmlParse } from 'txml';
|
|
2
|
+
import { parse as txmlParse } from 'txml/txml';
|
|
3
3
|
import { ATTRIBUTE_PREFIX, XML_HEADER_ATTRIBUTE_KEY, } from './xmlHelper.js';
|
|
4
4
|
// Stryker disable next-line StringLiteral -- equivalent: '#comment' is the internal sentinel key for comment children; mutating to "" produces an empty key that addComment still uses consistently and the test surface only checks for the presence of the comment via the same constant
|
|
5
5
|
const COMMENT_KEY = '#comment';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"txmlAdapter.js","sourceRoot":"","sources":["../../src/utils/txmlAdapter.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,KAAK,IAAI,SAAS,EA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Q,GAAG,CAAC,UAAkB,EAAc,EAAE;IACzD,kMAAkM;IAClM,IAAI,CAAC,UAAU;QAAE,OAAO,EAAE,CAAA;IAC1B,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,SAAS,CAAC,UAAU,EAAE;YACjC,YAAY,EAAE,IAAI;SACnB,CAAgB,CAAA;QACjB,MAAM,GAAG,GAAe,EAAE,CAAA;QAC1B,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;YACzB,IAAI,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;gBACrB,UAAU,CAAC,GAAG,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAA;gBACpC,SAAQ;YACV,CAAC;YACD,mSAAmS;YACnS,IAAI,OAAO,KAAK,KAAK,QAAQ;gBAAE,SAAQ,CAAC,uBAAuB;YAC/D,2TAA2T;YAC3T,IAAI,KAAK,CAAC,OAAO,KAAK,wBAAwB,EAAE,CAAC;gBAC/C,GAAG,CAAC,wBAAwB,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;gBAClE,SAAQ;YACV,CAAC;YACD,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAA;QACxD,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC,CAAA"}
|
package/messages/delta.md
CHANGED
|
@@ -94,6 +94,10 @@ path to a JSON file grouping changed components by kind (add, modify, delete, re
|
|
|
94
94
|
|
|
95
95
|
--%s is not a valid sha pointer: '%s' (If in CI/CD context, check the fetch depth is properly set)
|
|
96
96
|
|
|
97
|
+
# error.ParameterIsNotCommit
|
|
98
|
+
|
|
99
|
+
--%s must resolve to a commit: '%s' resolves to a %s. Use a commit sha, a branch, or a tag that points to a commit
|
|
100
|
+
|
|
97
101
|
# error.MergeBaseNotFound
|
|
98
102
|
|
|
99
103
|
no merge base found between --from '%s' and --to '%s' (If in CI/CD context, check the fetch depth is properly set)
|
|
@@ -130,10 +134,6 @@ no merge base found between --from '%s' and --to '%s' (If in CI/CD context, chec
|
|
|
130
134
|
|
|
131
135
|
--source-dir does not accept git pathspec magic (e.g. ':(exclude)', ':!'); use a literal repository-relative path instead (received: '%s')
|
|
132
136
|
|
|
133
|
-
# warning.ApiVersionOverridden
|
|
134
|
-
|
|
135
|
-
API version '%s' is not supported, using '%s' instead
|
|
136
|
-
|
|
137
137
|
# warning.ApiVersionDefaulted
|
|
138
138
|
|
|
139
139
|
No API version found (no --api-version flag, no sourceApiVersion in sfdx-project.json), using '%s'
|
|
@@ -142,6 +142,10 @@ No API version found (no --api-version flag, no sourceApiVersion in sfdx-project
|
|
|
142
142
|
|
|
143
143
|
Unable to resolve the Salesforce API version. Provide one with --api-version, or set "sourceApiVersion" in sfdx-project.json. Caused by: %s
|
|
144
144
|
|
|
145
|
+
# error.ApiVersionLookupUnusable
|
|
146
|
+
|
|
147
|
+
The appexchange org returned '%s', which is not a usable Salesforce API version
|
|
148
|
+
|
|
145
149
|
# warning.MalformedXML
|
|
146
150
|
|
|
147
151
|
could not process '%s', please ensure it is properly formatted xml in both '%s' and '%s' revision
|
|
@@ -174,4 +178,11 @@ Failure
|
|
|
174
178
|
|
|
175
179
|
💡 Enjoying sfdx-git-delta?
|
|
176
180
|
Your contribution helps us provide fast support 🚀 and high quality features 🔥
|
|
177
|
-
Become a sponsor: https://github.com/sponsors/scolladon 💙
|
|
181
|
+
Become a sponsor: https://github.com/sponsors/scolladon 💙
|
|
182
|
+
# warning.IgnoredMoveCheckSkipped
|
|
183
|
+
|
|
184
|
+
Could not read the file list at '%s', so %s component(s) moved into an ignored directory could not be confirmed as moves and are reported as deletions. Check that --to resolves to a readable commit.
|
|
185
|
+
|
|
186
|
+
# warning.TreeIndexUnavailable
|
|
187
|
+
|
|
188
|
+
Could not build the file tree index for '%s', so components that still exist there may be listed in destructiveChanges.xml as deleted. Check that the commit's tree objects are present locally (a partial clone created with --filter may not have them).
|
package/oclif.manifest.json
CHANGED