Skip to content

Create Org#60

Open
jlantz wants to merge 2 commits intocumulusci-next-snapshotsfrom
jlantz/create-org
Open

Create Org#60
jlantz wants to merge 2 commits intocumulusci-next-snapshotsfrom
jlantz/create-org

Conversation

@jlantz
Copy link
Copy Markdown
Contributor

@jlantz jlantz commented Nov 2, 2024

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.

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

1 participant