Deploy On Save Performance Update
See original GitHub issueThe current implementation of deploy on save relies on watching files for changes and pushing changes no more than once every 4.5 seconds.
Problem
This implementation results in a number of undesirable behaviors:
- Multiple deployments can be triggered at the same time. If two files are saved say 5 seconds apart, but the first deployment takes longer than 5 seconds a second deployment will be triggered while the other is still running.
- If many files are saved quickly, each one is deployed separately (when using
source:deploy
). This results in many extra API requests that add extra overhead. - Even in the case where a deployment is quick (say 1 second), if I save a file, then that deploy is triggered, and then quickly save another file, the second file won’t start deploying until 4.5 seconds have elapsed from the first save - resulting in an unnecessary deploy.
Desired Behavior
This implementation can be dramatically improved to result in the following behaviors:
- When a deployment is currently running, no new deployments should be started.
- When files are saved while a deployment is running they should be queued for a future deployment.
- As soon as one deployment finishes a new deployment should be started.
- When a deployment is started, it should contain any files that are queued so that the number of deployments are minimized.
- If there is no active deployment, and no files in the deployment queue, any file save should trigger an immediate deployment.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:12
- Comments:18 (6 by maintainers)
Top Results From Across the Web
Deploy On Save | Salesforce for VSCode
Any files that are saved while a deployment is running are added to a deployment queue. When the current deployment completes, a new...
Read more >salesforcedx-vscode-core.push-or-deploy-on-save.enabled ...
I updated my extension and CLI and still the push or save is not kicking off the deploy. ... Deploy On Save Performance...
Read more >deploy feature updates for user-initiated installations ...
Learn recommendations and best practices for manually deploying a feature update for a user-initiated installation.
Read more >Updating a Deployment - Google Cloud
After you have created a deployment, you can update it as your application or service changes. You can use Deployment Manager to update...
Read more >Step 3: Deploy a new version of your application - AWS Elastic ...
You can deploy a new version at any time, as long as no other update operations are in progress on your environment.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ntotten just tested it out with a couple scenarios:
First off, thank you for getting rid of the delay. If I make 500 saves in a day, that’s ~ 40 minutes of my life back. Not to mention my attention span is only about 10s so that make it more likely that the deploy will complete before I get distracted by github or hacker news.
Also the subsequent save queue works great. I like that it prevents multiple deploy requests from running at the same time. It does well combining metadata with “Save All” or when you make multiple saves after one is already running.
Feedback:
1: The 500ms delay is still just barely noticeable. I assume this is here to catch the “Save All” scenario? Not sure how much you tested, but I imagine it could safely be half that and still function (I find that debounces of ~200-300ms are only noticeable if you are looking for them).
2: When multiple MD is included in a single req, failure of any seems to cause the rest to fail as well. Would be nice if this wasn’t all or none.
3: Still would love to see some type of “dirty” tracking of previously failed deployments and including those files in subsequent saves (maybe only if it’s still open in an editor). This would be super helpful when refactoring. Although as I mentioned above, you wouldn’t want it to prevent other MD from going up.
This is addressed in version
46.4.0
of the extensions.