cumulusci-plus 5.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cumulusci-plus might be problematic. Click here for more details.
- cumulusci/__about__.py +1 -0
- cumulusci/__init__.py +22 -0
- cumulusci/__main__.py +3 -0
- cumulusci/cli/__init__.py +0 -0
- cumulusci/cli/cci.py +244 -0
- cumulusci/cli/error.py +125 -0
- cumulusci/cli/flow.py +185 -0
- cumulusci/cli/logger.py +72 -0
- cumulusci/cli/org.py +692 -0
- cumulusci/cli/plan.py +181 -0
- cumulusci/cli/project.py +391 -0
- cumulusci/cli/robot.py +116 -0
- cumulusci/cli/runtime.py +190 -0
- cumulusci/cli/service.py +521 -0
- cumulusci/cli/task.py +295 -0
- cumulusci/cli/tests/__init__.py +0 -0
- cumulusci/cli/tests/test_cci.py +545 -0
- cumulusci/cli/tests/test_error.py +170 -0
- cumulusci/cli/tests/test_flow.py +276 -0
- cumulusci/cli/tests/test_logger.py +25 -0
- cumulusci/cli/tests/test_org.py +1438 -0
- cumulusci/cli/tests/test_plan.py +245 -0
- cumulusci/cli/tests/test_project.py +235 -0
- cumulusci/cli/tests/test_robot.py +177 -0
- cumulusci/cli/tests/test_runtime.py +197 -0
- cumulusci/cli/tests/test_service.py +853 -0
- cumulusci/cli/tests/test_task.py +266 -0
- cumulusci/cli/tests/test_ui.py +310 -0
- cumulusci/cli/tests/test_utils.py +122 -0
- cumulusci/cli/tests/utils.py +52 -0
- cumulusci/cli/ui.py +234 -0
- cumulusci/cli/utils.py +150 -0
- cumulusci/conftest.py +181 -0
- cumulusci/core/__init__.py +0 -0
- cumulusci/core/config/BaseConfig.py +5 -0
- cumulusci/core/config/BaseTaskFlowConfig.py +5 -0
- cumulusci/core/config/OrgConfig.py +5 -0
- cumulusci/core/config/ScratchOrgConfig.py +5 -0
- cumulusci/core/config/__init__.py +125 -0
- cumulusci/core/config/base_config.py +111 -0
- cumulusci/core/config/base_task_flow_config.py +82 -0
- cumulusci/core/config/marketing_cloud_service_config.py +83 -0
- cumulusci/core/config/oauth2_service_config.py +17 -0
- cumulusci/core/config/org_config.py +604 -0
- cumulusci/core/config/project_config.py +782 -0
- cumulusci/core/config/scratch_org_config.py +251 -0
- cumulusci/core/config/sfdx_org_config.py +220 -0
- cumulusci/core/config/tests/_test_config_backwards_compatibility.py +33 -0
- cumulusci/core/config/tests/test_config.py +1895 -0
- cumulusci/core/config/tests/test_config_expensive.py +839 -0
- cumulusci/core/config/tests/test_config_util.py +91 -0
- cumulusci/core/config/universal_config.py +88 -0
- cumulusci/core/config/util.py +18 -0
- cumulusci/core/datasets.py +303 -0
- cumulusci/core/debug.py +33 -0
- cumulusci/core/dependencies/__init__.py +55 -0
- cumulusci/core/dependencies/base.py +561 -0
- cumulusci/core/dependencies/dependencies.py +273 -0
- cumulusci/core/dependencies/github.py +177 -0
- cumulusci/core/dependencies/github_resolvers.py +244 -0
- cumulusci/core/dependencies/resolvers.py +580 -0
- cumulusci/core/dependencies/tests/__init__.py +0 -0
- cumulusci/core/dependencies/tests/conftest.py +385 -0
- cumulusci/core/dependencies/tests/test_dependencies.py +950 -0
- cumulusci/core/dependencies/tests/test_github.py +83 -0
- cumulusci/core/dependencies/tests/test_resolvers.py +1027 -0
- cumulusci/core/dependencies/utils.py +13 -0
- cumulusci/core/enums.py +11 -0
- cumulusci/core/exceptions.py +311 -0
- cumulusci/core/flowrunner.py +888 -0
- cumulusci/core/github.py +665 -0
- cumulusci/core/keychain/__init__.py +24 -0
- cumulusci/core/keychain/base_project_keychain.py +441 -0
- cumulusci/core/keychain/encrypted_file_project_keychain.py +945 -0
- cumulusci/core/keychain/environment_project_keychain.py +7 -0
- cumulusci/core/keychain/serialization.py +152 -0
- cumulusci/core/keychain/subprocess_keychain.py +24 -0
- cumulusci/core/keychain/tests/conftest.py +50 -0
- cumulusci/core/keychain/tests/test_base_project_keychain.py +299 -0
- cumulusci/core/keychain/tests/test_encrypted_file_project_keychain.py +1228 -0
- cumulusci/core/metadeploy/__init__.py +0 -0
- cumulusci/core/metadeploy/api.py +88 -0
- cumulusci/core/metadeploy/plans.py +25 -0
- cumulusci/core/metadeploy/tests/test_api.py +276 -0
- cumulusci/core/runtime.py +115 -0
- cumulusci/core/sfdx.py +162 -0
- cumulusci/core/source/__init__.py +16 -0
- cumulusci/core/source/github.py +50 -0
- cumulusci/core/source/local_folder.py +35 -0
- cumulusci/core/source_transforms/__init__.py +0 -0
- cumulusci/core/source_transforms/tests/test_transforms.py +1091 -0
- cumulusci/core/source_transforms/transforms.py +532 -0
- cumulusci/core/tasks.py +404 -0
- cumulusci/core/template_utils.py +59 -0
- cumulusci/core/tests/__init__.py +0 -0
- cumulusci/core/tests/cassettes/TestDatasetsE2E.test_datasets_e2e.yaml +215 -0
- cumulusci/core/tests/cassettes/TestDatasetsE2E.test_datasets_extract_standard_objects.yaml +199 -0
- cumulusci/core/tests/cassettes/TestDatasetsE2E.test_datasets_read_explicit_extract_declaration.yaml +3 -0
- cumulusci/core/tests/fake_remote_repo/cumulusci.yml +32 -0
- cumulusci/core/tests/fake_remote_repo/tasks/directory/example_2.py +6 -0
- cumulusci/core/tests/fake_remote_repo/tasks/example.py +43 -0
- cumulusci/core/tests/fake_remote_repo_2/cumulusci.yml +11 -0
- cumulusci/core/tests/fake_remote_repo_2/tasks/example_3.py +6 -0
- cumulusci/core/tests/test_datasets_e2e.py +386 -0
- cumulusci/core/tests/test_exceptions.py +11 -0
- cumulusci/core/tests/test_flowrunner.py +836 -0
- cumulusci/core/tests/test_github.py +942 -0
- cumulusci/core/tests/test_sfdx.py +138 -0
- cumulusci/core/tests/test_source.py +678 -0
- cumulusci/core/tests/test_tasks.py +262 -0
- cumulusci/core/tests/test_utils.py +141 -0
- cumulusci/core/tests/test_utils_merge_config.py +276 -0
- cumulusci/core/tests/test_versions.py +76 -0
- cumulusci/core/tests/untrusted_repo_child/cumulusci.yml +7 -0
- cumulusci/core/tests/untrusted_repo_child/tasks/untrusted_child.py +6 -0
- cumulusci/core/tests/untrusted_repo_parent/cumulusci.yml +26 -0
- cumulusci/core/tests/untrusted_repo_parent/tasks/untrusted_parent.py +6 -0
- cumulusci/core/tests/utils.py +116 -0
- cumulusci/core/tests/yaml/global.yaml +0 -0
- cumulusci/core/utils.py +402 -0
- cumulusci/core/versions.py +149 -0
- cumulusci/cumulusci.yml +1621 -0
- cumulusci/files/admin_profile.xml +20 -0
- cumulusci/files/delete_excludes.txt +424 -0
- cumulusci/files/templates/project/README.md +12 -0
- cumulusci/files/templates/project/cumulusci.yml +63 -0
- cumulusci/files/templates/project/dot-gitignore +60 -0
- cumulusci/files/templates/project/mapping.yml +45 -0
- cumulusci/files/templates/project/scratch_def.json +25 -0
- cumulusci/oauth/__init__.py +0 -0
- cumulusci/oauth/client.py +400 -0
- cumulusci/oauth/exceptions.py +9 -0
- cumulusci/oauth/salesforce.py +95 -0
- cumulusci/oauth/tests/__init__.py +0 -0
- cumulusci/oauth/tests/cassettes/test_get_device_code.yaml +22 -0
- cumulusci/oauth/tests/cassettes/test_get_device_oauth_token.yaml +74 -0
- cumulusci/oauth/tests/test_client.py +308 -0
- cumulusci/oauth/tests/test_salesforce.py +46 -0
- cumulusci/plugins/__init__.py +3 -0
- cumulusci/plugins/plugin_base.py +93 -0
- cumulusci/plugins/plugin_loader.py +59 -0
- cumulusci/robotframework/CumulusCI.py +340 -0
- cumulusci/robotframework/CumulusCI.robot +7 -0
- cumulusci/robotframework/Performance.py +165 -0
- cumulusci/robotframework/Salesforce.py +936 -0
- cumulusci/robotframework/Salesforce.robot +192 -0
- cumulusci/robotframework/SalesforceAPI.py +416 -0
- cumulusci/robotframework/SalesforcePlaywright.py +220 -0
- cumulusci/robotframework/SalesforcePlaywright.robot +40 -0
- cumulusci/robotframework/__init__.py +2 -0
- cumulusci/robotframework/base_library.py +39 -0
- cumulusci/robotframework/faker_mixin.py +89 -0
- cumulusci/robotframework/form_handlers.py +222 -0
- cumulusci/robotframework/javascript/cci_init.js +34 -0
- cumulusci/robotframework/javascript/cumulusci.js +4 -0
- cumulusci/robotframework/locator_manager.py +197 -0
- cumulusci/robotframework/locators_56.py +88 -0
- cumulusci/robotframework/locators_57.py +5 -0
- cumulusci/robotframework/pageobjects/BasePageObjects.py +433 -0
- cumulusci/robotframework/pageobjects/ObjectManagerPageObject.py +246 -0
- cumulusci/robotframework/pageobjects/PageObjectLibrary.py +45 -0
- cumulusci/robotframework/pageobjects/PageObjects.py +351 -0
- cumulusci/robotframework/pageobjects/__init__.py +12 -0
- cumulusci/robotframework/pageobjects/baseobjects.py +120 -0
- cumulusci/robotframework/perftests/short/collection_perf.robot +105 -0
- cumulusci/robotframework/tests/CustomObjectTestPage.py +10 -0
- cumulusci/robotframework/tests/FooTestPage.py +8 -0
- cumulusci/robotframework/tests/cumulusci/base.robot +40 -0
- cumulusci/robotframework/tests/cumulusci/bulkdata.robot +38 -0
- cumulusci/robotframework/tests/cumulusci/communities.robot +57 -0
- cumulusci/robotframework/tests/cumulusci/datagen.robot +84 -0
- cumulusci/robotframework/tests/salesforce/TestLibraryA.py +24 -0
- cumulusci/robotframework/tests/salesforce/TestLibraryB.py +20 -0
- cumulusci/robotframework/tests/salesforce/TestListener.py +93 -0
- cumulusci/robotframework/tests/salesforce/api.robot +178 -0
- cumulusci/robotframework/tests/salesforce/browsers.robot +143 -0
- cumulusci/robotframework/tests/salesforce/classic.robot +51 -0
- cumulusci/robotframework/tests/salesforce/create_contact.robot +59 -0
- cumulusci/robotframework/tests/salesforce/faker.robot +68 -0
- cumulusci/robotframework/tests/salesforce/forms.robot +172 -0
- cumulusci/robotframework/tests/salesforce/label_locator.robot +244 -0
- cumulusci/robotframework/tests/salesforce/labels.html +33 -0
- cumulusci/robotframework/tests/salesforce/locators.robot +149 -0
- cumulusci/robotframework/tests/salesforce/pageobjects/base_pageobjects.robot +100 -0
- cumulusci/robotframework/tests/salesforce/pageobjects/example_page_object.py +25 -0
- cumulusci/robotframework/tests/salesforce/pageobjects/listing_page.robot +115 -0
- cumulusci/robotframework/tests/salesforce/pageobjects/objectmanager.robot +74 -0
- cumulusci/robotframework/tests/salesforce/pageobjects/pageobjects.robot +171 -0
- cumulusci/robotframework/tests/salesforce/performance.robot +109 -0
- cumulusci/robotframework/tests/salesforce/playwright/javascript_keywords.robot +33 -0
- cumulusci/robotframework/tests/salesforce/playwright/open_test_browser.robot +48 -0
- cumulusci/robotframework/tests/salesforce/playwright/playwright.robot +24 -0
- cumulusci/robotframework/tests/salesforce/playwright/ui.robot +32 -0
- cumulusci/robotframework/tests/salesforce/populate.robot +89 -0
- cumulusci/robotframework/tests/salesforce/test_testlistener.py +37 -0
- cumulusci/robotframework/tests/salesforce/ui.robot +361 -0
- cumulusci/robotframework/tests/test_cumulusci_library.py +304 -0
- cumulusci/robotframework/tests/test_locator_manager.py +158 -0
- cumulusci/robotframework/tests/test_pageobjects.py +291 -0
- cumulusci/robotframework/tests/test_performance.py +38 -0
- cumulusci/robotframework/tests/test_salesforce.py +79 -0
- cumulusci/robotframework/tests/test_salesforce_locators.py +73 -0
- cumulusci/robotframework/tests/test_template_util.py +53 -0
- cumulusci/robotframework/tests/test_utils.py +106 -0
- cumulusci/robotframework/utils.py +283 -0
- cumulusci/salesforce_api/__init__.py +0 -0
- cumulusci/salesforce_api/exceptions.py +23 -0
- cumulusci/salesforce_api/filterable_objects.py +96 -0
- cumulusci/salesforce_api/mc_soap_envelopes.py +89 -0
- cumulusci/salesforce_api/metadata.py +721 -0
- cumulusci/salesforce_api/org_schema.py +571 -0
- cumulusci/salesforce_api/org_schema_models.py +226 -0
- cumulusci/salesforce_api/package_install.py +265 -0
- cumulusci/salesforce_api/package_zip.py +301 -0
- cumulusci/salesforce_api/rest_deploy.py +148 -0
- cumulusci/salesforce_api/retrieve_profile_api.py +301 -0
- cumulusci/salesforce_api/soap_envelopes.py +177 -0
- cumulusci/salesforce_api/tests/__init__.py +0 -0
- cumulusci/salesforce_api/tests/metadata_test_strings.py +24 -0
- cumulusci/salesforce_api/tests/test_metadata.py +1015 -0
- cumulusci/salesforce_api/tests/test_package_install.py +219 -0
- cumulusci/salesforce_api/tests/test_package_zip.py +380 -0
- cumulusci/salesforce_api/tests/test_rest_deploy.py +264 -0
- cumulusci/salesforce_api/tests/test_retrieve_profile_api.py +337 -0
- cumulusci/salesforce_api/tests/test_utils.py +124 -0
- cumulusci/salesforce_api/utils.py +51 -0
- cumulusci/schema/cumulusci.jsonschema.json +782 -0
- cumulusci/tasks/__init__.py +0 -0
- cumulusci/tasks/apex/__init__.py +0 -0
- cumulusci/tasks/apex/anon.py +157 -0
- cumulusci/tasks/apex/batch.py +180 -0
- cumulusci/tasks/apex/testrunner.py +835 -0
- cumulusci/tasks/apex/tests/cassettes/ManualEditTestApexIntegrationTests.test_run_tests__integration_test.yaml +703 -0
- cumulusci/tasks/apex/tests/test_apex_tasks.py +1558 -0
- cumulusci/tasks/base_source_control_task.py +17 -0
- cumulusci/tasks/bulkdata/__init__.py +15 -0
- cumulusci/tasks/bulkdata/base_generate_data_task.py +96 -0
- cumulusci/tasks/bulkdata/dates.py +97 -0
- cumulusci/tasks/bulkdata/delete.py +156 -0
- cumulusci/tasks/bulkdata/extract.py +441 -0
- cumulusci/tasks/bulkdata/extract_dataset_utils/calculate_dependencies.py +117 -0
- cumulusci/tasks/bulkdata/extract_dataset_utils/extract_yml.py +123 -0
- cumulusci/tasks/bulkdata/extract_dataset_utils/hardcoded_default_declarations.py +49 -0
- cumulusci/tasks/bulkdata/extract_dataset_utils/synthesize_extract_declarations.py +283 -0
- cumulusci/tasks/bulkdata/extract_dataset_utils/tests/test_extract_yml.py +142 -0
- cumulusci/tasks/bulkdata/extract_dataset_utils/tests/test_synthesize_extract_declarations.py +575 -0
- cumulusci/tasks/bulkdata/factory_utils.py +134 -0
- cumulusci/tasks/bulkdata/generate.py +4 -0
- cumulusci/tasks/bulkdata/generate_and_load_data.py +232 -0
- cumulusci/tasks/bulkdata/generate_and_load_data_from_yaml.py +19 -0
- cumulusci/tasks/bulkdata/generate_from_yaml.py +183 -0
- cumulusci/tasks/bulkdata/generate_mapping.py +434 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/dependency_map.py +169 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/extract_mapping_file_generator.py +45 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/generate_mapping_from_declarations.py +121 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/load_mapping_file_generator.py +127 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/mapping_generator_post_processes.py +53 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/mapping_transforms.py +139 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/tests/test_generate_extract_mapping_from_declarations.py +135 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/tests/test_generate_load_mapping_from_declarations.py +330 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/tests/test_mapping_generator_post_processes.py +60 -0
- cumulusci/tasks/bulkdata/generate_mapping_utils/tests/test_mapping_transforms.py +188 -0
- cumulusci/tasks/bulkdata/load.py +1196 -0
- cumulusci/tasks/bulkdata/mapping_parser.py +811 -0
- cumulusci/tasks/bulkdata/query_transformers.py +264 -0
- cumulusci/tasks/bulkdata/select_utils.py +792 -0
- cumulusci/tasks/bulkdata/snowfakery.py +753 -0
- cumulusci/tasks/bulkdata/snowfakery_utils/queue_manager.py +478 -0
- cumulusci/tasks/bulkdata/snowfakery_utils/snowfakery_run_until.py +141 -0
- cumulusci/tasks/bulkdata/snowfakery_utils/snowfakery_working_directory.py +53 -0
- cumulusci/tasks/bulkdata/snowfakery_utils/subtask_configurator.py +64 -0
- cumulusci/tasks/bulkdata/step.py +1242 -0
- cumulusci/tasks/bulkdata/tests/__init__.py +0 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSelect.test_select_random_strategy.yaml +147 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSelect.test_select_similarity_annoy_strategy.yaml +123 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSelect.test_select_similarity_select_and_insert_strategy.yaml +313 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSelect.test_select_similarity_select_and_insert_strategy_bulk.yaml +550 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSelect.test_select_similarity_strategy.yaml +175 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSelect.test_select_standard_strategy.yaml +147 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSnowfakery.test_run_until_records_in_org__multiple_needed.yaml +69 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSnowfakery.test_run_until_records_in_org__none_needed.yaml +22 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSnowfakery.test_run_until_records_in_org__one_needed.yaml +24 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestSnowfakery.test_snowfakery_query_salesforce.yaml +25 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestUpdatesIntegrationTests.test_updates_task.yaml +80 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestUpsert.test_simple_upsert__rest.yaml +270 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestUpsert.test_upsert__rest.yaml +267 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestUpsert.test_upsert_complex_external_id_field__rest.yaml +369 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestUpsert.test_upsert_complex_external_id_field_rest__duplicate_error.yaml +204 -0
- cumulusci/tasks/bulkdata/tests/cassettes/TestUpsert.test_upsert_complex_fields__bulk.yaml +675 -0
- cumulusci/tasks/bulkdata/tests/dummy_data_factory.py +36 -0
- cumulusci/tasks/bulkdata/tests/integration_test_utils.py +49 -0
- cumulusci/tasks/bulkdata/tests/mapping-oid.yml +87 -0
- cumulusci/tasks/bulkdata/tests/mapping_after.yml +38 -0
- cumulusci/tasks/bulkdata/tests/mapping_poly.yml +34 -0
- cumulusci/tasks/bulkdata/tests/mapping_poly_incomplete.yml +20 -0
- cumulusci/tasks/bulkdata/tests/mapping_poly_wrong.yml +21 -0
- cumulusci/tasks/bulkdata/tests/mapping_select.yml +20 -0
- cumulusci/tasks/bulkdata/tests/mapping_select_invalid_strategy.yml +20 -0
- cumulusci/tasks/bulkdata/tests/mapping_select_invalid_threshold__invalid_number.yml +21 -0
- cumulusci/tasks/bulkdata/tests/mapping_select_invalid_threshold__invalid_strategy.yml +21 -0
- cumulusci/tasks/bulkdata/tests/mapping_select_invalid_threshold__non_float.yml +21 -0
- cumulusci/tasks/bulkdata/tests/mapping_select_missing_priority_fields.yml +22 -0
- cumulusci/tasks/bulkdata/tests/mapping_select_no_priority_fields.yml +18 -0
- cumulusci/tasks/bulkdata/tests/mapping_simple.yml +27 -0
- cumulusci/tasks/bulkdata/tests/mapping_v1.yml +28 -0
- cumulusci/tasks/bulkdata/tests/mapping_v2.yml +21 -0
- cumulusci/tasks/bulkdata/tests/mapping_v3.yml +32 -0
- cumulusci/tasks/bulkdata/tests/mapping_vanilla_sf.yml +69 -0
- cumulusci/tasks/bulkdata/tests/mock_data_factory_without_mapping.py +12 -0
- cumulusci/tasks/bulkdata/tests/person_accounts.yml +23 -0
- cumulusci/tasks/bulkdata/tests/person_accounts_minimal.yml +15 -0
- cumulusci/tasks/bulkdata/tests/recordtypes.yml +8 -0
- cumulusci/tasks/bulkdata/tests/recordtypes_2.yml +6 -0
- cumulusci/tasks/bulkdata/tests/recordtypes_with_ispersontype.yml +8 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/child/child2.yml +3 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/child.yml +4 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/gen_npsp_standard_objects.recipe.yml +89 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/include_parent.yml +3 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/npsp_standard_objects_macros.yml +34 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/options.recipe.yml +6 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/query_snowfakery.recipe.yml +16 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/sf_standard_object_macros.yml +83 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/simple_snowfakery.load.yml +2 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/simple_snowfakery.recipe.yml +13 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/simple_snowfakery_2.load.yml +5 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/simple_snowfakery_channels.load.yml +13 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/simple_snowfakery_channels.recipe.yml +12 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/simple_snowfakery_channels_2.load.yml +13 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/unique_values.recipe.yml +4 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/upsert.recipe.yml +23 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/upsert_2.recipe.yml +29 -0
- cumulusci/tasks/bulkdata/tests/snowfakery/upsert_before.yml +10 -0
- cumulusci/tasks/bulkdata/tests/test_base_generate_data_tasks.py +61 -0
- cumulusci/tasks/bulkdata/tests/test_dates.py +99 -0
- cumulusci/tasks/bulkdata/tests/test_delete.py +404 -0
- cumulusci/tasks/bulkdata/tests/test_extract.py +1311 -0
- cumulusci/tasks/bulkdata/tests/test_factory_utils.py +55 -0
- cumulusci/tasks/bulkdata/tests/test_generate_and_load.py +252 -0
- cumulusci/tasks/bulkdata/tests/test_generate_from_snowfakery_task.py +343 -0
- cumulusci/tasks/bulkdata/tests/test_generatemapping.py +1039 -0
- cumulusci/tasks/bulkdata/tests/test_load.py +3175 -0
- cumulusci/tasks/bulkdata/tests/test_mapping_parser.py +1658 -0
- cumulusci/tasks/bulkdata/tests/test_query_db__joins_self_lookups.yml +12 -0
- cumulusci/tasks/bulkdata/tests/test_query_db_joins_lookups.yml +26 -0
- cumulusci/tasks/bulkdata/tests/test_query_db_joins_lookups_select.yml +48 -0
- cumulusci/tasks/bulkdata/tests/test_select.py +171 -0
- cumulusci/tasks/bulkdata/tests/test_select_utils.py +1057 -0
- cumulusci/tasks/bulkdata/tests/test_snowfakery.py +1153 -0
- cumulusci/tasks/bulkdata/tests/test_step.py +3957 -0
- cumulusci/tasks/bulkdata/tests/test_updates.py +513 -0
- cumulusci/tasks/bulkdata/tests/test_upsert.py +1015 -0
- cumulusci/tasks/bulkdata/tests/test_utils.py +158 -0
- cumulusci/tasks/bulkdata/tests/testdata.db +0 -0
- cumulusci/tasks/bulkdata/tests/update_describe.py +50 -0
- cumulusci/tasks/bulkdata/tests/update_person_accounts.yml +23 -0
- cumulusci/tasks/bulkdata/tests/utils.py +114 -0
- cumulusci/tasks/bulkdata/update_data.py +260 -0
- cumulusci/tasks/bulkdata/upsert_utils.py +130 -0
- cumulusci/tasks/bulkdata/utils.py +249 -0
- cumulusci/tasks/command.py +178 -0
- cumulusci/tasks/connectedapp.py +186 -0
- cumulusci/tasks/create_package_version.py +778 -0
- cumulusci/tasks/datadictionary.py +745 -0
- cumulusci/tasks/dx_convert_from.py +26 -0
- cumulusci/tasks/github/__init__.py +17 -0
- cumulusci/tasks/github/base.py +16 -0
- cumulusci/tasks/github/commit_status.py +13 -0
- cumulusci/tasks/github/merge.py +11 -0
- cumulusci/tasks/github/publish.py +11 -0
- cumulusci/tasks/github/pull_request.py +11 -0
- cumulusci/tasks/github/release.py +11 -0
- cumulusci/tasks/github/release_report.py +11 -0
- cumulusci/tasks/github/tag.py +11 -0
- cumulusci/tasks/github/tests/__init__.py +0 -0
- cumulusci/tasks/github/tests/test_util.py +202 -0
- cumulusci/tasks/github/tests/test_vcs_migration.py +44 -0
- cumulusci/tasks/github/tests/util_github_api.py +666 -0
- cumulusci/tasks/github/util.py +252 -0
- cumulusci/tasks/marketing_cloud/__init__.py +0 -0
- cumulusci/tasks/marketing_cloud/api.py +188 -0
- cumulusci/tasks/marketing_cloud/base.py +38 -0
- cumulusci/tasks/marketing_cloud/deploy.py +345 -0
- cumulusci/tasks/marketing_cloud/get_user_info.py +40 -0
- cumulusci/tasks/marketing_cloud/mc_constants.py +1 -0
- cumulusci/tasks/marketing_cloud/tests/__init__.py +0 -0
- cumulusci/tasks/marketing_cloud/tests/conftest.py +46 -0
- cumulusci/tasks/marketing_cloud/tests/expected-payload.json +110 -0
- cumulusci/tasks/marketing_cloud/tests/test_api.py +97 -0
- cumulusci/tasks/marketing_cloud/tests/test_api_soap_envelopes.py +145 -0
- cumulusci/tasks/marketing_cloud/tests/test_base.py +14 -0
- cumulusci/tasks/marketing_cloud/tests/test_deploy.py +400 -0
- cumulusci/tasks/marketing_cloud/tests/test_get_user_info.py +141 -0
- cumulusci/tasks/marketing_cloud/tests/validation-response.json +39 -0
- cumulusci/tasks/metadata/__init__.py +0 -0
- cumulusci/tasks/metadata/ee_src.py +94 -0
- cumulusci/tasks/metadata/managed_src.py +100 -0
- cumulusci/tasks/metadata/metadata_map.yml +868 -0
- cumulusci/tasks/metadata/modify.py +99 -0
- cumulusci/tasks/metadata/package.py +684 -0
- cumulusci/tasks/metadata/tests/__init__.py +0 -0
- cumulusci/tasks/metadata/tests/package_metadata/namespaced_report_folder/.hidden/.keep +0 -0
- cumulusci/tasks/metadata/tests/package_metadata/namespaced_report_folder/destructiveChanges.xml +9 -0
- cumulusci/tasks/metadata/tests/package_metadata/namespaced_report_folder/package.xml +9 -0
- cumulusci/tasks/metadata/tests/package_metadata/namespaced_report_folder/package_install_uninstall.xml +11 -0
- cumulusci/tasks/metadata/tests/package_metadata/namespaced_report_folder/reports/namespace__TestFolder/TestReport.report +3 -0
- cumulusci/tasks/metadata/tests/sample_package.xml +9 -0
- cumulusci/tasks/metadata/tests/test_ee_src.py +112 -0
- cumulusci/tasks/metadata/tests/test_managed_src.py +111 -0
- cumulusci/tasks/metadata/tests/test_modify.py +123 -0
- cumulusci/tasks/metadata/tests/test_package.py +476 -0
- cumulusci/tasks/metadata_etl/__init__.py +29 -0
- cumulusci/tasks/metadata_etl/base.py +436 -0
- cumulusci/tasks/metadata_etl/duplicate_rules.py +24 -0
- cumulusci/tasks/metadata_etl/field_sets.py +70 -0
- cumulusci/tasks/metadata_etl/help_text.py +92 -0
- cumulusci/tasks/metadata_etl/layouts.py +550 -0
- cumulusci/tasks/metadata_etl/objects.py +68 -0
- cumulusci/tasks/metadata_etl/permissions.py +167 -0
- cumulusci/tasks/metadata_etl/picklists.py +221 -0
- cumulusci/tasks/metadata_etl/remote_site_settings.py +99 -0
- cumulusci/tasks/metadata_etl/sharing.py +138 -0
- cumulusci/tasks/metadata_etl/tests/test_base.py +512 -0
- cumulusci/tasks/metadata_etl/tests/test_duplicate_rules.py +22 -0
- cumulusci/tasks/metadata_etl/tests/test_field_sets.py +156 -0
- cumulusci/tasks/metadata_etl/tests/test_help_text.py +387 -0
- cumulusci/tasks/metadata_etl/tests/test_ip_ranges.py +85 -0
- cumulusci/tasks/metadata_etl/tests/test_layouts.py +858 -0
- cumulusci/tasks/metadata_etl/tests/test_objects.py +236 -0
- cumulusci/tasks/metadata_etl/tests/test_permissions.py +223 -0
- cumulusci/tasks/metadata_etl/tests/test_picklists.py +547 -0
- cumulusci/tasks/metadata_etl/tests/test_remote_site_settings.py +46 -0
- cumulusci/tasks/metadata_etl/tests/test_sharing.py +333 -0
- cumulusci/tasks/metadata_etl/tests/test_value_sets.py +298 -0
- cumulusci/tasks/metadata_etl/value_sets.py +106 -0
- cumulusci/tasks/metadeploy.py +393 -0
- cumulusci/tasks/metaxml.py +88 -0
- cumulusci/tasks/preflight/__init__.py +0 -0
- cumulusci/tasks/preflight/dataset_load.py +49 -0
- cumulusci/tasks/preflight/licenses.py +86 -0
- cumulusci/tasks/preflight/packages.py +14 -0
- cumulusci/tasks/preflight/permsets.py +23 -0
- cumulusci/tasks/preflight/recordtypes.py +16 -0
- cumulusci/tasks/preflight/retrieve_tasks.py +30 -0
- cumulusci/tasks/preflight/settings.py +77 -0
- cumulusci/tasks/preflight/sobjects.py +202 -0
- cumulusci/tasks/preflight/tests/test_dataset_load.py +85 -0
- cumulusci/tasks/preflight/tests/test_licenses.py +174 -0
- cumulusci/tasks/preflight/tests/test_packages.py +14 -0
- cumulusci/tasks/preflight/tests/test_permset_preflights.py +51 -0
- cumulusci/tasks/preflight/tests/test_recordtypes.py +30 -0
- cumulusci/tasks/preflight/tests/test_retrieve_tasks.py +62 -0
- cumulusci/tasks/preflight/tests/test_settings.py +130 -0
- cumulusci/tasks/preflight/tests/test_sobjects.py +231 -0
- cumulusci/tasks/push/README.md +59 -0
- cumulusci/tasks/push/__init__.py +0 -0
- cumulusci/tasks/push/push_api.py +659 -0
- cumulusci/tasks/push/pushfails.py +136 -0
- cumulusci/tasks/push/tasks.py +476 -0
- cumulusci/tasks/push/tests/conftest.py +263 -0
- cumulusci/tasks/push/tests/test_push_api.py +951 -0
- cumulusci/tasks/push/tests/test_push_tasks.py +659 -0
- cumulusci/tasks/release_notes/README.md +63 -0
- cumulusci/tasks/release_notes/__init__.py +0 -0
- cumulusci/tasks/release_notes/exceptions.py +5 -0
- cumulusci/tasks/release_notes/generator.py +137 -0
- cumulusci/tasks/release_notes/parser.py +232 -0
- cumulusci/tasks/release_notes/provider.py +44 -0
- cumulusci/tasks/release_notes/task.py +300 -0
- cumulusci/tasks/release_notes/tests/__init__.py +0 -0
- cumulusci/tasks/release_notes/tests/change_notes/full/example1.md +17 -0
- cumulusci/tasks/release_notes/tests/change_notes/multi/1.txt +1 -0
- cumulusci/tasks/release_notes/tests/change_notes/multi/2.txt +1 -0
- cumulusci/tasks/release_notes/tests/change_notes/multi/3.txt +1 -0
- cumulusci/tasks/release_notes/tests/change_notes/single/1.txt +1 -0
- cumulusci/tasks/release_notes/tests/test_generator.py +582 -0
- cumulusci/tasks/release_notes/tests/test_parser.py +867 -0
- cumulusci/tasks/release_notes/tests/test_provider.py +512 -0
- cumulusci/tasks/release_notes/tests/test_task.py +461 -0
- cumulusci/tasks/release_notes/tests/utils.py +153 -0
- cumulusci/tasks/robotframework/__init__.py +3 -0
- cumulusci/tasks/robotframework/debugger/DebugListener.py +100 -0
- cumulusci/tasks/robotframework/debugger/__init__.py +10 -0
- cumulusci/tasks/robotframework/debugger/model.py +87 -0
- cumulusci/tasks/robotframework/debugger/ui.py +259 -0
- cumulusci/tasks/robotframework/libdoc.py +269 -0
- cumulusci/tasks/robotframework/robotframework.py +392 -0
- cumulusci/tasks/robotframework/stylesheet.css +130 -0
- cumulusci/tasks/robotframework/template.html +109 -0
- cumulusci/tasks/robotframework/tests/TestLibrary.py +18 -0
- cumulusci/tasks/robotframework/tests/TestPageObjects.py +31 -0
- cumulusci/tasks/robotframework/tests/TestResource.robot +8 -0
- cumulusci/tasks/robotframework/tests/failing_tests.robot +16 -0
- cumulusci/tasks/robotframework/tests/performance.robot +23 -0
- cumulusci/tasks/robotframework/tests/test_browser_proxies.py +137 -0
- cumulusci/tasks/robotframework/tests/test_debugger.py +360 -0
- cumulusci/tasks/robotframework/tests/test_robot_parallel.py +141 -0
- cumulusci/tasks/robotframework/tests/test_robotframework.py +860 -0
- cumulusci/tasks/salesforce/BaseRetrieveMetadata.py +58 -0
- cumulusci/tasks/salesforce/BaseSalesforceApiTask.py +45 -0
- cumulusci/tasks/salesforce/BaseSalesforceMetadataApiTask.py +18 -0
- cumulusci/tasks/salesforce/BaseSalesforceTask.py +4 -0
- cumulusci/tasks/salesforce/BaseUninstallMetadata.py +41 -0
- cumulusci/tasks/salesforce/CreateCommunity.py +124 -0
- cumulusci/tasks/salesforce/CreatePackage.py +29 -0
- cumulusci/tasks/salesforce/Deploy.py +240 -0
- cumulusci/tasks/salesforce/DeployBundles.py +88 -0
- cumulusci/tasks/salesforce/DescribeMetadataTypes.py +26 -0
- cumulusci/tasks/salesforce/EnsureRecordTypes.py +202 -0
- cumulusci/tasks/salesforce/GetInstalledPackages.py +8 -0
- cumulusci/tasks/salesforce/ListCommunities.py +40 -0
- cumulusci/tasks/salesforce/ListCommunityTemplates.py +19 -0
- cumulusci/tasks/salesforce/PublishCommunity.py +62 -0
- cumulusci/tasks/salesforce/RetrievePackaged.py +41 -0
- cumulusci/tasks/salesforce/RetrieveReportsAndDashboards.py +82 -0
- cumulusci/tasks/salesforce/RetrieveUnpackaged.py +36 -0
- cumulusci/tasks/salesforce/SOQLQuery.py +39 -0
- cumulusci/tasks/salesforce/UninstallLocal.py +15 -0
- cumulusci/tasks/salesforce/UninstallLocalBundles.py +28 -0
- cumulusci/tasks/salesforce/UninstallLocalNamespacedBundles.py +58 -0
- cumulusci/tasks/salesforce/UninstallPackage.py +32 -0
- cumulusci/tasks/salesforce/UninstallPackaged.py +56 -0
- cumulusci/tasks/salesforce/UpdateAdminProfile.py +8 -0
- cumulusci/tasks/salesforce/__init__.py +79 -0
- cumulusci/tasks/salesforce/activate_flow.py +74 -0
- cumulusci/tasks/salesforce/check_components.py +324 -0
- cumulusci/tasks/salesforce/composite.py +142 -0
- cumulusci/tasks/salesforce/create_permission_sets.py +35 -0
- cumulusci/tasks/salesforce/custom_settings.py +134 -0
- cumulusci/tasks/salesforce/custom_settings_wait.py +132 -0
- cumulusci/tasks/salesforce/enable_prediction.py +107 -0
- cumulusci/tasks/salesforce/insert_record.py +40 -0
- cumulusci/tasks/salesforce/install_package_version.py +242 -0
- cumulusci/tasks/salesforce/license_preflights.py +8 -0
- cumulusci/tasks/salesforce/network_member_group.py +178 -0
- cumulusci/tasks/salesforce/nonsourcetracking.py +228 -0
- cumulusci/tasks/salesforce/org_settings.py +193 -0
- cumulusci/tasks/salesforce/package_upload.py +328 -0
- cumulusci/tasks/salesforce/profiles.py +74 -0
- cumulusci/tasks/salesforce/promote_package_version.py +376 -0
- cumulusci/tasks/salesforce/retrieve_profile.py +195 -0
- cumulusci/tasks/salesforce/salesforce_files.py +244 -0
- cumulusci/tasks/salesforce/sourcetracking.py +507 -0
- cumulusci/tasks/salesforce/tests/__init__.py +3 -0
- cumulusci/tasks/salesforce/tests/test_CreateCommunity.py +278 -0
- cumulusci/tasks/salesforce/tests/test_CreatePackage.py +22 -0
- cumulusci/tasks/salesforce/tests/test_Deploy.py +470 -0
- cumulusci/tasks/salesforce/tests/test_DeployBundles.py +76 -0
- cumulusci/tasks/salesforce/tests/test_EnsureRecordTypes.py +345 -0
- cumulusci/tasks/salesforce/tests/test_ListCommunities.py +84 -0
- cumulusci/tasks/salesforce/tests/test_ListCommunityTemplates.py +49 -0
- cumulusci/tasks/salesforce/tests/test_PackageUpload.py +547 -0
- cumulusci/tasks/salesforce/tests/test_ProfileGrantAllAccess.py +699 -0
- cumulusci/tasks/salesforce/tests/test_PublishCommunity.py +181 -0
- cumulusci/tasks/salesforce/tests/test_RetrievePackaged.py +24 -0
- cumulusci/tasks/salesforce/tests/test_RetrieveReportsAndDashboards.py +56 -0
- cumulusci/tasks/salesforce/tests/test_RetrieveUnpackaged.py +21 -0
- cumulusci/tasks/salesforce/tests/test_SOQLQuery.py +30 -0
- cumulusci/tasks/salesforce/tests/test_UninstallLocal.py +15 -0
- cumulusci/tasks/salesforce/tests/test_UninstallLocalBundles.py +19 -0
- cumulusci/tasks/salesforce/tests/test_UninstallLocalNamespacedBundles.py +22 -0
- cumulusci/tasks/salesforce/tests/test_UninstallPackage.py +19 -0
- cumulusci/tasks/salesforce/tests/test_UninstallPackaged.py +66 -0
- cumulusci/tasks/salesforce/tests/test_UninstallPackagedIncremental.py +127 -0
- cumulusci/tasks/salesforce/tests/test_activate_flow.py +132 -0
- cumulusci/tasks/salesforce/tests/test_base_tasks.py +110 -0
- cumulusci/tasks/salesforce/tests/test_check_components.py +445 -0
- cumulusci/tasks/salesforce/tests/test_composite.py +250 -0
- cumulusci/tasks/salesforce/tests/test_create_permission_sets.py +41 -0
- cumulusci/tasks/salesforce/tests/test_custom_settings.py +227 -0
- cumulusci/tasks/salesforce/tests/test_custom_settings_wait.py +174 -0
- cumulusci/tasks/salesforce/tests/test_describemetadatatypes.py +18 -0
- cumulusci/tasks/salesforce/tests/test_enable_prediction.py +240 -0
- cumulusci/tasks/salesforce/tests/test_insert_record.py +110 -0
- cumulusci/tasks/salesforce/tests/test_install_package_version.py +464 -0
- cumulusci/tasks/salesforce/tests/test_network_member_group.py +444 -0
- cumulusci/tasks/salesforce/tests/test_nonsourcetracking.py +235 -0
- cumulusci/tasks/salesforce/tests/test_org_settings.py +407 -0
- cumulusci/tasks/salesforce/tests/test_profiles.py +202 -0
- cumulusci/tasks/salesforce/tests/test_retrieve_profile.py +287 -0
- cumulusci/tasks/salesforce/tests/test_salesforce_files.py +228 -0
- cumulusci/tasks/salesforce/tests/test_sourcetracking.py +350 -0
- cumulusci/tasks/salesforce/tests/test_trigger_handlers.py +300 -0
- cumulusci/tasks/salesforce/tests/test_update_dependencies.py +509 -0
- cumulusci/tasks/salesforce/tests/util.py +79 -0
- cumulusci/tasks/salesforce/trigger_handlers.py +119 -0
- cumulusci/tasks/salesforce/uninstall_packaged_incremental.py +136 -0
- cumulusci/tasks/salesforce/update_dependencies.py +290 -0
- cumulusci/tasks/salesforce/update_profile.py +339 -0
- cumulusci/tasks/salesforce/users/permsets.py +227 -0
- cumulusci/tasks/salesforce/users/photos.py +162 -0
- cumulusci/tasks/salesforce/users/tests/photo.mock.txt +1 -0
- cumulusci/tasks/salesforce/users/tests/test_permsets.py +950 -0
- cumulusci/tasks/salesforce/users/tests/test_photos.py +373 -0
- cumulusci/tasks/sample_data/capture_sample_data.py +77 -0
- cumulusci/tasks/sample_data/load_sample_data.py +85 -0
- cumulusci/tasks/sample_data/test_capture_sample_data.py +117 -0
- cumulusci/tasks/sample_data/test_load_sample_data.py +121 -0
- cumulusci/tasks/sfdx.py +83 -0
- cumulusci/tasks/tests/__init__.py +1 -0
- cumulusci/tasks/tests/conftest.py +30 -0
- cumulusci/tasks/tests/test_command.py +129 -0
- cumulusci/tasks/tests/test_connectedapp.py +236 -0
- cumulusci/tasks/tests/test_create_package_version.py +847 -0
- cumulusci/tasks/tests/test_datadictionary.py +1575 -0
- cumulusci/tasks/tests/test_dx_convert_from.py +60 -0
- cumulusci/tasks/tests/test_metadeploy.py +624 -0
- cumulusci/tasks/tests/test_metaxml.py +99 -0
- cumulusci/tasks/tests/test_promote_package_version.py +488 -0
- cumulusci/tasks/tests/test_pushfails.py +96 -0
- cumulusci/tasks/tests/test_salesforce.py +72 -0
- cumulusci/tasks/tests/test_sfdx.py +105 -0
- cumulusci/tasks/tests/test_util.py +207 -0
- cumulusci/tasks/util.py +261 -0
- cumulusci/tasks/vcs/__init__.py +19 -0
- cumulusci/tasks/vcs/commit_status.py +58 -0
- cumulusci/tasks/vcs/create_commit_status.py +37 -0
- cumulusci/tasks/vcs/download_extract.py +199 -0
- cumulusci/tasks/vcs/merge.py +298 -0
- cumulusci/tasks/vcs/publish.py +207 -0
- cumulusci/tasks/vcs/pull_request.py +9 -0
- cumulusci/tasks/vcs/release.py +134 -0
- cumulusci/tasks/vcs/release_report.py +105 -0
- cumulusci/tasks/vcs/tag.py +31 -0
- cumulusci/tasks/vcs/tests/github/test_commit_status.py +196 -0
- cumulusci/tasks/vcs/tests/github/test_download_extract.py +896 -0
- cumulusci/tasks/vcs/tests/github/test_merge.py +1118 -0
- cumulusci/tasks/vcs/tests/github/test_publish.py +823 -0
- cumulusci/tasks/vcs/tests/github/test_pull_request.py +29 -0
- cumulusci/tasks/vcs/tests/github/test_release.py +390 -0
- cumulusci/tasks/vcs/tests/github/test_release_report.py +109 -0
- cumulusci/tasks/vcs/tests/github/test_tag.py +90 -0
- cumulusci/tasks/vlocity/exceptions.py +2 -0
- cumulusci/tasks/vlocity/tests/test_vlocity.py +283 -0
- cumulusci/tasks/vlocity/vlocity.py +342 -0
- cumulusci/tests/__init__.py +1 -0
- cumulusci/tests/cassettes/GET_sobjects_Account_PersonAccount_describe.yaml +18 -0
- cumulusci/tests/cassettes/TestIntegrationInfrastructure.test_integration_tests.yaml +19 -0
- cumulusci/tests/pytest_plugins/pytest_sf_orgconnect.py +307 -0
- cumulusci/tests/pytest_plugins/pytest_sf_vcr.py +275 -0
- cumulusci/tests/pytest_plugins/pytest_sf_vcr_serializer.py +160 -0
- cumulusci/tests/pytest_plugins/pytest_typeguard.py +5 -0
- cumulusci/tests/pytest_plugins/test_vcr_string_compressor.py +49 -0
- cumulusci/tests/pytest_plugins/vcr_string_compressor.py +97 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_Account_describe.yaml +18 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_Case_describe.yaml +18 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_Contact_describe.yaml +4838 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_Custom__c_describe.yaml +242 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_Event_describe.yaml +19 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_Global_describe.yaml +1338 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_Lead_describe.yaml +18 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_OpportunityContactRole_describe.yaml +34 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_Opportunity_describe.yaml +1261 -0
- cumulusci/tests/shared_cassettes/GET_sobjects_Organization.yaml +49 -0
- cumulusci/tests/shared_cassettes/vcr_string_templates/batchInfoList_xml.tpl +15 -0
- cumulusci/tests/shared_cassettes/vcr_string_templates/batchInfo_xml.tpl +13 -0
- cumulusci/tests/shared_cassettes/vcr_string_templates/jobInfo_insert_xml.tpl +24 -0
- cumulusci/tests/shared_cassettes/vcr_string_templates/jobInfo_upsert_xml.tpl +25 -0
- cumulusci/tests/test_entry_points.py +20 -0
- cumulusci/tests/test_integration_infrastructure.py +131 -0
- cumulusci/tests/test_main.py +9 -0
- cumulusci/tests/test_schema.py +32 -0
- cumulusci/tests/test_utils.py +657 -0
- cumulusci/tests/test_vcr_serializer.py +134 -0
- cumulusci/tests/uncompressed_cassette.yaml +83 -0
- cumulusci/tests/util.py +344 -0
- cumulusci/utils/__init__.py +731 -0
- cumulusci/utils/classutils.py +9 -0
- cumulusci/utils/collections.py +32 -0
- cumulusci/utils/deprecation.py +11 -0
- cumulusci/utils/encryption.py +31 -0
- cumulusci/utils/fileutils.py +295 -0
- cumulusci/utils/git.py +142 -0
- cumulusci/utils/http/multi_request.py +214 -0
- cumulusci/utils/http/requests_utils.py +103 -0
- cumulusci/utils/http/tests/cassettes/ManualEditTestCompositeParallelSalesforce.test_http_headers.yaml +32 -0
- cumulusci/utils/http/tests/cassettes/TestCompositeParallelSalesforce.test_composite_parallel_salesforce.yaml +65 -0
- cumulusci/utils/http/tests/cassettes/TestCompositeParallelSalesforce.test_errors.yaml +24 -0
- cumulusci/utils/http/tests/cassettes/TestCompositeParallelSalesforce.test_reference_ids.yaml +49 -0
- cumulusci/utils/http/tests/test_multi_request.py +255 -0
- cumulusci/utils/iterators.py +21 -0
- cumulusci/utils/logging.py +128 -0
- cumulusci/utils/metaprogramming.py +10 -0
- cumulusci/utils/options.py +138 -0
- cumulusci/utils/parallel/queries_in_parallel/run_queries_in_parallel.py +29 -0
- cumulusci/utils/parallel/queries_in_parallel/tests/test_run_queries_in_parallel.py +50 -0
- cumulusci/utils/parallel/task_worker_queues/parallel_worker.py +238 -0
- cumulusci/utils/parallel/task_worker_queues/parallel_worker_queue.py +243 -0
- cumulusci/utils/parallel/task_worker_queues/tests/test_parallel_worker.py +353 -0
- cumulusci/utils/salesforce/count_sobjects.py +46 -0
- cumulusci/utils/salesforce/soql.py +17 -0
- cumulusci/utils/salesforce/tests/cassettes/ManualEdit_TestCountSObjects.test_count_sobjects__network_errors.yaml +23 -0
- cumulusci/utils/salesforce/tests/cassettes/TestCountSObjects.test_count_sobjects__errors.yaml +33 -0
- cumulusci/utils/salesforce/tests/cassettes/TestCountSObjects.test_count_sobjects_simple.yaml +29 -0
- cumulusci/utils/salesforce/tests/test_count_sobjects.py +29 -0
- cumulusci/utils/salesforce/tests/test_soql.py +30 -0
- cumulusci/utils/tests/cassettes/ManualEditTestDescribeOrg.test_minimal_schema.yaml +36 -0
- cumulusci/utils/tests/cassettes/ManualEdit_test_describe_to_sql.yaml +191 -0
- cumulusci/utils/tests/test_fileutils.py +284 -0
- cumulusci/utils/tests/test_git.py +85 -0
- cumulusci/utils/tests/test_logging.py +70 -0
- cumulusci/utils/tests/test_option_parsing.py +188 -0
- cumulusci/utils/tests/test_org_schema.py +691 -0
- cumulusci/utils/tests/test_org_schema_models.py +79 -0
- cumulusci/utils/tests/test_waiting.py +25 -0
- cumulusci/utils/version_strings.py +391 -0
- cumulusci/utils/waiting.py +42 -0
- cumulusci/utils/xml/__init__.py +91 -0
- cumulusci/utils/xml/metadata_tree.py +299 -0
- cumulusci/utils/xml/robot_xml.py +114 -0
- cumulusci/utils/xml/salesforce_encoding.py +100 -0
- cumulusci/utils/xml/test/test_metadata_tree.py +251 -0
- cumulusci/utils/xml/test/test_salesforce_encoding.py +173 -0
- cumulusci/utils/yaml/cumulusci_yml.py +401 -0
- cumulusci/utils/yaml/model_parser.py +156 -0
- cumulusci/utils/yaml/safer_loader.py +74 -0
- cumulusci/utils/yaml/tests/bad_cci.yml +5 -0
- cumulusci/utils/yaml/tests/cassettes/TestCumulusciYml.test_validate_url__with_errors.yaml +20 -0
- cumulusci/utils/yaml/tests/test_cumulusci_yml.py +286 -0
- cumulusci/utils/yaml/tests/test_model_parser.py +175 -0
- cumulusci/utils/yaml/tests/test_safer_loader.py +88 -0
- cumulusci/utils/ziputils.py +61 -0
- cumulusci/vcs/base.py +143 -0
- cumulusci/vcs/bootstrap.py +272 -0
- cumulusci/vcs/github/__init__.py +24 -0
- cumulusci/vcs/github/adapter.py +689 -0
- cumulusci/vcs/github/release_notes/generator.py +219 -0
- cumulusci/vcs/github/release_notes/parser.py +151 -0
- cumulusci/vcs/github/release_notes/provider.py +143 -0
- cumulusci/vcs/github/service.py +569 -0
- cumulusci/vcs/github/tests/test_adapter.py +138 -0
- cumulusci/vcs/github/tests/test_service.py +408 -0
- cumulusci/vcs/models.py +586 -0
- cumulusci/vcs/tests/conftest.py +41 -0
- cumulusci/vcs/tests/dummy_service.py +241 -0
- cumulusci/vcs/tests/test_vcs_base.py +687 -0
- cumulusci/vcs/tests/test_vcs_bootstrap.py +727 -0
- cumulusci/vcs/utils/__init__.py +31 -0
- cumulusci/vcs/vcs_source.py +287 -0
- cumulusci_plus-5.0.0.dist-info/METADATA +145 -0
- cumulusci_plus-5.0.0.dist-info/RECORD +744 -0
- cumulusci_plus-5.0.0.dist-info/WHEEL +4 -0
- cumulusci_plus-5.0.0.dist-info/entry_points.txt +3 -0
- cumulusci_plus-5.0.0.dist-info/licenses/AUTHORS.rst +41 -0
- cumulusci_plus-5.0.0.dist-info/licenses/LICENSE +30 -0
cumulusci/cli/org.py
ADDED
|
@@ -0,0 +1,692 @@
|
|
|
1
|
+
import code
|
|
2
|
+
import json
|
|
3
|
+
import runpy
|
|
4
|
+
import webbrowser
|
|
5
|
+
from datetime import datetime
|
|
6
|
+
from urllib.parse import urlencode, urlparse
|
|
7
|
+
|
|
8
|
+
import click
|
|
9
|
+
from rich.console import Console
|
|
10
|
+
|
|
11
|
+
from cumulusci.cli.ui import CliTable, SimpleSalesforceUIHelpers
|
|
12
|
+
from cumulusci.core.config import OrgConfig, ScratchOrgConfig
|
|
13
|
+
from cumulusci.core.config.sfdx_org_config import SfdxOrgConfig
|
|
14
|
+
from cumulusci.core.exceptions import OrgNotFound
|
|
15
|
+
from cumulusci.oauth.client import (
|
|
16
|
+
PROD_LOGIN_URL,
|
|
17
|
+
SANDBOX_LOGIN_URL,
|
|
18
|
+
OAuth2Client,
|
|
19
|
+
OAuth2ClientConfig,
|
|
20
|
+
)
|
|
21
|
+
from cumulusci.salesforce_api.utils import get_simple_salesforce_connection
|
|
22
|
+
from cumulusci.utils import parse_api_datetime
|
|
23
|
+
|
|
24
|
+
from .runtime import CliRuntime, pass_runtime
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@click.group("org", help="Commands for connecting and interacting with Salesforce orgs")
|
|
28
|
+
def org():
|
|
29
|
+
pass
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def set_org_name(required):
|
|
33
|
+
"""Generate a callback for processing the `org_name` option or argument
|
|
34
|
+
|
|
35
|
+
`required` is a boolean for whether org_name is required
|
|
36
|
+
"""
|
|
37
|
+
# could be generalized to work for any mutex pair (or list) but no obvious need
|
|
38
|
+
def callback(ctx, param, value):
|
|
39
|
+
"""Callback which enforces mutex and 'required' behaviour (if required)."""
|
|
40
|
+
prev_value = ctx.params.get("org_name")
|
|
41
|
+
if value and prev_value and prev_value != value:
|
|
42
|
+
raise click.UsageError(
|
|
43
|
+
f"Either ORGNAME or --org ORGNAME should be supplied, not both ({value}, {prev_value})"
|
|
44
|
+
)
|
|
45
|
+
ctx.params["org_name"] = value or prev_value
|
|
46
|
+
if required and not ctx.params.get("org_name"):
|
|
47
|
+
raise click.UsageError("Please specify ORGNAME or --org ORGNAME")
|
|
48
|
+
|
|
49
|
+
return callback
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def orgname_option_or_argument(*, required):
|
|
53
|
+
"""Create decorator that allows org_name to be an option or an argument"""
|
|
54
|
+
|
|
55
|
+
def decorator(func):
|
|
56
|
+
if required:
|
|
57
|
+
message = "One of ORGNAME (see above) or --org is required."
|
|
58
|
+
else:
|
|
59
|
+
message = "By default, runs against the current default org."
|
|
60
|
+
|
|
61
|
+
opt_version = click.option(
|
|
62
|
+
"--org",
|
|
63
|
+
callback=set_org_name(
|
|
64
|
+
False
|
|
65
|
+
), # never required because arg-version may be specified
|
|
66
|
+
expose_value=False,
|
|
67
|
+
help=f"Alternate way to specify the target org. {message}",
|
|
68
|
+
)
|
|
69
|
+
# "required" checking is handled in the callback because it has more context
|
|
70
|
+
# about whether its already seen it.
|
|
71
|
+
arg_version = click.argument(
|
|
72
|
+
"orgname",
|
|
73
|
+
required=False,
|
|
74
|
+
callback=set_org_name(required),
|
|
75
|
+
expose_value=False,
|
|
76
|
+
)
|
|
77
|
+
return arg_version(opt_version(func))
|
|
78
|
+
|
|
79
|
+
return decorator
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
@org.command(
|
|
83
|
+
name="browser",
|
|
84
|
+
help="Opens a browser window and logs into the org using the stored OAuth credentials",
|
|
85
|
+
)
|
|
86
|
+
@orgname_option_or_argument(required=False)
|
|
87
|
+
@click.option(
|
|
88
|
+
"-p",
|
|
89
|
+
"--path",
|
|
90
|
+
required=False,
|
|
91
|
+
help="Navigate to the specified page after logging in.",
|
|
92
|
+
)
|
|
93
|
+
@click.option(
|
|
94
|
+
"-r",
|
|
95
|
+
"--url-only",
|
|
96
|
+
is_flag=True,
|
|
97
|
+
help="Display the target URL, but don't open a browser.",
|
|
98
|
+
)
|
|
99
|
+
@pass_runtime(require_project=False, require_keychain=True)
|
|
100
|
+
def org_browser(runtime, org_name, path, url_only):
|
|
101
|
+
org_name, org_config = runtime.get_org(org_name)
|
|
102
|
+
org_config.refresh_oauth_token(runtime.keychain)
|
|
103
|
+
|
|
104
|
+
target = org_config.start_url
|
|
105
|
+
if path:
|
|
106
|
+
ret_url = urlencode({"retURL": path})
|
|
107
|
+
target = f"{target}&{ret_url}"
|
|
108
|
+
|
|
109
|
+
if url_only:
|
|
110
|
+
click.echo(target)
|
|
111
|
+
else:
|
|
112
|
+
webbrowser.open(target)
|
|
113
|
+
|
|
114
|
+
# Save the org config in case it was modified
|
|
115
|
+
org_config.save()
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def setup_client(connected_app, login_url=None, sandbox=None) -> OAuth2Client:
|
|
119
|
+
"""Provides an OAuth2Client for connecting an Org"""
|
|
120
|
+
if login_url:
|
|
121
|
+
base_uri = login_url
|
|
122
|
+
elif sandbox:
|
|
123
|
+
base_uri = SANDBOX_LOGIN_URL
|
|
124
|
+
elif connected_app.login_url:
|
|
125
|
+
base_uri = connected_app.login_url
|
|
126
|
+
else:
|
|
127
|
+
base_uri = PROD_LOGIN_URL
|
|
128
|
+
base_uri = base_uri.rstrip("/")
|
|
129
|
+
|
|
130
|
+
sf_client_config = OAuth2ClientConfig(
|
|
131
|
+
client_id=connected_app.client_id,
|
|
132
|
+
client_secret=connected_app.client_secret,
|
|
133
|
+
redirect_uri=connected_app.callback_url,
|
|
134
|
+
auth_uri=f"{base_uri}/services/oauth2/authorize",
|
|
135
|
+
token_uri=f"{base_uri}/services/oauth2/token",
|
|
136
|
+
scope="web full refresh_token",
|
|
137
|
+
)
|
|
138
|
+
return OAuth2Client(sf_client_config)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def connect_org_to_keychain(
|
|
142
|
+
client: OAuth2Client,
|
|
143
|
+
runtime,
|
|
144
|
+
global_org: bool,
|
|
145
|
+
org_name: str,
|
|
146
|
+
connected_app: str,
|
|
147
|
+
) -> None:
|
|
148
|
+
"""Use the given client to authorize into an org, and save the
|
|
149
|
+
new OrgConfig to the keychain."""
|
|
150
|
+
oauth_dict = client.auth_code_flow(prompt="login")
|
|
151
|
+
|
|
152
|
+
global_org = global_org or runtime.project_config is None
|
|
153
|
+
org_config = OrgConfig(oauth_dict, org_name, runtime.keychain, global_org)
|
|
154
|
+
org_config.config["connected_app"] = connected_app
|
|
155
|
+
org_config.load_userinfo()
|
|
156
|
+
org_config.populate_expiration_date()
|
|
157
|
+
|
|
158
|
+
org_config.save()
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
@org.command(
|
|
162
|
+
name="connect", help="Connects a new org's credentials using OAuth Web Flow"
|
|
163
|
+
)
|
|
164
|
+
@orgname_option_or_argument(required=True)
|
|
165
|
+
@click.option(
|
|
166
|
+
"--connected-app",
|
|
167
|
+
"--connected_app",
|
|
168
|
+
"connected_app_name",
|
|
169
|
+
help="Name of the connected_app service to use.",
|
|
170
|
+
)
|
|
171
|
+
@click.option(
|
|
172
|
+
"--sandbox", is_flag=True, help="If set, connects to a Salesforce sandbox org"
|
|
173
|
+
)
|
|
174
|
+
@click.option(
|
|
175
|
+
"--login-url",
|
|
176
|
+
help="If set, login to this hostname.",
|
|
177
|
+
)
|
|
178
|
+
@click.option(
|
|
179
|
+
"--default",
|
|
180
|
+
is_flag=True,
|
|
181
|
+
help="If set, sets the connected org as the new default org",
|
|
182
|
+
)
|
|
183
|
+
@click.option(
|
|
184
|
+
"--global-org",
|
|
185
|
+
help="If set, the connected org is available to all CumulusCI projects.",
|
|
186
|
+
is_flag=True,
|
|
187
|
+
)
|
|
188
|
+
@pass_runtime(require_project=False, require_keychain=True)
|
|
189
|
+
def org_connect(
|
|
190
|
+
runtime, org_name, sandbox, login_url, default, global_org, connected_app_name=None
|
|
191
|
+
):
|
|
192
|
+
runtime.check_org_overwrite(org_name)
|
|
193
|
+
|
|
194
|
+
if login_url and ".lightning." in login_url:
|
|
195
|
+
raise click.UsageError(
|
|
196
|
+
"Connecting an org with a lightning.force.com URL does not work. "
|
|
197
|
+
"Use the my.salesforce.com version instead"
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
connected_app_name = (
|
|
201
|
+
connected_app_name or runtime.keychain.get_default_service_name("connected_app")
|
|
202
|
+
)
|
|
203
|
+
click.echo(f"Connecting org using the {connected_app_name} connected app...")
|
|
204
|
+
connected_app = runtime.keychain.get_service("connected_app", connected_app_name)
|
|
205
|
+
sf_client = setup_client(connected_app, login_url, sandbox)
|
|
206
|
+
connect_org_to_keychain(
|
|
207
|
+
sf_client, runtime, global_org, org_name, connected_app_name
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
if default and runtime.project_config is not None:
|
|
211
|
+
runtime.keychain.set_default_org(org_name)
|
|
212
|
+
click.echo(f"{org_name} is now the default org")
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
@org.command(name="default", help="Sets an org as the default org for tasks and flows")
|
|
216
|
+
@orgname_option_or_argument(required=False)
|
|
217
|
+
@click.option(
|
|
218
|
+
"--unset",
|
|
219
|
+
is_flag=True,
|
|
220
|
+
help="Unset the org as the default org leaving no default org selected",
|
|
221
|
+
)
|
|
222
|
+
@pass_runtime(require_keychain=True)
|
|
223
|
+
def org_default(runtime, org_name, unset):
|
|
224
|
+
if unset:
|
|
225
|
+
runtime.keychain.unset_default_org()
|
|
226
|
+
click.echo("Default org unset")
|
|
227
|
+
elif org_name:
|
|
228
|
+
runtime.keychain.set_default_org(org_name)
|
|
229
|
+
click.echo(f"{org_name} is now the default org")
|
|
230
|
+
else:
|
|
231
|
+
orgname, org_config = runtime.keychain.get_default_org()
|
|
232
|
+
if orgname:
|
|
233
|
+
click.echo(f"{orgname} is the default org")
|
|
234
|
+
else:
|
|
235
|
+
click.echo("There is no default org")
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
@org.command(name="import", help="Import an org from Salesforce DX")
|
|
239
|
+
@click.argument("username_or_alias")
|
|
240
|
+
@orgname_option_or_argument(required=True)
|
|
241
|
+
@pass_runtime(require_keychain=True)
|
|
242
|
+
def org_import(runtime: CliRuntime, username_or_alias: str, org_name: str):
|
|
243
|
+
# Import the org from the SFDX keychain as an SfdxOrgConfig
|
|
244
|
+
# The `sfdx` key ensures we can reload using the right class.
|
|
245
|
+
org_config = SfdxOrgConfig(
|
|
246
|
+
{"username": username_or_alias, "sfdx": True},
|
|
247
|
+
org_name,
|
|
248
|
+
runtime.keychain,
|
|
249
|
+
global_org=False,
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
# Determine if we received a locally-created scratch org
|
|
253
|
+
# or some other org (which we'll treat as persistent)
|
|
254
|
+
|
|
255
|
+
info = org_config.sfdx_info
|
|
256
|
+
if info.get("created_date"):
|
|
257
|
+
# This is a locally-created scratch org.
|
|
258
|
+
# Re-import accordingly.
|
|
259
|
+
org_config = ScratchOrgConfig(
|
|
260
|
+
{"username": username_or_alias},
|
|
261
|
+
org_name,
|
|
262
|
+
runtime.keychain,
|
|
263
|
+
global_org=False,
|
|
264
|
+
)
|
|
265
|
+
org_config._sfdx_info = info
|
|
266
|
+
# Set `created` so we don't try to rebuild it.
|
|
267
|
+
org_config.config["created"] = True
|
|
268
|
+
|
|
269
|
+
org_config.config["days"] = calculate_org_days(info)
|
|
270
|
+
org_config.config["date_created"] = parse_api_datetime(info["created_date"])
|
|
271
|
+
|
|
272
|
+
org_config.save()
|
|
273
|
+
click.echo(
|
|
274
|
+
"Imported scratch org: {org_id}, username: {username}".format(
|
|
275
|
+
**org_config.sfdx_info
|
|
276
|
+
)
|
|
277
|
+
)
|
|
278
|
+
else:
|
|
279
|
+
# This is either a persistent org or a scratch org imported into the
|
|
280
|
+
# sfdx keychain via OAuth login.
|
|
281
|
+
org_config.populate_expiration_date()
|
|
282
|
+
org_config.save()
|
|
283
|
+
click.echo(
|
|
284
|
+
"Imported org: {org_id}, username: {username}".format(
|
|
285
|
+
**org_config.sfdx_info
|
|
286
|
+
)
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
def calculate_org_days(info):
|
|
291
|
+
"""Returns the difference in days between created_date (ISO 8601),
|
|
292
|
+
and expiration_date (%Y-%m-%d)"""
|
|
293
|
+
if not info.get("created_date") or not info.get("expiration_date"):
|
|
294
|
+
return 1
|
|
295
|
+
created_date = parse_api_datetime(info["created_date"]).date()
|
|
296
|
+
expires_date = datetime.strptime(info["expiration_date"], "%Y-%m-%d").date()
|
|
297
|
+
return abs((expires_date - created_date).days)
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
@org.command(name="info", help="Display information for a connected org")
|
|
301
|
+
@orgname_option_or_argument(required=False)
|
|
302
|
+
@click.option(
|
|
303
|
+
"print_json", "--json", is_flag=True, help="Print as JSON. Includes access token."
|
|
304
|
+
)
|
|
305
|
+
@pass_runtime(require_project=False, require_keychain=True)
|
|
306
|
+
def org_info(runtime, org_name, print_json):
|
|
307
|
+
org_name, org_config = runtime.get_org(org_name)
|
|
308
|
+
org_config.refresh_oauth_token(runtime.keychain, print_json)
|
|
309
|
+
console = Console()
|
|
310
|
+
if print_json:
|
|
311
|
+
click.echo(
|
|
312
|
+
json.dumps(
|
|
313
|
+
org_config.config,
|
|
314
|
+
sort_keys=True,
|
|
315
|
+
indent=4,
|
|
316
|
+
default=str,
|
|
317
|
+
separators=(",", ": "),
|
|
318
|
+
)
|
|
319
|
+
)
|
|
320
|
+
else:
|
|
321
|
+
ui_key_set = {
|
|
322
|
+
"config_file",
|
|
323
|
+
"config_name",
|
|
324
|
+
"connected_app",
|
|
325
|
+
"created",
|
|
326
|
+
"date_created",
|
|
327
|
+
"days",
|
|
328
|
+
"default",
|
|
329
|
+
"email_address",
|
|
330
|
+
"instance_url",
|
|
331
|
+
"instance_name",
|
|
332
|
+
"is_sandbox",
|
|
333
|
+
"namespace",
|
|
334
|
+
"namespaced",
|
|
335
|
+
"org_id",
|
|
336
|
+
"org_type",
|
|
337
|
+
"password",
|
|
338
|
+
"scratch",
|
|
339
|
+
"scratch_org_type",
|
|
340
|
+
"set_password",
|
|
341
|
+
"serialization_format", # only during the transition
|
|
342
|
+
"sfdx_alias",
|
|
343
|
+
"username",
|
|
344
|
+
}
|
|
345
|
+
keys = ui_key_set.intersection(org_config.config.keys())
|
|
346
|
+
pairs = [[key, str(org_config.config[key])] for key in keys]
|
|
347
|
+
pairs.append(["api_version", org_config.latest_api_version])
|
|
348
|
+
pairs.sort()
|
|
349
|
+
table_data = [[f"Org: {org_name}", ""]]
|
|
350
|
+
table_data.extend(
|
|
351
|
+
[[click.style(key, bold=True), value] for key, value in pairs]
|
|
352
|
+
)
|
|
353
|
+
table = CliTable(
|
|
354
|
+
table_data,
|
|
355
|
+
)
|
|
356
|
+
console.print(table)
|
|
357
|
+
|
|
358
|
+
if org_config.scratch and org_config.expires:
|
|
359
|
+
console.print("Org expires on {:%c}".format(org_config.expires))
|
|
360
|
+
|
|
361
|
+
# Save the org config in case it was modified
|
|
362
|
+
org_config.save()
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
@org.command(name="list", help="Lists all orgs in scope for the current project")
|
|
366
|
+
@click.option("--plain", is_flag=True, help="Print the table using plain ascii.")
|
|
367
|
+
@click.option(
|
|
368
|
+
"--json", "json_flag", is_flag=True, help="Output results in JSON format."
|
|
369
|
+
)
|
|
370
|
+
@pass_runtime(require_project=False, require_keychain=True)
|
|
371
|
+
def org_list(runtime, json_flag, plain):
|
|
372
|
+
def _get_org_safe(org):
|
|
373
|
+
try:
|
|
374
|
+
return runtime.keychain.get_org(org)
|
|
375
|
+
except Exception as e:
|
|
376
|
+
click.echo(f"Cannot load org config for `{org}`: {e}")
|
|
377
|
+
|
|
378
|
+
plain = plain or runtime.universal_config.cli__plain_output
|
|
379
|
+
org_configs = ((org, _get_org_safe(org)) for org in runtime.keychain.list_orgs())
|
|
380
|
+
org_configs = {org: org_config for org, org_config in org_configs if org_config}
|
|
381
|
+
|
|
382
|
+
json_data = {}
|
|
383
|
+
try:
|
|
384
|
+
default_org_name, _ = runtime.keychain.get_default_org()
|
|
385
|
+
except Exception: # pragma: no cover
|
|
386
|
+
default_org_name = None
|
|
387
|
+
|
|
388
|
+
for org, org_config in org_configs.items():
|
|
389
|
+
is_org_default = org == default_org_name
|
|
390
|
+
row_data = {"is_default": is_org_default, "name": org}
|
|
391
|
+
row_data.update(_get_org_dict(org_config))
|
|
392
|
+
json_data[row_data["name"]] = row_data
|
|
393
|
+
|
|
394
|
+
if json_flag:
|
|
395
|
+
click.echo(json.dumps(json_data))
|
|
396
|
+
return
|
|
397
|
+
|
|
398
|
+
console = Console()
|
|
399
|
+
scratch_table, persistent_table = _make_tables(json_data)
|
|
400
|
+
console.print(scratch_table, justify="left")
|
|
401
|
+
console.print(persistent_table, justify="left")
|
|
402
|
+
|
|
403
|
+
try:
|
|
404
|
+
runtime.keychain.cleanup_org_cache_dirs()
|
|
405
|
+
except Exception:
|
|
406
|
+
click.echo(
|
|
407
|
+
"Cannot cleanup org cache dirs, perhaps due to org config files which cannot be decrypted."
|
|
408
|
+
)
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
def _make_tables(json_data: dict):
|
|
412
|
+
scratch_keys = [
|
|
413
|
+
key for key, row_dict in json_data.items() if row_dict.pop("is_scratch")
|
|
414
|
+
]
|
|
415
|
+
scratch_data = [["Default", "Name", "Days", "Expired", "Config", "Domain"]]
|
|
416
|
+
scratch_data.extend([list(json_data.pop(k).values()) for k in scratch_keys])
|
|
417
|
+
|
|
418
|
+
rows_to_dim = [row_index for row_index, row in enumerate(scratch_data) if row[3]]
|
|
419
|
+
scratch = CliTable(scratch_data, title="Scratch Orgs", dim_rows=rows_to_dim)
|
|
420
|
+
|
|
421
|
+
persistent_data = [["Default", "Name", "Username", "Expires"]]
|
|
422
|
+
persistent_data.extend([list(row_dict.values()) for row_dict in json_data.values()])
|
|
423
|
+
persistent = CliTable(persistent_data, title="Connected Orgs")
|
|
424
|
+
|
|
425
|
+
return scratch.table, persistent.table
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
def _get_org_dict(org_config):
|
|
429
|
+
if isinstance(org_config, ScratchOrgConfig):
|
|
430
|
+
return _format_scratch_org_data(org_config)
|
|
431
|
+
else:
|
|
432
|
+
return {
|
|
433
|
+
"username": org_config.config.get(
|
|
434
|
+
"username", org_config.userinfo__preferred_username
|
|
435
|
+
),
|
|
436
|
+
"expires": org_config.expires or "Unknown",
|
|
437
|
+
"is_scratch": False,
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
def _format_scratch_org_data(org_config):
|
|
442
|
+
org_days = org_config.format_org_days()
|
|
443
|
+
if org_config.expired:
|
|
444
|
+
domain = ""
|
|
445
|
+
else:
|
|
446
|
+
instance_url = org_config.config.get("instance_url", "")
|
|
447
|
+
domain = (urlparse(instance_url).hostname or "").replace(
|
|
448
|
+
".my.salesforce.com", ""
|
|
449
|
+
)
|
|
450
|
+
return {
|
|
451
|
+
"days": org_days,
|
|
452
|
+
"expired": org_config.expired,
|
|
453
|
+
"config": org_config.config_name,
|
|
454
|
+
"domain": domain,
|
|
455
|
+
"is_scratch": True,
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
@org.command(
|
|
460
|
+
name="prune", help="Removes all expired scratch orgs from the current project"
|
|
461
|
+
)
|
|
462
|
+
@click.option(
|
|
463
|
+
"--include-active",
|
|
464
|
+
is_flag=True,
|
|
465
|
+
help="Remove all scratch orgs, regardless of expiry.",
|
|
466
|
+
)
|
|
467
|
+
@pass_runtime(require_project=True, require_keychain=True)
|
|
468
|
+
def org_prune(runtime, include_active=False):
|
|
469
|
+
|
|
470
|
+
predefined_scratch_configs = runtime.project_config.lookup("orgs__scratch", {})
|
|
471
|
+
|
|
472
|
+
expired_orgs_removed = []
|
|
473
|
+
active_orgs_removed = []
|
|
474
|
+
org_shapes_skipped = []
|
|
475
|
+
active_orgs_skipped = []
|
|
476
|
+
for org_name in runtime.keychain.list_orgs():
|
|
477
|
+
|
|
478
|
+
org_config = runtime.keychain.get_org(org_name)
|
|
479
|
+
|
|
480
|
+
if org_name in predefined_scratch_configs:
|
|
481
|
+
if org_config.active and include_active:
|
|
482
|
+
runtime.keychain.remove_org(org_name)
|
|
483
|
+
active_orgs_removed.append(org_name)
|
|
484
|
+
else:
|
|
485
|
+
org_shapes_skipped.append(org_name)
|
|
486
|
+
|
|
487
|
+
elif org_config.active:
|
|
488
|
+
if include_active:
|
|
489
|
+
runtime.keychain.remove_org(org_name)
|
|
490
|
+
active_orgs_removed.append(org_name)
|
|
491
|
+
else:
|
|
492
|
+
active_orgs_skipped.append(org_name)
|
|
493
|
+
|
|
494
|
+
elif isinstance(org_config, ScratchOrgConfig):
|
|
495
|
+
runtime.keychain.remove_org(org_name)
|
|
496
|
+
expired_orgs_removed.append(org_name)
|
|
497
|
+
|
|
498
|
+
if expired_orgs_removed:
|
|
499
|
+
click.echo(
|
|
500
|
+
f"Successfully removed {len(expired_orgs_removed)} expired scratch orgs: {', '.join(expired_orgs_removed)}"
|
|
501
|
+
)
|
|
502
|
+
else:
|
|
503
|
+
click.echo("No expired scratch orgs to delete. ✨")
|
|
504
|
+
|
|
505
|
+
if active_orgs_removed:
|
|
506
|
+
click.echo(
|
|
507
|
+
f"Successfully removed {len(active_orgs_removed)} active scratch orgs: {', '.join(active_orgs_removed)}"
|
|
508
|
+
)
|
|
509
|
+
elif include_active:
|
|
510
|
+
click.echo("No active scratch orgs to delete. ✨")
|
|
511
|
+
|
|
512
|
+
if org_shapes_skipped:
|
|
513
|
+
click.echo(f"Skipped org shapes: {', '.join(org_shapes_skipped)}")
|
|
514
|
+
|
|
515
|
+
if active_orgs_skipped:
|
|
516
|
+
click.echo(f"Skipped active orgs: {', '.join(active_orgs_skipped)}")
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
@org.command(name="remove", help="Removes an org from the keychain")
|
|
520
|
+
@orgname_option_or_argument(required=True)
|
|
521
|
+
@click.option(
|
|
522
|
+
"--global-org",
|
|
523
|
+
is_flag=True,
|
|
524
|
+
help="Set this option to force remove a global org. Default behavior is to error if you attempt to delete a global org.",
|
|
525
|
+
)
|
|
526
|
+
@pass_runtime(require_project=False, require_keychain=True)
|
|
527
|
+
def org_remove(runtime, org_name, global_org):
|
|
528
|
+
try:
|
|
529
|
+
org_config = runtime.keychain.get_org(org_name)
|
|
530
|
+
except OrgNotFound:
|
|
531
|
+
raise click.ClickException(f"Org {org_name} does not exist in the keychain")
|
|
532
|
+
|
|
533
|
+
if org_config.can_delete():
|
|
534
|
+
click.echo("A scratch org was already created, attempting to delete...")
|
|
535
|
+
try:
|
|
536
|
+
org_config.delete_org()
|
|
537
|
+
except Exception as e:
|
|
538
|
+
click.echo(e)
|
|
539
|
+
click.echo("Perhaps it was already deleted?")
|
|
540
|
+
click.echo("Removing org regardless.")
|
|
541
|
+
|
|
542
|
+
global_org = global_org or runtime.project_config is None
|
|
543
|
+
runtime.keychain.remove_org(org_name, global_org)
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
@org.command(
|
|
547
|
+
name="scratch", help="Connects a Salesforce DX Scratch Org to the keychain"
|
|
548
|
+
)
|
|
549
|
+
@click.argument("config_name")
|
|
550
|
+
@orgname_option_or_argument(required=True)
|
|
551
|
+
@click.option(
|
|
552
|
+
"--default",
|
|
553
|
+
is_flag=True,
|
|
554
|
+
help="If set, sets the connected org as the new default org",
|
|
555
|
+
)
|
|
556
|
+
@click.option(
|
|
557
|
+
"--devhub", help="If provided, overrides the devhub used to create the scratch org"
|
|
558
|
+
)
|
|
559
|
+
@click.option(
|
|
560
|
+
"--days",
|
|
561
|
+
help="If provided, overrides the scratch config default days value for how many days the scratch org should persist",
|
|
562
|
+
)
|
|
563
|
+
@click.option(
|
|
564
|
+
"--no-password", is_flag=True, help="If set, don't set a password for the org"
|
|
565
|
+
)
|
|
566
|
+
@click.option(
|
|
567
|
+
"--release",
|
|
568
|
+
help="If provided, specify either previous or preview when creating a scratch org",
|
|
569
|
+
)
|
|
570
|
+
@pass_runtime(require_keychain=True)
|
|
571
|
+
def org_scratch(
|
|
572
|
+
runtime, config_name, org_name, default, devhub, days, no_password, release=None
|
|
573
|
+
):
|
|
574
|
+
runtime.check_org_overwrite(org_name)
|
|
575
|
+
release_options = ["previous", "preview"]
|
|
576
|
+
if release and release not in release_options:
|
|
577
|
+
raise click.UsageError(
|
|
578
|
+
"Release options value is not valid. Either specify preview or previous."
|
|
579
|
+
)
|
|
580
|
+
|
|
581
|
+
scratch_configs = runtime.project_config.lookup("orgs__scratch")
|
|
582
|
+
if not scratch_configs:
|
|
583
|
+
raise click.UsageError("No scratch org configs found in cumulusci.yml")
|
|
584
|
+
scratch_config = scratch_configs.get(config_name)
|
|
585
|
+
if not scratch_config:
|
|
586
|
+
raise click.UsageError(
|
|
587
|
+
f"No scratch org config named {config_name} found in the cumulusci.yml file"
|
|
588
|
+
)
|
|
589
|
+
|
|
590
|
+
if devhub:
|
|
591
|
+
scratch_config["devhub"] = devhub
|
|
592
|
+
|
|
593
|
+
runtime.keychain.create_scratch_org(
|
|
594
|
+
org_name, config_name, days, set_password=not (no_password), release=release
|
|
595
|
+
)
|
|
596
|
+
|
|
597
|
+
if default:
|
|
598
|
+
runtime.keychain.set_default_org(org_name)
|
|
599
|
+
click.echo(f"{org_name} is now the default org")
|
|
600
|
+
else:
|
|
601
|
+
click.echo(f"{org_name} is configured for use")
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
@org.command(
|
|
605
|
+
name="scratch_delete",
|
|
606
|
+
help="Deletes a Salesforce DX Scratch Org leaving the config in the keychain for regeneration",
|
|
607
|
+
)
|
|
608
|
+
@orgname_option_or_argument(required=True)
|
|
609
|
+
@pass_runtime(require_keychain=True)
|
|
610
|
+
def org_scratch_delete(runtime, org_name):
|
|
611
|
+
org_config = runtime.keychain.get_org(org_name)
|
|
612
|
+
if not org_config.scratch:
|
|
613
|
+
raise click.UsageError(f"Org {org_name} is not a scratch org")
|
|
614
|
+
|
|
615
|
+
try:
|
|
616
|
+
org_config.delete_org()
|
|
617
|
+
except Exception as e:
|
|
618
|
+
click.echo(e)
|
|
619
|
+
click.echo(f"Use `cci org remove {org_name}` to remove it from your keychain.")
|
|
620
|
+
return
|
|
621
|
+
|
|
622
|
+
org_config.save()
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
org_shell_cci_help_message = """
|
|
626
|
+
The cumulusci shell gives you access to the following objects and functions:
|
|
627
|
+
|
|
628
|
+
* sf - simple_salesforce connected to your org. [1]
|
|
629
|
+
* org_config - local information about your org. [2]
|
|
630
|
+
* project_config - information about your project. [3]
|
|
631
|
+
* tooling - simple_salesforce connected to the tooling API on your org.
|
|
632
|
+
* query() - SOQL query. `help(query)` for more information
|
|
633
|
+
* describe() - Inspect object fields. `help(describe)` for more information
|
|
634
|
+
* help() - for interactive help on Python
|
|
635
|
+
* help(obj) - for help on any specific Python object or module
|
|
636
|
+
|
|
637
|
+
[1] https://github.com/simple-salesforce/simple-salesforce
|
|
638
|
+
[2] https://cumulusci.readthedocs.io/en/latest/api/cumulusci.core.config.html#module-cumulusci.core.config.OrgConfig
|
|
639
|
+
[3] https://cumulusci.readthedocs.io/en/latest/api/cumulusci.core.config.html#module-cumulusci.core.config.project_config
|
|
640
|
+
"""
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
class CCIHelp(type(help)):
|
|
644
|
+
def __repr__(self):
|
|
645
|
+
return org_shell_cci_help_message
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
@org.command(
|
|
649
|
+
name="shell",
|
|
650
|
+
help="Drop into a Python shell with a simple_salesforce connection in `sf`, "
|
|
651
|
+
"as well as the `org_config` and `project_config`.",
|
|
652
|
+
)
|
|
653
|
+
@orgname_option_or_argument(required=False)
|
|
654
|
+
@click.option("--script", help="Path to a script to run", type=click.Path())
|
|
655
|
+
@click.option("--python", help="Python code to run directly")
|
|
656
|
+
@pass_runtime(require_keychain=True)
|
|
657
|
+
def org_shell(runtime, org_name, script=None, python=None):
|
|
658
|
+
org_name, org_config = runtime.get_org(org_name)
|
|
659
|
+
org_config.refresh_oauth_token(runtime.keychain)
|
|
660
|
+
|
|
661
|
+
sf = get_simple_salesforce_connection(runtime.project_config, org_config)
|
|
662
|
+
tooling = get_simple_salesforce_connection(
|
|
663
|
+
runtime.project_config, org_config, base_url="tooling"
|
|
664
|
+
)
|
|
665
|
+
|
|
666
|
+
sf_helpers = SimpleSalesforceUIHelpers(sf)
|
|
667
|
+
|
|
668
|
+
globals = {
|
|
669
|
+
"sf": sf,
|
|
670
|
+
"tooling": tooling,
|
|
671
|
+
"org_config": org_config,
|
|
672
|
+
"project_config": runtime.project_config,
|
|
673
|
+
"help": CCIHelp(),
|
|
674
|
+
"query": sf_helpers.query,
|
|
675
|
+
"describe": sf_helpers.describe,
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
if script:
|
|
679
|
+
if python:
|
|
680
|
+
raise click.UsageError("Cannot specify both --script and --python")
|
|
681
|
+
runpy.run_path(script, init_globals=globals)
|
|
682
|
+
elif python:
|
|
683
|
+
exec(python, globals)
|
|
684
|
+
else:
|
|
685
|
+
code.interact(
|
|
686
|
+
banner=f"Use `sf` to access org `{org_name}` via simple_salesforce\n"
|
|
687
|
+
+ "Type `help` for more information about the cci shell.",
|
|
688
|
+
local=globals,
|
|
689
|
+
)
|
|
690
|
+
|
|
691
|
+
# Save the org config in case it was modified
|
|
692
|
+
org_config.save()
|