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

Document the org_config Object #3490

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

RupertBarrow
Copy link

@RupertBarrow RupertBarrow commented Jan 16, 2023

To fix #2424, I have created a document called org_config.md under docs, and added this paragraph to the reference.md chapter.

At the same time, I fixed the name of the env-var-reference chapter which was incorrectly referenced in reference.md and, thus, did not appear in the generated documentation.

I scoured the source code for these attributes, leaving out the attributes with names starting with an underscore, as well as salesforce_client and tooling which sound like reserved for internal use.
I guessed the use of most of the attributes from their name. When in doubt, I left attributes with unknown use in a separate list.

@RupertBarrow RupertBarrow marked this pull request as ready for review January 16, 2023 19:09
@RupertBarrow RupertBarrow requested a review from a team as a code owner January 16, 2023 19:09
@prescod prescod added the ignore-for-release Don't include in release notes label Jan 17, 2023
@yippie
Copy link
Contributor

yippie commented May 20, 2024

More documentation is always good!

@RupertBarrow RupertBarrow requested a review from yippie May 23, 2024 13:35
@Julian88Tex
Copy link
Contributor

@RupertBarrow thanks for this!

@RupertBarrow
Copy link
Author

Hi @yippie , is anyone going to merge this PR one day ?
Are you expecting more inputs from me (the author of the PR) ?

@RupertBarrow
Copy link
Author

I just update this documentation after reading about has_minimum_package_version() in https://trailhead.salesforce.com/fr/trailblazer-community/feed/0D54V00007erukZSAQ

Copy link
Contributor

@jstvz jstvz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution, @RupertBarrow. Apologies for the delay in reviewing it.

Just a needs a few tweaks before we merge it.

@@ -8,5 +8,6 @@ maxdepth: 1
cheat-sheet
tasks
flows
env_var_reference
env-var-reference
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks.

@@ -0,0 +1,59 @@
# org_config Object Reference

The `org_config` object can be used in the `cumulusci.yml` file to read a large number number of attributes of the Salesforce org currently used. For example, in a [custom flow step](https://cumulusci.readthedocs.io/en/stable/config.html#add-a-flow-step), you can use a `when`clause to adapt the behavior of the new step to the type of org (scratch org or not) by referencing the `org_config.scratch` attribute.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `org_config` object can be used in the `cumulusci.yml` file to read a large number number of attributes of the Salesforce org currently used. For example, in a [custom flow step](https://cumulusci.readthedocs.io/en/stable/config.html#add-a-flow-step), you can use a `when`clause to adapt the behavior of the new step to the type of org (scratch org or not) by referencing the `org_config.scratch` attribute.
The `org_config` object can be used in the `cumulusci.yml` file to read a large number number of attributes of the Salesforce org currently used. For example, in a [custom flow step](https://cumulusci.readthedocs.io/en/stable/config.html#add-a-flow-step), you can use a `when` clause to adapt the behavior of the new step to the type of org (scratch org or not) by referencing the `org_config.scratch` attribute.

## org_config Object Attributes

- `access_token` : access token currently used to authenticate with Salesforce
- `installed_packages` : comma-separated list of package names; a dict mapping a namespace or package Id (033\*) to the installed package version(s) matching that identifier. All values are lists, because multiple second-generation packages may be installed with the same namespace. Beta version of a package are represented as "1.2.3b5", where 5 is the build number.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `installed_packages` : comma-separated list of package names; a dict mapping a namespace or package Id (033\*) to the installed package version(s) matching that identifier. All values are lists, because multiple second-generation packages may be installed with the same namespace. Beta version of a package are represented as "1.2.3b5", where 5 is the build number.
- `installed_packages` : comma-separated list of package names; a `dict` mapping a namespace or metadata package ID (starts with `033`) to the installed package version(s) matching that identifier. All values are lists, because multiple second-generation packages may be installed with the same namespace. The beta version of a package is represented as "1.2.3b5", where 5 is the build number.

- `namespaced` : `true` if the org has a namespace
- `org_id` : orgid of the Salesforce org
- `org_type` : eg "Enterprise Edition" or "Developer Edition"
- `organization_sobject` : whole Organization SObject (see the [Salesforce documentation for the Organization SObject](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_organization.htm))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `organization_sobject` : whole Organization SObject (see the [Salesforce documentation for the Organization SObject](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_organization.htm))
- `organization_sobject` : The Organization object (see the [Salesforce documentation for the Organization SObject](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_organization.htm)) for the org.

- `lightning_base_url` : base url ending with `.lightning.force.com`
- `namespace` : namespace of the org
- `namespaced` : `true` if the org has a namespace
- `org_id` : orgid of the Salesforce org
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `org_id` : orgid of the Salesforce org
- `org_id` : Organization ID of the Salesforce org

- `org_id` : orgid of the Salesforce org
- `org_type` : eg "Enterprise Edition" or "Developer Edition"
- `organization_sobject` : whole Organization SObject (see the [Salesforce documentation for the Organization SObject](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_organization.htm))
- `scratch` : true indicates the org is a scratch org. False indicates it is a persistent org
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `scratch` : true indicates the org is a scratch org. False indicates it is a persistent org
- `scratch` : `True` when the org is a scratch org.

- `organization_sobject` : whole Organization SObject (see the [Salesforce documentation for the Organization SObject](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_organization.htm))
- `scratch` : true indicates the org is a scratch org. False indicates it is a persistent org
- `start_url`: the frontdoor URL that results in an instant login, like `https://mydomain.my.salesforce.com/secur/frontdoor.jsp?sid=...`
- `user_id` : user id of the current Salesforce user
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `user_id` : user id of the current Salesforce user
- `user_id` : user ID of the current Salesforce user


## org_config Object Methods

- `has_minimum_package_version(package_identifier, version_identifier)`: True if the org has a version of the specified package that is equal to or newer than the supplied version identifier.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using true everywhere else:

Suggested change
- `has_minimum_package_version(package_identifier, version_identifier)`: True if the org has a version of the specified package that is equal to or newer than the supplied version identifier.
- `has_minimum_package_version(package_identifier, version_identifier)`: `true` if the org has a version of the specified package that is equal to or newer than the supplied version identifier.

## org_config Object Methods

- `has_minimum_package_version(package_identifier, version_identifier)`: True if the org has a version of the specified package that is equal to or newer than the supplied version identifier.
The package identifier may be either a namespace or a 033 package Id.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The package identifier may be either a namespace or a 033 package Id.
The package identifier may be either a namespace or a `033` MetadataPackage ID.

@jstvz jstvz enabled auto-merge (squash) November 16, 2024 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:signed ignore-for-release Don't include in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should document org_config options for when clauses
5 participants