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

fix: emit sourceApi message, set it on cs, add UTs #669

Merged
merged 3 commits into from
Jul 14, 2023
Merged

Conversation

WillieRuemmele
Copy link
Contributor

@WillieRuemmele WillieRuemmele commented Jun 22, 2023

What does this PR do?

adds warnings from plugin-source into PDR
adds sourceApiVersion to CS
adds retrieve start UTs 👀

What issues does this PR fix or reference?

forcedotcom/cli#353
@W-13735986@

@@ -350,6 +373,9 @@ const buildRetrieveAndDeleteTargets = async (
} else {
return {
componentSetFromNonDeletes: await ComponentSetBuilder.build({
sourceapiversion: (
Copy link
Contributor

Choose a reason for hiding this comment

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

what happens outside of a project?

expect(retrieveStub.firstCall.args[0]).to.deep.equal(expectedRetrieveArgs);
};

// Ensure Lifecycle hooks are called properly
Copy link
Contributor

Choose a reason for hiding this comment

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

still need these?

const retrieveOpts = await buildRetrieveOptions(flags, format, zipFileName, resolvedTargetDir);

this.spinner.status = messages.getMessage('spinner.sending');

this.retrieveResult = new RetrieveResult({} as MetadataApiRetrieveStatus, componentSetFromNonDeletes);

if (componentSetFromNonDeletes.size !== 0 || retrieveOpts.packageOptions?.length) {
// eslint-disable-next-line @typescript-eslint/require-await
Copy link
Contributor

Choose a reason for hiding this comment

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

you could

return Promise.resolve();
at the bottom of the function instead of doing the eslint comment. 🤷🏻

@mshanemc
Copy link
Contributor

QA notes:

before this change (set sourceApiVersion to 56 via sfdx-project-json)

sf project retrieve start -m CustomObject:Account
Retrieving v58.0 metadata from test-ylpl0osswt1w@example.com using the v58.0 SOAP API

with this change

✅ (in a project, using source)

../bin/dev project retrieve start -m CustomObject:Account
Retrieving v56.0 metadata from test-ylpl0osswt1w@example.com using the v58.0 SOAP API

(top-level, using mdapi)

sf project retrieve start --metadata CustomObject:Account --target-metadata-dir mdapiOut -o na40hub            
Retrieving v58.0 metadata from admin@integrationtesthubna40.org using the v58.0 SOAP API

✅ results are the same for ./bin/dev since it doesn't have project. Importantly, it works without project!

@mshanemc mshanemc merged commit 6e07d1a into main Jul 14, 2023
@mshanemc mshanemc deleted the wr/apiMessage branch July 14, 2023 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants