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
|
@@ -0,0 +1,731 @@
|
|
|
1
|
+
import contextlib
|
|
2
|
+
import fnmatch
|
|
3
|
+
import io
|
|
4
|
+
import math
|
|
5
|
+
import os
|
|
6
|
+
import re
|
|
7
|
+
import shutil
|
|
8
|
+
import sys
|
|
9
|
+
import tempfile
|
|
10
|
+
import textwrap
|
|
11
|
+
import zipfile
|
|
12
|
+
from datetime import datetime
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
from typing import Union, Optional
|
|
15
|
+
|
|
16
|
+
import requests
|
|
17
|
+
import sarge
|
|
18
|
+
|
|
19
|
+
from cumulusci.vcs.models import AbstractRepo
|
|
20
|
+
from cumulusci.core.exceptions import CumulusCIException
|
|
21
|
+
from .xml import ( # noqa
|
|
22
|
+
elementtree_parse_file,
|
|
23
|
+
remove_xml_element,
|
|
24
|
+
remove_xml_element_file,
|
|
25
|
+
remove_xml_element_string,
|
|
26
|
+
)
|
|
27
|
+
from .ziputils import process_text_in_zipfile # noqa
|
|
28
|
+
from .ziputils import zip_subfolder
|
|
29
|
+
|
|
30
|
+
CUMULUSCI_PATH = os.path.realpath(
|
|
31
|
+
os.path.join(os.path.dirname(os.path.realpath(__file__)), "../..")
|
|
32
|
+
)
|
|
33
|
+
META_XML_CLEAN_DIRS = ("classes/", "triggers/", "pages/", "aura/", "components/")
|
|
34
|
+
API_DATE_FORMAT = "%Y-%m-%dT%H:%M:%S.%f"
|
|
35
|
+
DATETIME_LEN = len("2018-08-07T16:00:56.000")
|
|
36
|
+
|
|
37
|
+
BREW_DEPRECATION_MSG = (
|
|
38
|
+
"It looks like you have installed CumulusCI using brew."
|
|
39
|
+
"This method of installation is no longer supported."
|
|
40
|
+
"Please use the following to install CumulusCI with pipx:\n"
|
|
41
|
+
"brew uninstall cumulusci\nbrew install pipx\npipx ensurepath\npipx install cumulusci"
|
|
42
|
+
)
|
|
43
|
+
PIP_UPDATE_CMD = "pip install --upgrade cumulusci"
|
|
44
|
+
PIPX_UPDATE_CMD = "pipx upgrade cumulusci"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def parse_api_datetime(value):
|
|
48
|
+
"""parse a datetime returned from the salesforce API.
|
|
49
|
+
|
|
50
|
+
in python 3 we should just use a strptime %z, but until then we're just going
|
|
51
|
+
to assert that its a fixed offset of +0000 since thats the observed behavior. getting
|
|
52
|
+
python 2 to support fixed offset parsing is too complicated for what we need imo."""
|
|
53
|
+
dt = datetime.strptime(value[0:DATETIME_LEN], API_DATE_FORMAT)
|
|
54
|
+
offset_str = value[DATETIME_LEN:]
|
|
55
|
+
assert offset_str in ["+0000", "Z"], "The Salesforce API returned a weird timezone."
|
|
56
|
+
return dt
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def find_replace(find, replace, directory, filePattern, logger=None, max=None):
|
|
60
|
+
"""Recursive find/replace.
|
|
61
|
+
|
|
62
|
+
Walks through files matching `filePattern` within `directory`
|
|
63
|
+
and does a string substitution of `find` with `replace`.
|
|
64
|
+
"""
|
|
65
|
+
for path, dirs, files in os.walk(os.path.abspath(directory)):
|
|
66
|
+
for filename in fnmatch.filter(files, filePattern):
|
|
67
|
+
filepath = os.path.join(path, filename)
|
|
68
|
+
with io.open(filepath, encoding="utf-8") as f:
|
|
69
|
+
s = f.read()
|
|
70
|
+
if max:
|
|
71
|
+
s_updated = s.replace(find, replace, max)
|
|
72
|
+
else:
|
|
73
|
+
s_updated = s.replace(find, replace)
|
|
74
|
+
if s != s_updated:
|
|
75
|
+
if logger:
|
|
76
|
+
logger.info("Updating {}".format(filepath))
|
|
77
|
+
with io.open(filepath, "w", encoding="utf-8") as f:
|
|
78
|
+
f.write(s_updated)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def find_replace_regex(find, replace, directory, filePattern, logger=None):
|
|
82
|
+
"""Recursive find/replace using a regular expression.
|
|
83
|
+
|
|
84
|
+
Walks through files matching `filePattern` within `directory`
|
|
85
|
+
and does a regex substitution of `find` with `replace`.
|
|
86
|
+
"""
|
|
87
|
+
pattern = re.compile(find)
|
|
88
|
+
for path, dirs, files in os.walk(os.path.abspath(directory)):
|
|
89
|
+
for filename in fnmatch.filter(files, filePattern):
|
|
90
|
+
filepath = os.path.join(path, filename)
|
|
91
|
+
with io.open(filepath, encoding="utf-8") as f:
|
|
92
|
+
s = f.read()
|
|
93
|
+
s_updated = pattern.sub(replace, s)
|
|
94
|
+
if s != s_updated:
|
|
95
|
+
if logger:
|
|
96
|
+
logger.info("Updating {}".format(filepath))
|
|
97
|
+
with io.open(filepath, "w", encoding="utf-8") as f:
|
|
98
|
+
f.write(s_updated)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def find_rename(find, replace, directory, logger=None):
|
|
102
|
+
"""Recursive find/replace within filenames.
|
|
103
|
+
|
|
104
|
+
Walks through files within `directory`
|
|
105
|
+
and renames files to replace `find` with `replace`.
|
|
106
|
+
"""
|
|
107
|
+
for path, dirs, files in os.walk(os.path.abspath(directory)):
|
|
108
|
+
for filename in files:
|
|
109
|
+
filepath = os.path.join(path, filename)
|
|
110
|
+
if logger:
|
|
111
|
+
logger.info("Renaming {}".format(filepath))
|
|
112
|
+
os.rename(filepath, os.path.join(path, filename.replace(find, replace)))
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def remove_xml_element_directory(name, directory, file_pattern, logger=None):
|
|
116
|
+
"""Recursively walk a directory and remove XML elements"""
|
|
117
|
+
for path, dirs, files in os.walk(os.path.abspath(directory)):
|
|
118
|
+
for filename in fnmatch.filter(files, file_pattern):
|
|
119
|
+
filepath = os.path.join(path, filename)
|
|
120
|
+
remove_xml_element_file(name, filepath)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
# backwards-compatibility aliases
|
|
124
|
+
findReplace = find_replace
|
|
125
|
+
findReplaceRegex = find_replace_regex
|
|
126
|
+
findRename = find_rename
|
|
127
|
+
removeXmlElement = remove_xml_element_directory
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def download_extract_zip(url, target=None, subfolder=None, headers=None):
|
|
131
|
+
if not headers:
|
|
132
|
+
headers = {}
|
|
133
|
+
resp = requests.get(url, headers=headers)
|
|
134
|
+
zip_content = io.BytesIO(resp.content)
|
|
135
|
+
zip_file = zipfile.ZipFile(zip_content)
|
|
136
|
+
if subfolder:
|
|
137
|
+
zip_file = zip_subfolder(zip_file, subfolder)
|
|
138
|
+
if target:
|
|
139
|
+
zip_file.extractall(target)
|
|
140
|
+
return
|
|
141
|
+
return zip_file
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def download_extract_github(
|
|
145
|
+
github_api, repo_owner, repo_name, subfolder=None, ref=None
|
|
146
|
+
):
|
|
147
|
+
return download_extract_github_from_repo(
|
|
148
|
+
github_api.repository(repo_owner, repo_name), subfolder, ref
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def download_extract_github_from_repo(github_repo, subfolder=None, ref=None):
|
|
153
|
+
if not ref:
|
|
154
|
+
ref = github_repo.default_branch
|
|
155
|
+
zip_content = io.BytesIO()
|
|
156
|
+
if not github_repo.archive("zipball", zip_content, ref=ref):
|
|
157
|
+
raise CumulusCIException(
|
|
158
|
+
f"Unable to download an archive of the Git ref {ref} from "
|
|
159
|
+
f"{github_repo.full_name}. This can mean that the ref has "
|
|
160
|
+
"not been pushed to the server, that CumulusCI's credential "
|
|
161
|
+
"does not have permission to access it, or that your access "
|
|
162
|
+
"is restricted by an IP address allow list."
|
|
163
|
+
)
|
|
164
|
+
zip_file = zipfile.ZipFile(zip_content)
|
|
165
|
+
path = sorted(zip_file.namelist())[0]
|
|
166
|
+
if subfolder:
|
|
167
|
+
path = path + subfolder
|
|
168
|
+
zip_file = zip_subfolder(zip_file, path)
|
|
169
|
+
return zip_file
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
def download_extract_vcs_from_repo(
|
|
173
|
+
vcs_repo: AbstractRepo, subfolder: Optional[str] = None, ref: Optional[str] = None
|
|
174
|
+
) -> zipfile.ZipFile:
|
|
175
|
+
# Download a zip archive from a VCS repository.
|
|
176
|
+
# If subfolder is specified, it will be extracted from the zip file.
|
|
177
|
+
# If ref is specified, it will be used to download the archive.
|
|
178
|
+
# If ref is not specified, the default branch of the repository will be used.
|
|
179
|
+
# If the archive cannot be downloaded, a CumulusCIException will be raised.
|
|
180
|
+
# The function returns a zipfile.ZipFile object containing the downloaded archive.
|
|
181
|
+
if not ref:
|
|
182
|
+
ref = vcs_repo.default_branch
|
|
183
|
+
zip_content = io.BytesIO()
|
|
184
|
+
if not vcs_repo.archive("zipball", zip_content, ref=ref):
|
|
185
|
+
raise CumulusCIException(
|
|
186
|
+
f"Unable to download an archive of the Git ref {ref} from "
|
|
187
|
+
f"{vcs_repo.full_name}. This can mean that the ref has "
|
|
188
|
+
"not been pushed to the server, that CumulusCI's credential "
|
|
189
|
+
"does not have permission to access it, or that your access "
|
|
190
|
+
"is restricted by an IP address allow list."
|
|
191
|
+
)
|
|
192
|
+
zip_file = zipfile.ZipFile(zip_content)
|
|
193
|
+
path = sorted(zip_file.namelist())[0]
|
|
194
|
+
|
|
195
|
+
root_folders_list = set(
|
|
196
|
+
[fname.split("/")[0] for fname in sorted(zip_file.namelist())]
|
|
197
|
+
)
|
|
198
|
+
if len(root_folders_list) > 1:
|
|
199
|
+
# If there are multiple root folders, we assume the zip contains all the repo content.
|
|
200
|
+
path = ""
|
|
201
|
+
|
|
202
|
+
if subfolder:
|
|
203
|
+
path = path + subfolder
|
|
204
|
+
zip_file = zip_subfolder(zip_file, path)
|
|
205
|
+
return zip_file
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def process_text_in_directory(path, process_file):
|
|
209
|
+
"""Process each file in a directory using the `process_file` function.
|
|
210
|
+
|
|
211
|
+
`process_file` should be a function which accepts a filename and content as text
|
|
212
|
+
and returns a (possibly modified) filename and content. The file will be
|
|
213
|
+
updated with the new content, and renamed if necessary.
|
|
214
|
+
|
|
215
|
+
Files with content that cannot be decoded as UTF-8 will be skipped.
|
|
216
|
+
"""
|
|
217
|
+
|
|
218
|
+
for path, dirs, files in os.walk(path):
|
|
219
|
+
for orig_name in files:
|
|
220
|
+
orig_path = os.path.join(path, orig_name)
|
|
221
|
+
try:
|
|
222
|
+
with open(orig_path, "r", encoding="utf-8") as f:
|
|
223
|
+
orig_content = f.read()
|
|
224
|
+
except UnicodeDecodeError:
|
|
225
|
+
# Probably a binary file; skip it
|
|
226
|
+
continue
|
|
227
|
+
new_name, new_content = process_file(orig_name, orig_content)
|
|
228
|
+
new_path = os.path.join(path, new_name)
|
|
229
|
+
if new_name != orig_name:
|
|
230
|
+
os.rename(orig_path, new_path)
|
|
231
|
+
with open(new_path, "w", encoding="utf-8") as f:
|
|
232
|
+
f.write(new_content)
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
def inject_namespace(
|
|
236
|
+
name,
|
|
237
|
+
content,
|
|
238
|
+
namespace=None,
|
|
239
|
+
managed=None,
|
|
240
|
+
filename_token=None,
|
|
241
|
+
namespace_token=None,
|
|
242
|
+
namespaced_org=None,
|
|
243
|
+
logger=None,
|
|
244
|
+
):
|
|
245
|
+
"""Replaces %%%NAMESPACE%%% in file content and ___NAMESPACE___ in file name
|
|
246
|
+
with either '' if no namespace is provided or 'namespace__' if provided.
|
|
247
|
+
"""
|
|
248
|
+
|
|
249
|
+
# Handle namespace and filename tokens
|
|
250
|
+
if not filename_token:
|
|
251
|
+
filename_token = "___NAMESPACE___"
|
|
252
|
+
if not namespace_token:
|
|
253
|
+
namespace_token = "%%%NAMESPACE%%%"
|
|
254
|
+
if managed is True and namespace:
|
|
255
|
+
namespace_prefix = namespace + "__"
|
|
256
|
+
namespace_dot_prefix = namespace + "."
|
|
257
|
+
else:
|
|
258
|
+
namespace_prefix = ""
|
|
259
|
+
namespace_dot_prefix = ""
|
|
260
|
+
|
|
261
|
+
namespace_dot_token = "%%%NAMESPACE_DOT%%%"
|
|
262
|
+
|
|
263
|
+
# Handle tokens %%%NAMESPACED_ORG%%% and ___NAMESPACED_ORG___
|
|
264
|
+
namespaced_org_token = "%%%NAMESPACED_ORG%%%"
|
|
265
|
+
namespaced_org_file_token = "___NAMESPACED_ORG___"
|
|
266
|
+
namespaced_org = namespace + "__" if namespaced_org else ""
|
|
267
|
+
|
|
268
|
+
# Handle token %%%NAMESPACE_OR_C%%% for lightning components
|
|
269
|
+
namespace_or_c_token = "%%%NAMESPACE_OR_C%%%"
|
|
270
|
+
namespace_or_c = namespace if managed and namespace else "c"
|
|
271
|
+
|
|
272
|
+
# Handle token %%%NAMESPACED_ORG_OR_C%%%
|
|
273
|
+
namespaced_org_or_c_token = "%%%NAMESPACED_ORG_OR_C%%%"
|
|
274
|
+
namespaced_org_or_c = namespace if namespaced_org else "c"
|
|
275
|
+
|
|
276
|
+
orig_name = name
|
|
277
|
+
prev_content = content
|
|
278
|
+
content = content.replace(namespace_token, namespace_prefix)
|
|
279
|
+
if logger and content != prev_content:
|
|
280
|
+
logger.info(f' {name}: Replaced {namespace_token} with "{namespace_prefix}"')
|
|
281
|
+
|
|
282
|
+
prev_content = content
|
|
283
|
+
content = content.replace(namespace_dot_token, namespace_dot_prefix)
|
|
284
|
+
if logger and content != prev_content:
|
|
285
|
+
logger.info(
|
|
286
|
+
f' {name}: Replaced {namespace_dot_token} with "{namespace_dot_prefix}"'
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
prev_content = content
|
|
290
|
+
content = content.replace(namespace_or_c_token, namespace_or_c)
|
|
291
|
+
if logger and content != prev_content:
|
|
292
|
+
logger.info(
|
|
293
|
+
f' {name}: Replaced {namespace_or_c_token} with "{namespace_or_c}"'
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
if name == "package.xml":
|
|
297
|
+
prev_content = content
|
|
298
|
+
content = content.replace(filename_token, namespace_prefix)
|
|
299
|
+
if logger and content != prev_content:
|
|
300
|
+
logger.info(
|
|
301
|
+
f' {name}: Replaced {filename_token} with "{namespace_prefix}"'
|
|
302
|
+
)
|
|
303
|
+
|
|
304
|
+
# Also replace ___NAMESPACED_ORG___ tokens in package.xml
|
|
305
|
+
prev_content = content
|
|
306
|
+
content = content.replace(namespaced_org_file_token, namespaced_org)
|
|
307
|
+
if logger and content != prev_content:
|
|
308
|
+
logger.info(
|
|
309
|
+
f' {name}: Replaced {namespaced_org_file_token} with "{namespaced_org}"'
|
|
310
|
+
)
|
|
311
|
+
|
|
312
|
+
prev_content = content
|
|
313
|
+
content = content.replace(namespaced_org_token, namespaced_org)
|
|
314
|
+
if logger and content != prev_content:
|
|
315
|
+
logger.info(
|
|
316
|
+
f' {name}: Replaced {namespaced_org_token} with "{namespaced_org}"'
|
|
317
|
+
)
|
|
318
|
+
|
|
319
|
+
prev_content = content
|
|
320
|
+
content = content.replace(namespaced_org_or_c_token, namespaced_org_or_c)
|
|
321
|
+
if logger and content != prev_content:
|
|
322
|
+
logger.info(
|
|
323
|
+
f' {name}: Replaced {namespaced_org_or_c_token} with "{namespaced_org_or_c}"'
|
|
324
|
+
)
|
|
325
|
+
|
|
326
|
+
# Replace namespace token in file name
|
|
327
|
+
name = name.replace(filename_token, namespace_prefix)
|
|
328
|
+
name = name.replace(namespaced_org_file_token, namespaced_org)
|
|
329
|
+
if logger and name != orig_name:
|
|
330
|
+
logger.info(f" {orig_name}: renamed to {name}")
|
|
331
|
+
|
|
332
|
+
return name, content
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
def strip_namespace(name, content, namespace, logger=None):
|
|
336
|
+
"""Given a namespace, strips 'namespace__' from file name and content"""
|
|
337
|
+
namespace_prefix = "{}__".format(namespace)
|
|
338
|
+
lightning_namespace = "{}:".format(namespace)
|
|
339
|
+
|
|
340
|
+
orig_content = content
|
|
341
|
+
new_content = orig_content.replace(namespace_prefix, "")
|
|
342
|
+
new_content = new_content.replace(lightning_namespace, "c:")
|
|
343
|
+
name = name.replace(namespace_prefix, "")
|
|
344
|
+
if orig_content != new_content and logger:
|
|
345
|
+
logger.info(
|
|
346
|
+
" {file_name}: removed {namespace}".format(
|
|
347
|
+
file_name=name, namespace=namespace_prefix
|
|
348
|
+
)
|
|
349
|
+
)
|
|
350
|
+
return name, new_content
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
def tokenize_namespace(name, content, namespace, logger=None):
|
|
354
|
+
"""Given a namespace, replaces 'namespace__' with %%%NAMESPACE%%%
|
|
355
|
+
in file content and ___NAMESPACE___ in file name
|
|
356
|
+
"""
|
|
357
|
+
if not namespace:
|
|
358
|
+
return name, content
|
|
359
|
+
|
|
360
|
+
namespace_prefix = "{}__".format(namespace)
|
|
361
|
+
lightning_namespace = "{}:".format(namespace)
|
|
362
|
+
|
|
363
|
+
content = content.replace(namespace_prefix, "%%%NAMESPACE%%%")
|
|
364
|
+
content = content.replace(lightning_namespace, "%%%NAMESPACE_OR_C%%%")
|
|
365
|
+
name = name.replace(namespace_prefix, "___NAMESPACE___")
|
|
366
|
+
|
|
367
|
+
return name, content
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
def zip_clean_metaxml(zip_src, logger=None):
|
|
371
|
+
"""Given a zipfile, cleans all ``*-meta.xml`` files in the zip for
|
|
372
|
+
deployment by stripping all ``<packageVersions/>`` elements
|
|
373
|
+
"""
|
|
374
|
+
zip_dest = zipfile.ZipFile(io.BytesIO(), "w", zipfile.ZIP_DEFLATED)
|
|
375
|
+
changed = []
|
|
376
|
+
for name in zip_src.namelist():
|
|
377
|
+
content = zip_src.read(name)
|
|
378
|
+
if name.startswith(META_XML_CLEAN_DIRS) and name.endswith("-meta.xml"):
|
|
379
|
+
try:
|
|
380
|
+
content.decode("utf-8")
|
|
381
|
+
except UnicodeDecodeError:
|
|
382
|
+
# if we cannot decode the content, it may be binary;
|
|
383
|
+
# don't try and replace it.
|
|
384
|
+
pass
|
|
385
|
+
else:
|
|
386
|
+
clean_content = remove_xml_element_string("packageVersions", content)
|
|
387
|
+
if clean_content != content:
|
|
388
|
+
changed.append(name)
|
|
389
|
+
content = clean_content
|
|
390
|
+
zip_dest.writestr(name, content)
|
|
391
|
+
if changed and logger:
|
|
392
|
+
logger.info(
|
|
393
|
+
"Cleaned package versions from {} meta.xml files".format(len(changed))
|
|
394
|
+
)
|
|
395
|
+
zip_src.close()
|
|
396
|
+
return zip_dest
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
def doc_task(task_name, task_config, project_config=None, org_config=None):
|
|
400
|
+
"""Document a (project specific) task configuration in RST format."""
|
|
401
|
+
from cumulusci.core.utils import import_global
|
|
402
|
+
|
|
403
|
+
doc = []
|
|
404
|
+
doc.append(f".. _{task_name.replace('_', '-')}:\n")
|
|
405
|
+
doc.append(f"{task_name}\n==========================================\n")
|
|
406
|
+
doc.append(f"**Description:** {task_config.description}\n")
|
|
407
|
+
doc.append(f"**Class:** {task_config.class_path}\n")
|
|
408
|
+
|
|
409
|
+
task_class = import_global(task_config.class_path)
|
|
410
|
+
|
|
411
|
+
if "task_docs" in task_class.__dict__:
|
|
412
|
+
task_docs = textwrap.dedent(task_class.task_docs.strip("\n"))
|
|
413
|
+
doc.append(task_docs)
|
|
414
|
+
|
|
415
|
+
task_option_info = get_task_option_info(task_config, task_class)
|
|
416
|
+
doc.append("Command Syntax\n------------------------------------------\n")
|
|
417
|
+
command_syntax = get_command_syntax(task_name)
|
|
418
|
+
doc.append(command_syntax)
|
|
419
|
+
|
|
420
|
+
task_option_doc = create_task_options_doc(task_option_info)
|
|
421
|
+
if task_option_doc:
|
|
422
|
+
doc.append("Options\n------------------------------------------\n")
|
|
423
|
+
doc.extend(task_option_doc)
|
|
424
|
+
|
|
425
|
+
return "\n".join(doc)
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
def get_command_syntax(task_name):
|
|
429
|
+
"""Return an example command syntax string in .rst format"""
|
|
430
|
+
return f"``$ cci task run {task_name}``\n\n"
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
def get_task_option_info(task_config, task_class):
|
|
434
|
+
"""Gets the the following info for each option in the task
|
|
435
|
+
usage: example usage statement (i.e. -o name VALUE)
|
|
436
|
+
required: True/False
|
|
437
|
+
default: If a default value is present
|
|
438
|
+
description: Description string provided on the task option
|
|
439
|
+
option_type: A type string provided on the task option
|
|
440
|
+
|
|
441
|
+
Returns list of option dicts with required at the front of the map
|
|
442
|
+
"""
|
|
443
|
+
required_options = []
|
|
444
|
+
optional_options = []
|
|
445
|
+
defaults = task_config.options or {}
|
|
446
|
+
|
|
447
|
+
for name, option in list(task_class.task_options.items()):
|
|
448
|
+
usage = get_option_usage_string(name, option)
|
|
449
|
+
required = True if option.get("required") else False
|
|
450
|
+
default = defaults.get(name)
|
|
451
|
+
description = option.get("description")
|
|
452
|
+
option_type = option.get("type")
|
|
453
|
+
|
|
454
|
+
info = {
|
|
455
|
+
"usage": usage,
|
|
456
|
+
"name": name,
|
|
457
|
+
"required": required,
|
|
458
|
+
"default": default,
|
|
459
|
+
"description": description,
|
|
460
|
+
"option_type": option_type,
|
|
461
|
+
}
|
|
462
|
+
if required:
|
|
463
|
+
required_options.append(info)
|
|
464
|
+
else:
|
|
465
|
+
optional_options.append(info)
|
|
466
|
+
|
|
467
|
+
return [*required_options, *optional_options]
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
def get_option_usage_string(name, option):
|
|
471
|
+
"""Returns a usage string if one exists
|
|
472
|
+
else creates a usage string in the form of:
|
|
473
|
+
|
|
474
|
+
--option-name OPTIONNAME
|
|
475
|
+
"""
|
|
476
|
+
usage_str = option.get("usage")
|
|
477
|
+
if not usage_str:
|
|
478
|
+
usage_str = f"--{name} {name.replace('_', '').upper()}"
|
|
479
|
+
return usage_str
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
def create_task_options_doc(task_options):
|
|
483
|
+
"""Generate the 'Options' section for a given tasks documentation"""
|
|
484
|
+
doc = []
|
|
485
|
+
for option in task_options:
|
|
486
|
+
usage_str = option.get("usage")
|
|
487
|
+
if usage_str:
|
|
488
|
+
doc.append(f"\n``{usage_str}``")
|
|
489
|
+
|
|
490
|
+
description = option.get("description")
|
|
491
|
+
if description:
|
|
492
|
+
doc.append(f"\n\t {description}")
|
|
493
|
+
|
|
494
|
+
default = option.get("default")
|
|
495
|
+
if default:
|
|
496
|
+
doc.append(f"\n\t Default: {default}")
|
|
497
|
+
elif option.get("required"):
|
|
498
|
+
doc.append("\n *Required*")
|
|
499
|
+
else:
|
|
500
|
+
doc.append("\n *Optional*")
|
|
501
|
+
|
|
502
|
+
option_type = option.get("option_type")
|
|
503
|
+
if option_type:
|
|
504
|
+
doc.append(f"\n\t Type: {option_type}")
|
|
505
|
+
|
|
506
|
+
return doc
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
def flow_ref_title_and_intro(intro_blurb):
|
|
510
|
+
return f"""Flow Reference
|
|
511
|
+
==========================================
|
|
512
|
+
\n{intro_blurb}
|
|
513
|
+
|
|
514
|
+
"""
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
def document_flow(flow_name, description, flow_coordinator, additional_info=None):
|
|
518
|
+
"""Document (project specific) flow configurations in RST format"""
|
|
519
|
+
doc = []
|
|
520
|
+
|
|
521
|
+
doc.append(f".. _{flow_name.replace('_', '-')}:\n")
|
|
522
|
+
doc.append(f"{flow_name}\n{'^' * len(flow_name)}\n")
|
|
523
|
+
doc.append(f"**Description:** {description}\n")
|
|
524
|
+
|
|
525
|
+
if additional_info:
|
|
526
|
+
doc.append(additional_info)
|
|
527
|
+
|
|
528
|
+
doc.append("**Flow Steps**\n")
|
|
529
|
+
doc.append(".. code-block:: console\n")
|
|
530
|
+
flow_step_lines = flow_coordinator.get_flow_steps(for_docs=True)
|
|
531
|
+
# extra indent beneath code-block and finish with pipe for extra space afterwards
|
|
532
|
+
flow_step_lines = [f"\t{line}" for line in flow_step_lines]
|
|
533
|
+
# fix when clauses
|
|
534
|
+
lines = []
|
|
535
|
+
for line in flow_step_lines:
|
|
536
|
+
if line.startswith("when"):
|
|
537
|
+
line = f"\t\t{line}"
|
|
538
|
+
lines.append(line)
|
|
539
|
+
doc.extend(lines)
|
|
540
|
+
|
|
541
|
+
return "\n".join(doc)
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
def package_xml_from_dict(items, api_version, package_name=None):
|
|
545
|
+
lines = []
|
|
546
|
+
|
|
547
|
+
# Print header
|
|
548
|
+
lines.append('<?xml version="1.0" encoding="UTF-8"?>')
|
|
549
|
+
lines.append('<Package xmlns="http://soap.sforce.com/2006/04/metadata">')
|
|
550
|
+
|
|
551
|
+
# Include package name if specified
|
|
552
|
+
if package_name:
|
|
553
|
+
lines.append(" <fullName>{}</fullName>".format(package_name))
|
|
554
|
+
|
|
555
|
+
# Print types sections
|
|
556
|
+
for md_type, members in sorted(items.items()):
|
|
557
|
+
members.sort()
|
|
558
|
+
lines.append(" <types>")
|
|
559
|
+
for member in members:
|
|
560
|
+
lines.append(" <members>{}</members>".format(member))
|
|
561
|
+
lines.append(" <name>{}</name>".format(md_type))
|
|
562
|
+
lines.append(" </types>")
|
|
563
|
+
|
|
564
|
+
# Print footer
|
|
565
|
+
lines.append(" <version>{0}</version>".format(api_version))
|
|
566
|
+
lines.append("</Package>")
|
|
567
|
+
|
|
568
|
+
return "\n".join(lines)
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
@contextlib.contextmanager
|
|
572
|
+
def cd(path):
|
|
573
|
+
"""Context manager that changes to another directory"""
|
|
574
|
+
if not path:
|
|
575
|
+
yield
|
|
576
|
+
return
|
|
577
|
+
cwd = os.getcwd()
|
|
578
|
+
os.chdir(path)
|
|
579
|
+
try:
|
|
580
|
+
yield
|
|
581
|
+
finally:
|
|
582
|
+
os.chdir(cwd)
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
@contextlib.contextmanager
|
|
586
|
+
def temporary_dir(chdir=True):
|
|
587
|
+
"""Context manager that creates a temporary directory and chdirs to it.
|
|
588
|
+
|
|
589
|
+
When the context manager exits it returns to the previous cwd
|
|
590
|
+
and deletes the temporary directory.
|
|
591
|
+
"""
|
|
592
|
+
d = tempfile.mkdtemp()
|
|
593
|
+
try:
|
|
594
|
+
with contextlib.ExitStack() as stack:
|
|
595
|
+
if chdir:
|
|
596
|
+
stack.enter_context(cd(d))
|
|
597
|
+
yield d
|
|
598
|
+
finally:
|
|
599
|
+
if os.path.exists(d):
|
|
600
|
+
try:
|
|
601
|
+
shutil.rmtree(d)
|
|
602
|
+
except Exception as e: # pragma: no cover
|
|
603
|
+
import logging # needs to be local or cumulusci.utils.logging gets picked up
|
|
604
|
+
|
|
605
|
+
logging.getLogger(__file__).warn(
|
|
606
|
+
f"Cannot remove temporary directory {d} because: {e}"
|
|
607
|
+
)
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
def touch(path):
|
|
611
|
+
"""Ensure a file exists."""
|
|
612
|
+
with open(path, "a"):
|
|
613
|
+
pass
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
def in_directory(filepath, dirpath):
|
|
617
|
+
"""Returns a boolean for whether filepath is contained in dirpath.
|
|
618
|
+
|
|
619
|
+
Normalizes the paths (e.g. resolving symlinks and ..)
|
|
620
|
+
so this is the safe way to make sure a user-configured path
|
|
621
|
+
is located inside the user's project repo.
|
|
622
|
+
"""
|
|
623
|
+
filepath = os.path.realpath(filepath)
|
|
624
|
+
dirpath = os.path.realpath(dirpath)
|
|
625
|
+
return filepath == dirpath or filepath.startswith(os.path.join(dirpath, ""))
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
def log_progress(
|
|
629
|
+
iterable,
|
|
630
|
+
logger,
|
|
631
|
+
batch_size=10000,
|
|
632
|
+
progress_message="Processing... ({})",
|
|
633
|
+
done_message="Done! (Total: {})",
|
|
634
|
+
):
|
|
635
|
+
"""Log progress while iterating."""
|
|
636
|
+
i = 0
|
|
637
|
+
for x in iterable:
|
|
638
|
+
yield x
|
|
639
|
+
i += 1
|
|
640
|
+
if not i % batch_size:
|
|
641
|
+
logger.info(progress_message.format(i))
|
|
642
|
+
logger.info(done_message.format(i))
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
def random_alphanumeric_underscore(length):
|
|
646
|
+
import secrets
|
|
647
|
+
|
|
648
|
+
# Ensure the string is the right length
|
|
649
|
+
byte_length = math.ceil((length * 3) / 4)
|
|
650
|
+
return secrets.token_urlsafe(byte_length).replace("-", "_")[:length]
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
def get_cci_upgrade_command():
|
|
654
|
+
deprecated_install_paths = ["cellar", "linuxbrew"]
|
|
655
|
+
for path in deprecated_install_paths:
|
|
656
|
+
if path in CUMULUSCI_PATH.lower():
|
|
657
|
+
return BREW_DEPRECATION_MSG
|
|
658
|
+
|
|
659
|
+
return PIPX_UPDATE_CMD if "pipx" in CUMULUSCI_PATH.lower() else PIP_UPDATE_CMD
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
def convert_to_snake_case(content):
|
|
663
|
+
s1 = re.sub("([^_])([A-Z][a-z]+)", r"\1_\2", content)
|
|
664
|
+
return re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1).lower()
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
def get_git_config(config_key):
|
|
668
|
+
p = sarge.Command(
|
|
669
|
+
sarge.shell_format('git config --get "{0!s}"', config_key),
|
|
670
|
+
stderr=sarge.Capture(buffer_size=-1),
|
|
671
|
+
stdout=sarge.Capture(buffer_size=-1),
|
|
672
|
+
shell=True,
|
|
673
|
+
)
|
|
674
|
+
p.run()
|
|
675
|
+
config_value = (
|
|
676
|
+
io.TextIOWrapper(p.stdout, encoding=sys.stdout.encoding).read().strip()
|
|
677
|
+
)
|
|
678
|
+
|
|
679
|
+
return config_value if config_value and not p.returncode else None
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
def update_tree(src: Union[str, Path], dest: Union[str, Path]):
|
|
683
|
+
"""
|
|
684
|
+
Copies files from src to dest, same as distutils.copy_tree(update=1).
|
|
685
|
+
|
|
686
|
+
Copies the entire directory tree from src to dest. If dest exists, only
|
|
687
|
+
copies files that are newer in src than in dest, or files that don't exist
|
|
688
|
+
in dest.
|
|
689
|
+
|
|
690
|
+
Args:
|
|
691
|
+
src (Union[str, Path]): The source directory to copy files from.
|
|
692
|
+
dest (Union[str, Path]): The destination directory to copy files to.
|
|
693
|
+
"""
|
|
694
|
+
src_path = Path(src)
|
|
695
|
+
dest_path = Path(dest)
|
|
696
|
+
if not dest_path.exists():
|
|
697
|
+
shutil.copytree(src_path, dest_path)
|
|
698
|
+
else:
|
|
699
|
+
for src_dir in src_path.rglob("*"):
|
|
700
|
+
if src_dir.is_file():
|
|
701
|
+
dest_file = dest_path / src_dir.relative_to(src_path)
|
|
702
|
+
if (
|
|
703
|
+
not dest_file.exists()
|
|
704
|
+
or src_dir.stat().st_mtime - dest_file.stat().st_mtime > 1
|
|
705
|
+
):
|
|
706
|
+
dest_file.parent.mkdir(parents=True, exist_ok=True)
|
|
707
|
+
shutil.copy2(src_dir, dest_file)
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
def filter_namelist(includes, namelist):
|
|
711
|
+
"""
|
|
712
|
+
Filter a zipfile namelist, handling any included directory filenames missing
|
|
713
|
+
a trailing slash.
|
|
714
|
+
"""
|
|
715
|
+
included_dirs = []
|
|
716
|
+
zip_dirs = [filename.rstrip("/") for filename in namelist if filename.endswith("/")]
|
|
717
|
+
|
|
718
|
+
for name in includes:
|
|
719
|
+
if name.endswith("/"):
|
|
720
|
+
included_dirs.append(name)
|
|
721
|
+
elif name in zip_dirs:
|
|
722
|
+
# append a trailing slash to avoid partial matches
|
|
723
|
+
included_dirs.append(name + "/")
|
|
724
|
+
|
|
725
|
+
return list(
|
|
726
|
+
{
|
|
727
|
+
name
|
|
728
|
+
for name in namelist
|
|
729
|
+
if name.startswith(tuple(included_dirs)) or name in includes
|
|
730
|
+
}
|
|
731
|
+
)
|