Create Org#60
Open
jlantz wants to merge 2 commits intocumulusci-next-snapshotsfrom
Open
Conversation
Add support for creating scratch orgs and exchanging auth codes using simple-salesforce and a BaseSalesforceOrg model with subclasses. * **d2x/models/sf/org.py** - Add `BaseSalesforceOrg` model with subclasses `ProductionOrg`, `TrialOrg`, `SandboxOrg`, and `ScratchOrg` using a pydantic discriminator. - Include main fields for each org type from Salesforce REST/Tooling API documentation. - Add concise descriptions for each field and create enums where applicable. - Update `SalesforceOrgInfo` to use the new `BaseSalesforceOrg` model. * **d2x/auth/sf/auth_url.py** - Update `exchange_token` function to use `BaseSalesforceOrg` model. - Add `create_scratch_org` function to create scratch orgs using simple-salesforce. * **d2x/cli/main.py** - Add `org` command group with `create` and `exchange` subcommands. - Update CLI commands to handle creating scratch orgs and exchanging auth codes using the new models and simple-salesforce. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/muselab-d2x/d2x/tree/cumulusci-next-snapshots?shareId=XXXX-XXXX-XXXX-XXXX).
* Test field validation and enum usage * Add tests for `exchange_token` function using `BaseSalesforceOrg` model * Test simple-salesforce integration for creating scratch orgs and exchanging auth codes * Add tests for CLI commands related to creating scratch orgs and exchanging auth codes * Test command execution and output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for creating scratch orgs and exchanging auth codes using simple-salesforce and a BaseSalesforceOrg model with subclasses.
d2x/models/sf/org.py
BaseSalesforceOrgmodel with subclassesProductionOrg,TrialOrg,SandboxOrg, andScratchOrgusing a pydantic discriminator.SalesforceOrgInfoto use the newBaseSalesforceOrgmodel.d2x/auth/sf/auth_url.py
exchange_tokenfunction to useBaseSalesforceOrgmodel.create_scratch_orgfunction to create scratch orgs using simple-salesforce.d2x/cli/main.py
orgcommand group withcreateandexchangesubcommands.For more details, open the Copilot Workspace session.