Add a polling frequency flag for the sfdx force:mdapi:deploy command #2345
Replies: 12 comments
-
This issue has been linked to a new work item: W-12550015 |
Beta Was this translation helpful? Give feedback.
-
Thank you for filing this feature request. We appreciate your feedback and will review the feature at our next grooming or sprint planning session. We prioritize feature requests with more upvotes and comments. |
Beta Was this translation helpful? Give feedback.
-
Oh, that's a good idea. The Out of curiosity, why do you use And would an |
Beta Was this translation helpful? Give feedback.
-
Hey @mshanemc! We need to specify a POST_INSTALL_CLASS in the package.xml file so that each package version has the post install class set. Is there a better way for generating a package.xml? Maybe we could use the |
Beta Was this translation helpful? Give feedback.
-
@Kevmo92 -- do you change the actual class that implements the InstallHandler from version-to-version of your package? You should be able to follow https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_install_handler.htm and just add conditionals to specify what happens based on the prior version and the new version -- that means you can just set it once in the packager org UI and forget it We use Plus if you convert your project to source format (from metadata format) you get the benefits of the deconstructed metadata files for things like SObjects and the ability to reorganized your other metadata into a logical folder structure. |
Beta Was this translation helpful? Give feedback.
-
@mshanemc other than polling optimizations, are there other benefits to |
Beta Was this translation helpful? Give feedback.
-
it's much faster than a
|
Beta Was this translation helpful? Give feedback.
-
@daveespo We typically don't change the actual class name/contents for the post install that much. Usually it's set and never changes. I'll take a look at https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_install_handler.htm to see if we can set that option in our packaging orgs. That would get rid of one hack 🤷 Our code is in source format in our version control system. We convert it to mdapi format to deploy to old developer orgs (not scratch orgs) where we package (classic 1gp packaging). |
Beta Was this translation helpful? Give feedback.
-
@Kevmo92 -- yeah, that's what we do too and have never looked back from using |
Beta Was this translation helpful? Give feedback.
-
@mshanemc Curious what, if any, flags you're using with |
Beta Was this translation helpful? Give feedback.
-
@cheyenneralston-ncino That's fair. There's nothing to be done about the time it takes the mdapi to deploy your code--that's unmovable and is the largest chunk by far, and by ignoring that part I'm ignoring the bulk of the time. Having to run 2 separate commands and touch every file in the project 2 extra times is where the performance improvements happen. |
Beta Was this translation helpful? Give feedback.
-
The default polling on the new commands is based on the size of what you're deploying and the defaults seem reasonable. Using source format instead of mdapi gives you those benefits. |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
We have hit API limits when running a long-running
sfdx force:mdapi:deploy -w -1
command. It seems like the value is set at 500 milliseconds as of current, https://github.com/salesforcecli/plugin-source/blob/main/src/commands/force/mdapi/deploy.ts#L177. It would be nice to have a flag to change this value to avoid using more api calls unnecessarily.What are you trying to do
Avoid API limits by reducing polling frequency (allowing us to specify polling frequency)
Describe the solution you'd like
I would like a flag to be available to specify the polling frequency of the poll under the hood of the mdapi:deploy command instead of having to break out the deploy and poll ourselves. It would be nice if the polling frequency was included as a flag in seconds? milliseconds?
Describe alternatives you've considered
Breaking out the commands into a
sfdx force:mdapi:deploy
and asfdx force:mdapi:deploy:report
and polling ourselves with sleep commandsAdditional context
Add any other context or screenshots about the feature request here.
Beta Was this translation helpful? Give feedback.
All reactions