Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[FrenchTouchDreamin] Elevate Your DevOps: How ...

[FrenchTouchDreamin] Elevate Your DevOps: How Scratch Orgs Pools Fit Into Your Salesforce Strategy

Using scratch orgs in the context of Salesforce development is pivotal for ensuring an agile and efficient workflow. However, the process of creating and updating these environments can become a bottleneck for productivity. In this presentation, we will discuss a strategic approach to establish pools of scratch orgs, ensuring that developers always have up-to-date and ready-to-use environments at their disposal. Moreover, we'll elucidate how to incorporate these scratch org pools into your CI/CD pipeline.
Naturally, prepare to witness examples and scenarios from real-world experiences.

Nathan Abondance

December 01, 2023
Tweet

More Decks by Nathan Abondance

Other Decks in Programming

Transcript

  1. Elevate Your DevOps: How Scratch Orgs Pools Fit Into Your

    Salesforce Strategy By Jérémy Vial & Nathan Abondance
  2. Agenda 1. Context 2. Theoretical Solution 3. Practical Solutions 4.

    Diving deeper in the open source solution 5. Integration to existing development cycle 6. Future proof 7. Summary
  3. What are Scratch Orgs •Environment for Source-driven deployment of Salesforce

    metadata and data •Fully configurable •Allowing to emulate different Salesforce editions, features and settings •Scratch org configuration file
  4. What are Scratch Orgs •Environment for Source-driven deployment of Salesforce

    code and metadata •Fully configurable •Allowing to emulate different Salesforce editions, features and settings •Scratch org configuration file •Install packages and deploy data for testing •Representate by SObject in the DevHub
  5. x What’s copied Data Storage Refresh Cycle Sandbox Template Quantity

    Scratch org Customisable Metadata Data: 200MB File: 50MB x Not available Essential: 3 Professional: 40 Enterprise: 100 Unlimited: 100 Developer (sandbox) Metadata only Data: 200MB File: 200MB 1 Day Not available Essential: 10 Professional: 25 Enterprise: 100 Unlimited: 100 Developer Pro (sandbox) Metadata only Data: 1GB File: 1GB 1 Day Not available Essential: 0 Professional: 0 Enterprise: 5 Unlimited: 5 Partial (sandbox) Metadata & Sample data Data: 5GB File: 5GB 5 Days Required Essential: 0 Professional: 1 Enterprise: 1 Unlimited: 1 Full (sandbox) Metadata & all data Same as Production 29 Days Available Essential: 0 Professional: 0 Enterprise: 1 Unlimited: 1
  6. Scratch org push data Push and retrieve data scratch org

    1. vanilla sf command sf data import tree --files Contact.json,Account.json --target-org my-scratch 2. sf plugin (texeï, sfdmu) 3. data package 4. ISV 5. API
  7. Development •Highly and easily customisable •Isolated and Ephemeral Environment •Quick

    to Create (empty) and Delete •Reduces Code Conflicts (dev workflow more accurate) •Conformity with Production Environments
  8. Tests •Clean Testing Environment •Facilitates Continuous Integration/Continuous Deployment (CI/CD) •Promotes

    Agile Development Practices •No Long-Term Commitment (can test new feature not in prod) •Replicates Production Environment
  9. Theoretical solution: pool refilling pool logic Pool 1 Pool 2

    Check empty slots Check empty slots Legend Existing SO Empty slot
  10. Theoretical solution: pool refilling Pool 2 Legend Existing SO Empty

    slot Created SO Refill empty slots pool logic Pool 1
  11. Pool 2 Pool 1 Theoretical solution: pool recycling Legend Existing

    SO Empty slot Used SO pool logic Delete unused Scratch Orgs Delete unused Scratch Orgs
  12. Theoretical solution: advantages • Automatic • Available on demand instantaneously

    • No competence needed to use it • Specific pools for specific use cases
  13. Practical Solution: Paying tool Exemple: Hutte CONS Cost money Limited

    customization Dependency on Vendor Easy to setup PROS Handle basic use cases User friendly interfaces
  14. Practical Solution: Do It Yourself CONS Time consuming Reinventing the

    wheel Facing challenges alone Free PROS Highly customizable Skill development
  15. Practical Solution: Open Source Exemple: sfp by flxbl Best of

    booth previous solutions PROS Maintained by the community Flexibility and Innovation CONS Dependency on community Learning curve Integration challenges
  16. What do we need ? • Logic to create and

    manage pools ◦ data management (data package , sfdmu, script texei or commande sf) ◦ metadata management (metadata in repo ou package) • using packages deployment strategy highly recommended • CI/CD / VM / raspberry • a git repository
  17. Integration to existing dev cycle Example of workflow with sfp

    CI Pool Dev Pool • All dependencies installed • Use for testing deployment • Deleted after use to avoid corrupted metadata => Ready to use • External dependencies installed • Custom code deployed • Data samples • User configuration
  18. Integration to existing dev cycle Example of workflow with sfp

    CI Pool main feature branch PR review if test deploy in SOCI OK = merge developement
  19. Integration to existing dev cycle Example of workflow with sfp

    Dev Pool SO feature A SO feature B sfp pool:fetch --tag=devpool
  20. Integration to existing dev cycle Example of workflow with sfp

    Replenish CI Pools - Auto Triggered pool logic Replenish Dev Pools - Auto Triggered Scratch Org Pool Cleaner - Auto Scheduled Scratch Org Recycler - User Scheduled 🗑
  21. Future proof: What is the future ? • Packages •

    Multiple orgs • More customization options • Real data in dev environments • Huge orgs
  22. Future proof: Good news • Packages ✅ • Multiple orgs

    ✅ • More customization options ✅ • Real data in dev environments ✅ • Huge orgs ✅
  23. Working demo: ftd23 Our GitHubs: Jérémy: /jeremyvial Nathan: /nabondance Thank

    you We are looking for a senior Salesforce developer at
  24. Images rights - Newton the cat, Nathan Abondance, 2023. -

    We Can Do It!, J. Howard Miller, 1943. - AI generated images, DALL-E, 2023. - Hutte logo, Hutte GmbH, 2023. - Flxbl logo, Flxbl, 2023. - Aviv logo, Aviv Group GmbH, 2019.