Repository navigation
[Feat] Deploy DataSpace-Scoped Components with their retrieveWith Closure - #1649
WillieRuemmele merged 8 commits into
Conversation
|
Thanks for the contribution! Unfortunately we can't verify the commit author(s): Aparna Goyal <r***@A***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, sign the Salesforce Inc. Contributor License Agreement and this Pull Request will be revalidated. |
|
if the expansion moves into SDR (see forcedotcom/source-deploy-retrieve#1839), I don't think we need this PR. we'd just bump SDR (and |
|
Agreed. Once the expansion moves into SDR (plan in forcedotcom/source-deploy-retrieve#1839), this PR isn't needed and we can just bump SDR and
|
ab9a275 to
867802b
Compare
Follows the SDR change: expandD360ComponentSet now adds the peers to the set it is given, so the deploy keeps its destructive changes, API versions, and wildcard entries.
The org now writes deploysWith in place of retrieveWith. Only comments change.
The deploy set is now built with forDeploy, so the source library adds each Data Cloud component's deploysWith peers while it builds the set. The plugin no longer resolves the whole project to expand the closure on its own.
A D360 component requested as <dataspace>.<name> is stored locally under its bare name, so no local file has the requested name. Preview tried to generate file paths for it and failed with "Type not supported for filepath generation". Preview now lists that request once, under the requested name, with the local file the deploy sends for it, and its peers under their own names. The preview list matches the components the deploy sends.
867802b to
c38e402
Compare
With no flags, deploy preview listed source tracking's local changes as they were. The deploy adds the peers each D360 component deploys with inside ComponentSet.deploy(), which preview never calls, so preview listed only the changed component. The no-flags set now gets the same peer expansion. The expansion skips what is already in the set, so the deploy sends the same components as before, and the peers stay out of package.xml.
Preview reads ComponentSet.getComponentsToDeploy() for a deploy, so the D360 peers and the <dataspace>.<name> mapping come from SDR and the plugin only formats the rows. The no-flags path no longer expands the source tracking set itself, since the view and deploy() add the peers. Retrieve preview is unchanged.
e7c7f4f to
c06206d
Compare
|
Thanks for the contribution! It looks like @aparnagoy is an internal user so signing the CLA is not required. However, we need to confirm this. |
WillieRuemmele
left a comment
There was a problem hiding this comment.
Merging into ag/d360 for pre-release publishing
What this changes
These changes all make sure that
sf project deploy previewlists exactly whatsf project deploy startsends.src/utils/deploy.tsbuildComponentSetpassesforDeploy: truetoComponentSetBuilder.build(), so the set holds the peers each D360 component deploys withsrc/utils/previewOutput.ts<dataspace>.<name>request under that name, with the local file the deploy sends for itsrc/utils/deploy.tssrc/utils/previewOutput.ts,src/utils/deploy.tsComponentSet.getComponentsToDeploy()from SDR for a deploy and only format the rows. The D360 matching and the no-flags expansion move to SDREverything else about D360 deploys lives in
source-deploy-retrieve. This PR needs that change to be released first.Why the
forDeployline is hereDeploy works with just the SDR bump
This deploys the Data Lake Object
myDlo__dllto the org. SDR adds the DMO it deploys with (default.myDmo__dlm) on its own, becauseComponentSet.deploy()does that. The org receives both the DLO and the DMO, so the deploy succeeds. This also holds for source tracking deploys.Preview would list less than what gets deployed
This shows what a deploy would send, without deploying anything. Preview only builds the list. It never calls
deploy(), so SDR never gets the chance to add the DMO. The preview shows only the DLO, while the real deploy also sends the DMO. Nothing wrong reaches the org, but the list is incomplete. The same goes fordeploy reportanddeploy resume.Passing
forDeploy: truemakesbuild()add the peers up front, so preview, report and resume list the same components the deploy sends.Why it is opt in
Expansion in
build()is opt in through theforDeployoption, becauseproject delete sourcealso usesbuild()and would otherwise delete the peers' local files.Why the preview change is here
A D360 component that is in several dataspaces is stored once, under its bare name, for example
d360/dataLakeObjects/myDlo__dll.json. It can be deployed for one dataspace:SDR resolves
default.myDlo__dllto the localmyDlo__dllfile and sends that file under the requested name. No local file has the namedefault.myDlo__dll, so preview treated it as a component that isn't on disk and asked SDR for its file path, which D360 types don't support.deploy preview --metadata DataLakeObject:default.myDlo__dllType not supported for filepath generation: DataLakeObjectdefault.myDlo__dllwith its local file, plus its peers fordefaultdeploy start --metadata DataLakeObject:default.myDlo__dlldefaultType not supported for filepath generationNo source-backed components present in the packagePreview now uses the local file the deploy sends for the request, lists it under the requested name, and doesn't list it a second time under its bare name. The peers are listed under their own names. Requests by bare name and other types take the same path as before.
Why the no-flags change is here
With no flags, preview and deploy both start from the local changes that source tracking reports. That path doesn't go through
ComponentSetBuilder.build(), soforDeploydoesn't reach it. The deploy adds the peers insideComponentSet.deploy(). Preview never callsdeploy(), so it listed only the changed component.deploy previewdeploy startpackage.xmlof that deployThe set now gets the same peer expansion that
deploy()runs. The expansion skips what is already in the set, so the deploy sends the same components as before. Deleted components are skipped by the expansion, and a delete of a D360 component is still refused.What was asked in review
On the SDR PR, the reviewer asked to:
build()build()SourceComponent, not on the setdeleteSourcein VS Code copy components into a new set withtoArray()andadd(c, POST), which loses a marker held by the setadd()skip peers when a deletion type is passedWhat is decided
forDeployis removed andbuild()always adds the peersSourceComponent, so it survives a copy into a new setadd()skips peers when a deletion type is passedproject generate manifestdoes not list peersforDeployline and keeps the version bump<dataspace>.<name>request lists the local file the deploy sends, under the requested nameCommits in this update
ComponentSetBuilderinstead of expanding it in the pluginbuildComponentSetpassesforDeploy: true, so preview, report and resume list the peers the deploy sendsproject delete sourcestill builds its set without peers, by design<dataspace>.<name>should list what the deploy sendsType not supported for filepath generationbuild(), so preview listed only the changed component--metadata DataLakeObject:<dataspace>.<name><dataspace>.<name>mapping and de-duplication out of the plugin, so preview reads what SDR says the deploy sendsComponentSet.getComponentsToDeploy()and only formats the rows. The plugin no longer expands the source tracking set itselfTesting
maindeploy preview --metadata DataLakeObject:default.<name>against an org with D360 enableddeploy start --dry-runwith the same flagpackage.xmlnames only the DLOdeploy previewfor a second dataspace of the same DLOdeploy previewwith no flags, one changed DLO in two dataspacesdeploy start --dry-runwith no flags (the org drops the dataspace prefix, and the DLO and its two DataspaceMembers share one name)deploy start --dry-runwith no flags, same project