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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
When you deploy a Data Cloud dataspace-scoped component, it usually can't be deployed on its
own — it has peer components that must go up in the same deploy for the server to accept it. This
change makes the plugin pull those peers in automatically, so a deploy of one dataspace-scoped
component also deploys everything it needs, and nothing it doesn't.
It's generic: it works for any dataspace-scoped type, present or future. There is no per-type
logic here — the behavior is driven entirely by the component metadata, so new types are picked up
without touching this code.
When the call reaches this repo
This plugin is the entry point for
sf project retrieve startandsf project deploy start. Hereis where each command lands and what this repo does with it before/after handing off to SDR
(
@salesforce/source-deploy-retrieve), which does the actual resolve/convert/transfer.sf project retrieve startRetrieve needs no dataspace-scoped code in this repo. SDR's
D360SourceAdapter/D360MetadataTransformerproduce thed360/dataspace/…payload +.meta.jsonsidecar; the pluginonly writes what SDR hands back.
sf project deploy startDeploy is where this repo does its one dataspace-scoped thing: expand the requested set with its
retrieveWithclosure before the deploy. Everything downstream (convert → package → transfer) isunchanged SDR.
How a component says what it needs
Every dataspace-scoped component ships with a sidecar that lists its deploy peers under
retrieveWith. That list is the deploy unit: the component plus itsretrieveWithpeers (andtheir peers, transitively) travel together. We follow
retrieveWithand onlyretrieveWith— aseparate
dependsOnlist also exists but is informational and deliberately not used to decide whatgets deployed.
Design
The expansion is off the hot path and only runs when it's actually needed:
hasD360Components(set)d360). Every ordinary deploy short-circuits here and is completely unaffected.expandD360Closure(requested)retrieveWithclosure. Only called when the gate passes (it is not a no-op — it resolves the full project).expandD360ComponentSetcomponentName, then follow each component'sretrieveWithtransitively, adding only the referenced dataspace-scoped peers.Where it hooks in
Inside
executeDeploy, on the source-format path only (mdapi-directory/zip deploys are untouched),right after the component set is built:
The result flows into the normal deploy exactly as before — the closure just changes which
components are in the set, not how they deploy.
Notes
every ordinary component set.
retrieveWithpeers andnothing else from the project.
source-deploy-retrievechange (thed360adapter/transformer strategyand the
expandD360ComponentSetexport) to be present.