Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Return unused/rolled back scratch orgs to the pool #989

Closed
azlam-abdulsalam opened this issue May 23, 2022 · 0 comments
Closed

Return unused/rolled back scratch orgs to the pool #989

azlam-abdulsalam opened this issue May 23, 2022 · 0 comments
Labels
enhancement enhancement to existing feature

Comments

@azlam-abdulsalam
Copy link
Contributor

azlam-abdulsalam commented May 23, 2022

During the execution of validate command, sfpowerscripts fetch a scratch org from the pool. Currently any scratch orgs fetched from the pool are assigned (update the status, so that its no longer available for any validate or fetch) and can't be reused. There are situations where a fetched scratch org can be returned to the pool.

The following scenarios are identified

  • The very first package during deployment failed. All failed packages are immediately rolled back without any side effects to the underlying org.
  • There is no change identified between the installed artifacts and the branch that is getting validated. While, this could be prevented by using a file filter, some CI/CD systems need additional scripts or plugins to ensure that validate command is executed only if there is a valid change

There could be future scenarios, where CI orgs aka pooled scratch orgs could be reused for validating an independent domain.

Creating scratch orgs are very flaky and a time consuming process (most large projects are in the 5+ hour window). So rather than throwing away the org, atleast a few could be reused to save from pool creation

Based on discusssion at https://github.com/Accenture/sfpowerscripts/discussions/962

@github-actions github-actions bot added the analysis To be decided on how to solution/fix label May 23, 2022
@azlam-abdulsalam azlam-abdulsalam added this to the Release June 2022 milestone May 23, 2022
@azlam-abdulsalam azlam-abdulsalam added enhancement enhancement to existing feature and removed analysis To be decided on how to solution/fix labels Jun 2, 2022
manisfdcsfdx pushed a commit that referenced this issue Jun 8, 2022
azlam-abdulsalam pushed a commit that referenced this issue Jun 13, 2022
if a deployment is failing on the first package, the so can be reused. This update allows for a
scratch org to be returned back to pool to be used by subsequent runs. There is a change in the
prerequisitie package

BREAKING CHANGE: Change in prerequisite package

re #989
azlam-abdulsalam added a commit that referenced this issue Jun 14, 2022
* feat(validate): client side update to return a so back to pool

if a deployment is failing on the first package, the so can be reused. This update allows for a
scratch org to be returned back to pool to be used by subsequent runs. There is a change in the
prerequisitie package

BREAKING CHANGE: Change in prerequisite package

re #989

* add exception handling

Co-authored-by: Azlam <43767972+azlam-abdulsalam@users.noreply.github.com>
Co-authored-by: azlam-abdulsalam <azlam.abdulsalam@accenture.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement enhancement to existing feature
Development

No branches or pull requests

1 participant