Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: devScripts update #1261

Merged
merged 2 commits into from
Jul 30, 2024
Merged

refactor: devScripts update #1261

merged 2 commits into from
Jul 30, 2024

Conversation

svc-cli-bot
Copy link
Contributor

created via github action [skip-validate-pr]

@@ -100,7 +100,7 @@ export class Retrieve extends SourceCommand {

protected retrieveResult: RetrieveResult | undefined;
private sourceDir: string | undefined;
private retrieveTargetDir: string | undefined;
private retrieveTargetDir!: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moving the setting of this to the top of the run method will justify !

@@ -185,7 +186,7 @@ export class Retrieve extends SourceCommand {
unzip: this.unzip,
});

this.log(`Retrieve ID: ${this.mdapiRetrieve.id}`);
this.log(`Retrieve ID: ${this.mdapiRetrieve.id ?? ''}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

preserves existing behavior (no value present)

@@ -114,7 +114,7 @@ const resultConverter = (input: StatusOutputRow): StatusResult => {
type,
// this string became the place to store information.
// The JSON now breaks out that info but preserves this property for backward compatibility
state: `${origin} ${actualState}${conflict ? ' (Conflict)' : ''}` as StatusStateString,
state: `${origin} ${actualState as string}${conflict ? ' (Conflict)' : ''}` as StatusStateString,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the map is complete, but Map.get() doesn't guarantee presence

@@ -25,7 +25,7 @@ export class DeployCancelResultFormatter extends ResultFormatter {
}

public display(): void {
const deployId = getString(this.result, 'response.id');
const deployId = this.result.response.id;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now that we have types we don't need the goofy get on objects

const deployErrors = componentErrors === 1 ? `${componentErrors} error.` : `${componentErrors} errors.`;
const tests = `${testsCompleted}/${testsTotal} tests completed.`;
const testErrs = testErrors === 1 ? `${testErrors} error.` : `${testErrors} errors.`;
const deploys = `${componentsDeployed ?? 0}/${componentsTotal ?? 0} components deployed.`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zeros seemed right?

@@ -138,7 +138,7 @@ const processConflicts = (conflicts: ChangeResult[], ux: Ux, message: string): v
const conflictMap = new Map<string, ConflictResponse>();
conflicts.forEach((c) => {
c.filenames?.forEach((f) => {
conflictMap.set(`${c.name}#${c.type}#${f}`, {
conflictMap.set(`${c.name ?? ''}#${c.type ?? ''}#${f}`, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also preserve existing behaior

@mshanemc mshanemc merged commit 91a978d into main Jul 30, 2024
29 checks passed
@mshanemc mshanemc deleted the devScripts2024-07-30 branch July 30, 2024 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants