You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 18, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 18, 2024. It is now read-only.
feat: Always use the newest validation scratch org during Validate #1228
Describe the feature enhancement
We are using the thorough mode in our Validate Process. At the start of a typical day the first PRs are fast as only the newest changes are validated. However, throughout the day the PR validation gets slower and slower. This is because the validation org was created at midnight and tests the same functionality that was merged to master and built successfully earlier the same day.
We are Replenishing the Validate Pool at midnight, 10, 12 and 14. If Validate always used the newest scratch org in the pool, it would mitigate some of this slowdown as it would already contain the latest changes from the same day.
changed the title [-]Always use the newest validation scratch org during Validate[/-][+]feat: Always use the newest validation scratch org during Validate[/+]on Feb 14, 2023
Using the latest created scratch org would make sense for people that are replenishing it more frequently. My only question is is there a reason to not also delete the old ones first prior to replenishing and filling up more scratch orgs to reduce the footprint?
@azlam-abdulsalam Good question. Honestly, I haven't had the time to check it out yet. We used thorough in previous projects and is quite satisfied it. But I'll check it out when I have the time.
@vuha-acn Hmm, I though about it. The reason why I didn't delete them prior to replenishing is that it takes ≈ 1 hour to replenish the first batch of scratch orgs (brownfield project with many managed, unmanaged & unlocked dependencies). So that would block the validation process for that hour. In addition, the replenish job can fail if previous builds caused upstream errors in top-level packages (e.g. deleting a field which is still referenced in src-access-mgmt)
Could we keep the orchestrator cache replacement policy as FIFO by default? I'd like to avoid needing big purges and cleaning operations clean out stale orgs. At the fruit stand the grocer puts the oldest fruit on top.
@pogilvieCB I would present the analogy in a different way. The fruit the grocer puts on top is the product the grocer is selling. The scratch org is not the product that we are selling, the commits flowing to PROD are our products. The scratch orgs in our validation pipelines are merely means to validate our products. Thus, if keeping the orchestrator FIFO then you in effect validate old changes unecessarily. The goal should be to get the commits to PROD as fast as possible.
To put in terms of your analogy, the validation pipeline would be a fruit inspector inspecting the fruits being placed on the stand. He first inspects the apple and approves it. Then when an orange is placed on top, the fruit inspector needs to inspect the apple he already approved earlier in addition to the orange.
Activity
[-]Always use the newest validation scratch org during Validate[/-][+]feat: Always use the newest validation scratch org during Validate[/+]azlam-abdulsalam commentedon Feb 14, 2023
@petter-eikeland thats a smart idea, so instead of the current round robin, sort by updated date.
We will still need to figure out a particular use case where we feed in 'empty pools' one without installAll, as the last resort.
Also, curious why haven't you tried the fast feedback mode?
azlam-abdulsalam commentedon Feb 14, 2023
@zhebinliu @vuha-acn thoughts?
vuha-acn commentedon Feb 14, 2023
Using the latest created scratch org would make sense for people that are replenishing it more frequently. My only question is is there a reason to not also delete the old ones first prior to replenishing and filling up more scratch orgs to reduce the footprint?
petter-eikeland commentedon Feb 15, 2023
@azlam-abdulsalam Good question. Honestly, I haven't had the time to check it out yet. We used thorough in previous projects and is quite satisfied it. But I'll check it out when I have the time.
@vuha-acn Hmm, I though about it. The reason why I didn't delete them prior to replenishing is that it takes ≈ 1 hour to replenish the first batch of scratch orgs (brownfield project with many managed, unmanaged & unlocked dependencies). So that would block the validation process for that hour. In addition, the replenish job can fail if previous builds caused upstream errors in top-level packages (e.g. deleting a field which is still referenced in src-access-mgmt)
pogilvieCB commentedon Sep 2, 2023
Could we keep the orchestrator cache replacement policy as FIFO by default? I'd like to avoid needing big purges and cleaning operations clean out stale orgs. At the fruit stand the grocer puts the oldest fruit on top.
pogilvieCB commentedon Sep 2, 2023
I think it's fine to add an option.
petter-eikeland commentedon Sep 15, 2023
@pogilvieCB I would present the analogy in a different way. The fruit the grocer puts on top is the product the grocer is selling. The scratch org is not the product that we are selling, the commits flowing to PROD are our products. The scratch orgs in our validation pipelines are merely means to validate our products. Thus, if keeping the orchestrator FIFO then you in effect validate old changes unecessarily. The goal should be to get the commits to PROD as fast as possible.
To put in terms of your analogy, the validation pipeline would be a fruit inspector inspecting the fruits being placed on the stand. He first inspects the apple and approves it. Then when an orange is placed on top, the fruit inspector needs to inspect the apple he already approved earlier in addition to the orange.
To avoid stale orgs, I recommend using the scheduled pool cleaner template pipelines provided by DX@Scale. Thus, you delete all remaining orgs in the pool before you replenish the pool at e.g. midnight to ensure you have up-to-date scratch orgs.