Skip to content
This repository was archived by the owner on Mar 18, 2024. It is now read-only.
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

Closed

Description

@petter-eikeland

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.

Activity

  1. added
    analysis
    on Feb 14, 2023
  2. 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
  3. azlam-abdulsalam commented on Feb 14, 2023

    @azlam-abdulsalam
    Contributor

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

  4. azlam-abdulsalam commented on Feb 14, 2023

    @azlam-abdulsalam
    Contributor
  5. vuha-acn commented on Feb 14, 2023

    @vuha-acn
    Contributor

    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?

  6. petter-eikeland commented on Feb 15, 2023

    @petter-eikeland
    Author

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

  7. pogilvieCB commented on Sep 2, 2023

    @pogilvieCB

    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.

  8. pogilvieCB commented on Sep 2, 2023

    @pogilvieCB

    I think it's fine to add an option.

  9. petter-eikeland commented on Sep 15, 2023

    @petter-eikeland
    Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

analysis

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions