question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Deploy On Save Performance Update

See original GitHub issue

The 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:

  1. 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.
  2. 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.
  3. 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:

  1. When a deployment is currently running, no new deployments should be started.
  2. When files are saved while a deployment is running they should be queued for a future deployment.
  3. As soon as one deployment finishes a new deployment should be started.
  4. When a deployment is started, it should contain any files that are queued so that the number of deployments are minimized.
  5. If there is no active deployment, and no files in the deployment queue, any file save should trigger an immediate deployment.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:12
  • Comments:18 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
ChuckJonascommented, Jul 3, 2019

@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.

1reaction
lcamposcommented, Jul 3, 2019

This is addressed in version 46.4.0 of the extensions.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found