0

I've created the below diagram. I believe it is pretty much self-explanatory, however, I would like to point out a few stuff.

Managed Package Development Process

After some self-research and help from this community, my conclusion is:

  1. For developing Managed package (multi developers) we can use any DevHub Orgs.
  2. Later on, register the Package Org's namespace prefix on the DeveHub Org.
  3. Create Scratch Org and develop code based on the namespace prefix.
  4. Finally, give build to Package Org, from there firstly we need to create a beta Managed Package. Upon successful testing result, build the Released Managed Package.

These are my understandings, please do correct me where I'm wrong or provide me info about a better way.

My concerns:

  1. Create new Scratch Orgs after every 30 days, Is there a proper way to clone one scratch org to another rather than pushing all the files every time and manually setting up the org? Please provide me resources if possible.
  2. I believe I can use any ORG for QA testing/DevHub Orgs/Scratch Orgs. Are there any Salesforce recommendations for these ORG types? Suppose I have an enterprise edition production org, I have to create DevHub and other ORG from the Enterprise edition ORG or need to maintain org types for them, something like that?
6
  • According to Vivek Chawla Scratch Orgs are now 90 days. Also supposedly you can now use the new Org Shape feature. No idea re: 2, we're still using 1GP and so our QA simply install Beta version link in whatever org they need to test
    – zaitsman
    Sep 27 '21 at 6:03
  • @zaitsman 90 days is way too long for most development, though. I would strongly recommend keeping them around only as long as necessary.
    – sfdcfox
    Sep 27 '21 at 6:05
  • @sfdcfox it really depends on what you do. Our app is predominantly external code and we use SF instances purely as databases. The shorter they are the more painful it is for devs, which is why we are still on 1GP with each developer getting their own dev edition org and they live for years.
    – zaitsman
    Sep 27 '21 at 6:13
  • 1
    @HasanOnM I don't have a link, I had a call with Vivek Chawla (linkedin.com/in/vivekmchawla) who is heading their 2GP Technical Evangelism efforts and he confirmed that to me in a call. In the end he agreed for us 1GP makes more sense so I never investigated 2GP further.
    – zaitsman
    Sep 27 '21 at 6:15
  • 1
    @zaitsman Yes, there are certainly exceptions, which is why I said "most." Our app also has a similar setup, it requires logging in to an external system and copying properties into the new org, so it's not ideal for a short development cycle, but self-contained native apps benefit greatly from shorter cycles, as you don't have to set up extra processes to keep your code in sync.
    – sfdcfox
    Sep 27 '21 at 6:16
2

Finally, give build to Package Org, from there firstly we need to create a beta Managed Package. Upon successful testing result, build the Released Managed Package.

You don't need to do a Beta, unless you want to have testing phases using the package. Recommended, just in case you accidentally introduce a field, object, class, dependency, etc by accident. You may wind up having several Beta packages to one Released package, or you may not have any. For example, you might do all your testing on Scratch Orgs/Sandboxes, then only build a Released package when all your tests pass.

Create new Scratch Orgs after every 30 days, Is there a proper way to clone one scratch org to another rather than pushing all the files every time and manually setting up the org? Please provide me resources if possible.

No, this is recommended. Most recommendations will say that you should create a Scratch Org for every "story" or "ticket", but I tend to reuse my Scratch Orgs until they expire. It should only take a few minutes to actually set up an org, including importing data, especially if you have scripts for this. It's not really a major hassle.

I believe I can use any ORG for QA testing/DevHub Orgs/Scratch Orgs. Are there any Salesforce recommendations for these ORG types? Suppose I have an enterprise edition production org, I have to create DevHub and other ORG from the Enterprise edition ORG or need to maintain org types for them, something like that?

You should generally not use a DevHub org for QA/testing/etc. A DevHub should typically be a BPO (Business Partner Org) or individual Developer Edition orgs, and these are not necessarily orgs you want to be testing in.

Scratch Orgs are great because they spin up quickly and are easy to set up, but some organizations prefer to have SSO or other setups that would make Sandboxes better for testing/QA purposes.

That said, you can certainly use any org that you would like to, and there are tradeoffs for each type. Overall, I wouldn't worry too much about the choice of org you use for QA/UAT/etc.

5
  • 1
    As per this previous Q&A as a partner you must use your PBO as your dev Hub in order to benefit from scratch org creation/active scratch org/free access licenses for a team of developers. To use a dev org will cripple any team of more than one developer.
    – Phil W
    Sep 27 '21 at 6:50
  • 1
    In terms of scratch org re-use, I recommend caution since you may accidentally pollute one dev item's VCS brach with metadata from a (number of) previous one(s) if you pull from the scratch org. For this reason I would use one per dev item.
    – Phil W
    Sep 27 '21 at 6:50
  • @PhilW We use one Dev Hub per Developer, ensuring we likely won't run in to limits, but you're right, a PBO Dev Hub certainly has attractive benefits. And yes, one org per ticket is also ideal, but our process/flow works well enough, because we always branch from QA, and constantly merge, so it ends up not being a big deal, though I have personally experienced such pollution. Our saving grace here, is that we're limited to tickets having a maximum life span of only a couple of weeks, so it tends to run pretty smooth.
    – sfdcfox
    Sep 27 '21 at 7:02
  • @sfdcfox, So, my mentioned diagram is alright? Except for the points you have said.
    – HasanOnM
    Sep 27 '21 at 10:04
  • @HasanOnM Yeah.
    – sfdcfox
    Sep 27 '21 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.