Skip to content

Commit 9502fa6

Browse files
authored
feat: remove STL compatibility features for old toolbelt tracking files (#803)
1 parent beeaa05 commit 9502fa6

File tree

7 files changed

+2
-40
lines changed

7 files changed

+2
-40
lines changed

src/commands/force/source/deploy.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ export class Deploy extends DeployCommand {
170170
protected async preChecks(): Promise<void> {
171171
if (this.flags.tracksource) {
172172
this.tracking = await trackingSetup({
173-
commandName: 'force:source:deploy',
174173
// we'll check ACTUAL conflicts once we get a componentSet built
175174
ignoreConflicts: true,
176175
org: this.org,

src/commands/force/source/pull.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ export default class Pull extends SourceCommand {
8585
protected async preChecks(): Promise<void> {
8686
this.spinner.start('Loading source tracking information');
8787
this.tracking = await trackingSetup({
88-
commandName: 'force:source:pull',
8988
ignoreConflicts: this.flags.forceoverwrite ?? false,
9089
org: this.flags['target-org'],
9190
project: this.project,

src/commands/force/source/push.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ export default class Push extends DeployCommand {
8484

8585
protected async prechecks(): Promise<void> {
8686
this.tracking = await trackingSetup({
87-
commandName: 'force:source:push',
8887
ignoreConflicts: this.flags.forceoverwrite ?? false,
8988
org: this.flags['target-org'],
9089
project: this.project,

src/commands/force/source/retrieve.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ export class Retrieve extends SourceCommand {
148148
org: this.flags['target-org'],
149149
project: this.project,
150150
ignoreConflicts: true,
151-
commandName: 'force:source:retrieve',
152151
});
153152
}
154153
}

src/commands/force/source/status.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export default class Status extends SfCommand<StatusCommandResult> {
5959
public async run(): Promise<StatusCommandResult> {
6060
this.flags = (await this.parse(Status)).flags;
6161
const tracking = await trackingSetup({
62-
commandName: 'force:source:status',
6362
ignoreConflicts: true,
6463
org: this.flags['target-org'],
6564
project: this.project,

src/sourceCommand.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ import { EnsureFsFlagOptions, FsError, ProgressBar } from './types';
1717
Messages.importMessagesDirectory(__dirname);
1818
const messages = Messages.loadMessages('@salesforce/plugin-source', 'flags.validation');
1919

20-
// TODO: use messages for tracking version compatibility errors
21-
// Messages.importMessagesDirectory(__dirname);
22-
// const messages = Messages.loadMessages('@salesforce/plugin-source', 'retrieve');
23-
2420
export abstract class SourceCommand extends SfCommand<unknown> {
2521
public static readonly DEFAULT_WAIT_MINUTES = 33;
2622

src/trackingFunctions.ts

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@
66
*/
77
import * as path from 'path';
88

9-
import {
10-
ChangeResult,
11-
getTrackingFileVersion,
12-
SourceTracking,
13-
SourceTrackingOptions,
14-
throwIfInvalid,
15-
} from '@salesforce/source-tracking';
9+
import { ChangeResult, SourceTracking, SourceTrackingOptions } from '@salesforce/source-tracking';
1610
import { Messages, SfError } from '@salesforce/core';
1711
import {
1812
ComponentSet,
@@ -28,7 +22,6 @@ const messages = Messages.loadMessages('@salesforce/plugin-source', 'tracking');
2822
interface TrackingSetupRequest extends SourceTrackingOptions {
2923
ignoreConflicts: boolean;
3024
ux: Ux;
31-
commandName: string;
3225
}
3326

3427
interface TrackingUpdateRequest {
@@ -75,29 +68,7 @@ export const filterConflictsByComponentSet = async ({
7568
* @returns SourceTracking
7669
*/
7770
export const trackingSetup = async (options: TrackingSetupRequest): Promise<SourceTracking> => {
78-
const { ux, org, ignoreConflicts, commandName, ...createOptions } = options;
79-
const projectPath = options.project.getPath();
80-
// 3 commands use throwIfInvalid
81-
if (commandName.endsWith('push') || commandName.endsWith('pull') || commandName.endsWith('status')) {
82-
throwIfInvalid({
83-
org,
84-
projectPath,
85-
toValidate: 'plugin-source',
86-
command: commandName,
87-
});
88-
}
89-
// confirm tracking file version is plugin-source for all --tracksource flags (deploy, retrieve, delete)
90-
if (getTrackingFileVersion(org, projectPath) === 'toolbelt') {
91-
throw new SfError(
92-
'You cannot use the "tracksource" flag with the old version of the tracking files',
93-
'sourceTrackingFileVersionMismatch',
94-
[
95-
'Clear the old version of the tracking files with "sfdx force:source:legacy:tracking:clear"',
96-
'Create a new org to use the new tracking files',
97-
]
98-
);
99-
}
100-
71+
const { ux, org, ignoreConflicts, ...createOptions } = options;
10172
const tracking = await SourceTracking.create({ org, ...createOptions });
10273
if (!ignoreConflicts) {
10374
processConflicts(await tracking.getConflicts(), ux, messages.getMessage('conflictMsg'));

0 commit comments

Comments
 (0)