Skip to content

Commit

Permalink
Catch message lookup error, correct spelling of message title (#916)
Browse files Browse the repository at this point in the history
* fix: catch message lookup error (temp debug log)

* chore(release): 3.2.17-qa.0 [skip ci]

* chore: empty

* chore(release): 3.2.17-qa.1 [skip ci]

* fix: correct message title

---------

Co-authored-by: svc-cli-bot <[email protected]>
  • Loading branch information
iowillhoit and svc-cli-bot authored Feb 28, 2024
1 parent d2846cd commit 3b99e86
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 17 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ USAGE
<value> | -m <value>]
FLAGS
-d, --output-dir=<value> [default: metadataPackage_1708974940174] Output directory to store the Metadata
-d, --output-dir=<value> [default: metadataPackage_1709056694984] Output directory to store the Metadata
API–formatted files in.
-m, --metadata=<value>... Metadata component names to convert.
-n, --package-name=<value> Name of the package to associate with the metadata-formatted files.
Expand Down Expand Up @@ -1534,7 +1534,9 @@ FLAG DESCRIPTIONS
If the target directory matches one of the package directories in your sfdx-project.json file, the command fails.
Running the command multiple times with the same target adds new files and overwrites existing files.
-w, --wait=<value> Number of minutes to wait for the command to complete and display results to the terminal window.
-w, --wait=<value>
Number of minutes to wait for the command to complete and display results to the terminal window.
If the command continues to run after the wait period, the CLI returns control of the terminal window to you.
Expand Down
2 changes: 1 addition & 1 deletion messages/metadata.transfer.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ In Progress

Succeeded

# Cancelled
# Canceled

Canceled

Expand Down
3 changes: 1 addition & 2 deletions src/commands/project/deploy/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/
import * as os from 'node:os';


import chalk from 'chalk';
import { EnvironmentVariable, Lifecycle, Messages, OrgConfigProperties, SfError } from '@salesforce/core';
import { CodeCoverageWarnings, DeployVersionData, RequestStatus } from '@salesforce/source-deploy-retrieve';
Expand All @@ -21,7 +20,7 @@ import { DEPLOY_STATUS_CODES_DESCRIPTIONS } from '../../../utils/errorCodes.js';
import { ConfigVars } from '../../../configMeta.js';
import { coverageFormattersFlag, fileOrDirFlag, testLevelFlag, testsFlag } from '../../../utils/flags.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata.validate');
const deployMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata');

Expand Down
2 changes: 1 addition & 1 deletion src/commands/project/generate/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from '@salesforce/sf-plugins-core';
import { getPackageDirs, getSourceApiVersion } from '../../../utils/project.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'manifest.generate');

const manifestTypes = {
Expand Down
2 changes: 1 addition & 1 deletion src/formatters/metadataRetrieveResultFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Messages } from '@salesforce/core';
import { Formatter, MetadataRetrieveResultJson } from '../utils/types.js';
import { sortFileResponses, asRelativePaths } from '../utils/output.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
export const retrieveMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'retrieve.start');

export class MetadataRetrieveResultFormatter implements Formatter<MetadataRetrieveResultJson> {
Expand Down
2 changes: 1 addition & 1 deletion src/formatters/sourceConvertResultFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ConvertResult } from '@salesforce/source-deploy-retrieve';
import { SfError, Messages } from '@salesforce/core';
import { ConvertResultJson, Formatter } from '../utils/types.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
export const convertMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'convert.source');

export class SourceConvertResultFormatter implements Formatter<ConvertResultJson> {
Expand Down
4 changes: 1 addition & 3 deletions src/utils/errorCodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/



import { Messages } from '@salesforce/core';
import { RequestStatus } from '@salesforce/source-deploy-retrieve';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'errorCodes');

export const DEPLOY_STATUS_CODES = new Map<RequestStatus, number>([
Expand Down
13 changes: 10 additions & 3 deletions src/utils/progressBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/


import { envVars as env, EnvironmentVariable, Lifecycle, Messages } from '@salesforce/core';
import { MetadataApiDeploy, MetadataApiDeployStatus } from '@salesforce/source-deploy-retrieve';
import { Progress } from '@salesforce/sf-plugins-core';
import { SourceMemberPollingEvent } from '@salesforce/source-tracking';
import { ux } from '@oclif/core';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const mdTransferMessages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'metadata.transfer');

const showBar = Boolean(
Expand Down Expand Up @@ -84,7 +84,14 @@ export class DeployProgress extends Progress {
testInfo,
});
} else {
this.update(0, { errorInfo, testInfo, status: mdTransferMessages.getMessage(data.status) ?? 'Waiting' });
let status;
try {
status = mdTransferMessages.getMessage(data.status);
} catch (e) {
ux.debug(`data.status message lookup failed for: ${data.status}`);
status = 'Waiting';
}
this.update(0, { errorInfo, testInfo, status });
}
}
}
4 changes: 1 addition & 3 deletions test/commands/deploy/start.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/



import { expect } from 'chai';
import { MockTestOrgData, TestContext } from '@salesforce/core/lib/testSetup.js';
import { stubSfCommandUx } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';
import DeployMetadata from '../../../src/commands/project/deploy/start.js';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url)
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-deploy-retrieve', 'deploy.metadata');

describe('project deploy start', () => {
Expand Down

0 comments on commit 3b99e86

Please sign in to comment.