-
Notifications
You must be signed in to change notification settings - Fork 242
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
base: main
Are you sure you want to change the base?
Conversation
More documentation is always good! |
@RupertBarrow thanks for this! |
Hi @yippie , is anyone going to merge this PR one day ? |
after reading about has_minimum_package_version() in https://trailhead.salesforce.com/fr/trailblazer-community/feed/0D54V00007erukZSAQ
I just update this documentation after reading about |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using true
everywhere else:
- `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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
To fix #2424, I have created a document called
org_config.md
under docs, and added this paragraph to thereference.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
andtooling
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.