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

Create Org #60

Open
wants to merge 2 commits into
base: cumulusci-next-snapshots
Choose a base branch
from
Open

Create Org #60

wants to merge 2 commits into from

Conversation

jlantz
Copy link
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