Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: properly parse edition flag #916

Merged
merged 1 commit into from
Jan 2, 2024
Merged

fix: properly parse edition flag #916

merged 1 commit into from
Jan 2, 2024

Conversation

cristiand391
Copy link
Member

What does this PR do?

Make org create scratch --edition handle parter-* values properly.

We are setting the Edition field for ScratchOrgInfo to parter-<EDITION> but the API expects these as partner <EDITION> (separated by space, no hyphen).

Keeping the parter-<EDITION> format allow us to still autocomplete these (can't insert values with spaces on zsh).

Repro:

  1. try to create a scratch org with any of the allowed partner edition values:
➜  ~ sf org create scratch --edition partner-developer

Creating Scratch Org... Error
Error (1): Edition: bad value for restricted picklist field: partner-developer
  1. link this branch of plugin-org into sf, then:
➜  ~ sf org create scratch --edition partner-developer
 ›   Warning: @salesforce/plugin-org is a linked ESM module and cannot be auto-transpiled. Existing compiled source will be used instead.

Creating Scratch Org... Error
Error (1): You don't have permission to create Partner Edition organizations. To enable this functionality, please log a case in the Partner Community.

As Eric mentioned, our hub isn't configured for parter orgs but you can see the error returned by the API is correct.

https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_scratchorginfo.htm

What issues does this PR fix or reference?

forcedotcom/cli#2614
@W-14700935@

@shetzel
Copy link
Contributor

shetzel commented Jan 2, 2024

I tested with one of my devhubs which allows creation of partner scratch orgs and it worked correctly.

~/dev/salesforcecli/plugin-org/bin/run.js org create scratch --edition partner-developer

Creating Scratch Org...
RequestId: 2SR1Q000000V31MWAS (https://su0503.my.salesforce.com/2SR1Q000000V31MWAS)
OrgId: 00D8N000000uDje
Username: [email protected]
✓ Prepare Request
✓ Send Request
✓ Wait For Org
✓ Available
✓ Authenticate
✓ Deploy Settings
Done

Your scratch org is ready.

@shetzel shetzel merged commit 9c1ebc6 into main Jan 2, 2024
14 checks passed
@shetzel shetzel deleted the cd/fix-partner-flags branch January 2, 2024 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants