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: upgrade source deploy retrieve library to 2.1.1 #3147

Merged
merged 15 commits into from
Apr 20, 2021

Conversation

sfsholden
Copy link
Contributor

@sfsholden sfsholden commented Apr 13, 2021

What does this PR do?

Upgrades SDR to v2.0.0.

This includes registry changes and code restructuring with breaking API changes (fromSource, fromManifest).

What issues does this PR fix or reference?

#3114, #3157, @W-9102368@

@codecov
Copy link

codecov bot commented Apr 13, 2021

Codecov Report

Merging #3147 (627f965) into release/v51.10.0 (4b0e011) will decrease coverage by 0.01%.
The diff coverage is 81.81%.

Impacted file tree graph

@@                 Coverage Diff                  @@
##           release/v51.10.0    #3147      +/-   ##
====================================================
- Coverage             76.17%   76.15%   -0.02%     
====================================================
  Files                   276      276              
  Lines                 10521    10513       -8     
  Branches               1236     1237       +1     
====================================================
- Hits                   8014     8006       -8     
+ Misses                 2158     2157       -1     
- Partials                349      350       +1     
Impacted Files Coverage Δ
...cedx-vscode-core/src/commands/baseDeployCommand.ts 51.16% <0.00%> (+1.16%) ⬆️
...scode-core/src/commands/util/parameterGatherers.ts 83.07% <50.00%> (ø)
...edx-vscode-core/src/commands/baseDeployRetrieve.ts 90.51% <100.00%> (-1.73%) ⬇️
...ode-core/src/commands/forceSourceDeployManifest.ts 62.50% <100.00%> (ø)
...e-core/src/commands/forceSourceDeploySourcePath.ts 50.00% <100.00%> (-4.72%) ⬇️
...e-core/src/commands/forceSourceRetrieveManifest.ts 59.45% <100.00%> (ø)
...ceSourceRetrieveMetadata/forceSourceRetrieveCmp.ts 69.14% <100.00%> (-0.33%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b0e011...627f965. Read the comment docs.

@@ -226,7 +228,7 @@ export class LibraryRetrieveSourcePathExecutor extends RetrieveExecutor<

export async function forceSourceRetrieveCmp(
trigger: RetrieveMetadataTrigger,
openAfterRetrieve: boolean = false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only for trying to debug issues locally - this will be reverted.

include: filter
});
// If no results from local source components, return the filter.
return sourceResult.getSourceComponents().toArray().length === 0 ? filter : sourceResult;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is important in the event that the source is not local. We would still want to make sure we have the results from the filter before continuing.

Copy link
Contributor

@brpowell brpowell Apr 15, 2021

Choose a reason for hiding this comment

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

Good catch. A nice API for this would be something like the following in the library:

ComponentSet.fromMembers({
  members: [
    { fullName: 'MyClass', type: 'ApexClass' },
    { fullName: 'MyClass2', type: 'ApexClass' }
  ],
  resolveSourcePaths: ['/path/to/force-app']
})

So that it always adds the members even if source wasn't found for them. CLI team requested this as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah nice, that seems much more intuitive.

@sfsholden sfsholden force-pushed the sh/sdrUpgrade-2.0.0 branch from c53762c to 31398c4 Compare April 13, 2021 22:30
@sfsholden sfsholden marked this pull request as ready for review April 14, 2021 15:48
@sfsholden sfsholden requested a review from a team as a code owner April 14, 2021 15:48
@sfsholden
Copy link
Contributor Author

Pending the fix of one of the vscode integration tests.

@@ -21,7 +21,7 @@ import {
SourceComponent
} from '@salesforce/source-deploy-retrieve';
import { SourceRetrieveResult } from '@salesforce/source-deploy-retrieve/lib/src/client/types';
import { ComponentLike } from '@salesforce/source-deploy-retrieve/lib/src/common/types';
import { ComponentLike } from '@salesforce/source-deploy-retrieve/lib/src/resolve/types';
Copy link
Contributor

Choose a reason for hiding this comment

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

Not for this PR, but we should expose these types (SourceRetrieveResult, ComponentLike, etc) at the top level of the library so we can import them just using @salesforce/source-deploy-retrieve.

@@ -29,7 +29,7 @@
"@salesforce/salesforcedx-sobjects-faux-generator": "51.9.0",
"@salesforce/salesforcedx-utils-vscode": "51.9.0",
"@salesforce/schemas": "^1",
"@salesforce/source-deploy-retrieve": "1.1.20",
"@salesforce/source-deploy-retrieve": "2.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI, @salesforce/source-deploy-retrieve is also used in the salesforcedx-vscode-apex module.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lcampos I'll add a follow-up story for updating apex. It probably isn't wise to have two different versions in the extensions.

@sfsholden sfsholden changed the title Sh/sdr upgrade 2.0.0 fix: upgrade source deploy retrieve library to 2.0.0 Apr 14, 2021
@lcampos
Copy link
Contributor

lcampos commented Apr 20, 2021

@sfsholden @brpowell I think this PR is ready to merge but it's open against last week's release branch (release/v51.9.0). Are we using last week's release branch this week or will this PR be opened against release/v51.10.0 ?

@sfsholden
Copy link
Contributor Author

@sfsholden @brpowell I think this PR is ready to merge but it's open against last week's release branch (release/v51.9.0). Are we using last week's release branch this week or will this PR be opened against release/v51.10.0 ?

We're thinking we'll use 51.10.0 and just skip 51.9.0 this week. I'll update this base branch once we can create 51.10.0.

@sfsholden sfsholden changed the base branch from release/v51.9.0 to release/v51.10.0 April 20, 2021 22:02
@sfsholden sfsholden merged commit e3ce502 into release/v51.10.0 Apr 20, 2021
@sfsholden sfsholden deleted the sh/sdrUpgrade-2.0.0 branch April 20, 2021 22:55
@sfsholden sfsholden changed the title fix: upgrade source deploy retrieve library to 2.0.0 fix: upgrade source deploy retrieve library to 2.1.1 Apr 21, 2021
lukecotter pushed a commit to lukecotter/salesforcedx-vscode that referenced this pull request May 20, 2021
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.

3 participants