Skip to content

Commit

Permalink
Merge branch 'SFDO-Tooling:main' into d2x
Browse files Browse the repository at this point in the history
  • Loading branch information
jlantz authored May 30, 2024
2 parents 31daa4c + 8ad7eb7 commit 793c181
Show file tree
Hide file tree
Showing 13 changed files with 90 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/feature_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
lint:
name: Lint
if: ${{ github.event_name == 'pull_request' }}
if: ${{ contains(fromJSON('["workflow_dispatch", "pull_request"]'), github.event_name) }}
uses: SFDO-Tooling/.github/.github/workflows/pre-commit.yml@main
docs:
name: Build Docs
Expand Down
2 changes: 1 addition & 1 deletion cumulusci/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.86.0"
__version__ = "3.88.0"
3 changes: 2 additions & 1 deletion cumulusci/core/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ def _load_project_config(self, *args, **kwargs):
self.project_config = self.project_config_cls(
self.universal_config, *args, **kwargs
)
self.project_config._add_tasks_directory_to_python_path()
if self.project_config is not None:
self.project_config._add_tasks_directory_to_python_path()

def _load_keychain(self):
if self.keychain is not None:
Expand Down
12 changes: 6 additions & 6 deletions cumulusci/robotframework/Salesforce.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,11 +600,11 @@ def select_record_type(self, label):
self.selenium.click_button("Next")

@capture_screenshot_on_error
def select_app_launcher_app(self, app_name):
def select_app_launcher_app(self, app_name, timeout=30):
"""Navigates to a Salesforce App via the App Launcher"""
locator = lex_locators["app_launcher"]["app_link"].format(app_name)
self.open_app_launcher()
self.selenium.wait_until_page_contains_element(locator, timeout=30)
self.selenium.wait_until_page_contains_element(locator, timeout)
self.selenium.set_focus_to_element(locator)
elem = self.selenium.get_webelement(locator)
link = elem.find_element_by_xpath("../../..")
Expand All @@ -623,19 +623,19 @@ def select_app_launcher_tab(self, tab_name):
self.wait_until_modal_is_closed()

@capture_screenshot_on_error
def wait_until_modal_is_open(self):
def wait_until_modal_is_open(self, timeout=15):
"""Wait for modal to open"""
self.selenium.wait_until_page_contains_element(
lex_locators["modal"]["is_open"],
timeout=15,
timeout,
error="Expected to see a modal window, but didn't",
)

@capture_screenshot_on_error
def wait_until_modal_is_closed(self):
def wait_until_modal_is_closed(self, timeout=15):
"""Wait for modal to close"""
self.selenium.wait_until_page_does_not_contain_element(
lex_locators["modal"]["is_open"], timeout=15
lex_locators["modal"]["is_open"], timeout
)

@capture_screenshot_on_error
Expand Down
4 changes: 2 additions & 2 deletions cumulusci/tasks/preflight/licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ def _run_task(self):
class GetAvailablePermissionSetLicenses(BaseSalesforceApiTask):
def _run_task(self):
self.return_values = [
result["PermissionSetLicenseKey"]
result["DeveloperName"]
for result in self.sf.query(
"SELECT PermissionSetLicenseKey FROM PermissionSetLicense"
"SELECT DeveloperName FROM PermissionSetLicense"
)["records"]
]
licenses = "\n".join(self.return_values)
Expand Down
6 changes: 3 additions & 3 deletions cumulusci/tasks/preflight/tests/test_licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ def test_psl_preflight(self):
task._init_api.return_value.query.return_value = {
"totalSize": 2,
"records": [
{"PermissionSetLicenseKey": "TEST1"},
{"PermissionSetLicenseKey": "TEST2"},
{"DeveloperName": "TEST1"},
{"DeveloperName": "TEST2"},
],
}
task()

task._init_api.return_value.query.assert_called_once_with(
"SELECT PermissionSetLicenseKey FROM PermissionSetLicense"
"SELECT DeveloperName FROM PermissionSetLicense"
)
assert task.return_values == ["TEST1", "TEST2"]

Expand Down
7 changes: 3 additions & 4 deletions cumulusci/tasks/salesforce/RetrieveUnpackaged.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ def _init_options(self, kwargs):
super(RetrieveUnpackaged, self)._init_options(kwargs)

if "package_xml" in self.options:
self.options["package_xml_path"] = self.options["package_xml"]
with open(self.options["package_xml_path"], "r") as f:
self.options["package_xml"] = f.read()
with open(self.options["package_xml"], "r") as f:
self.options["package_xml_content"] = f.read()

def _get_api(self):
return self.api_class(
self, self.options["package_xml"], self.options.get("api_version")
self, self.options["package_xml_content"], self.options.get("api_version")
)
11 changes: 8 additions & 3 deletions cumulusci/tasks/salesforce/sourcetracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ def retrieve_components(
api_version: str,
project_config: BaseProjectConfig = None,
retrieve_complete_profile: bool = False,
capture_output: bool = False,
):
"""Retrieve specified components from an org into a target folder.
Expand Down Expand Up @@ -290,7 +291,7 @@ def retrieve_components(
_write_manifest(components, package_xml_path, api_version)

# Retrieve specified components in DX format
sfdx(
p = sfdx(
"force:source:retrieve",
access_token=org_config.access_token,
log_note="Retrieving components",
Expand All @@ -302,7 +303,7 @@ def retrieve_components(
"-w",
"5",
],
capture_output=False,
capture_output=capture_output,
check_return=True,
env={"SFDX_INSTANCE_URL": org_config.instance_url},
)
Expand All @@ -327,7 +328,7 @@ def retrieve_components(
"force:source:convert",
log_note="Converting back to metadata format",
args=["-r", "force-app", "-d", target],
capture_output=False,
capture_output=capture_output,
check_return=True,
)

Expand All @@ -348,6 +349,10 @@ def retrieve_components(
package_xml = PackageXmlGenerator(**package_xml_opts)()
with open(os.path.join(target, "package.xml"), "w", encoding="utf-8") as f:
f.write(package_xml)
if capture_output:
return p.stdout_text.read()
else:
return None


class RetrieveChanges(ListChanges, BaseSalesforceApiTask):
Expand Down
5 changes: 3 additions & 2 deletions cumulusci/utils/xml/robot_xml.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import re
from typing import Callable, Dict, NamedTuple

from robot.api import ExecutionResult, ResultVisitor
from robot.api import ExecutionResult, ResultVisitor # type: ignore
from robot.result.model import TestCase

UNITS = {
Expand Down Expand Up @@ -53,7 +53,8 @@ def log_perf_summary_from_xml(
Supply a formatter that takes a PerfSummary triple if the default isn't a good fit:
f(test_name: str, metrics: Dict[str, float], test: robot.result.model.TestCase)"""
f(test_name: str, metrics: Dict[str, float], test: robot.result.model.TestCase)
"""
result = ExecutionResult(robot_xml)
pl = _perf_logger(logger_func, formatter_func)
next(pl) # start the generator
Expand Down
4 changes: 3 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,9 @@
"index",
"cumulusci.tex",
"CumulusCI Documentation",
"Cumulus Suite Development Team",
"""Kamalnath Devarakonda\\\\
Sr Director Software Engineering\\\\
[email protected]""",
"manual",
)
]
Expand Down
47 changes: 45 additions & 2 deletions docs/history.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,51 @@

<!-- latest-start -->

## v3.88.0 (2024-05-24)

<!-- Release notes generated using configuration in .github/release.yml at main -->

## What's Changed

### Changes 🎉

- Extend modal close wait with custom timeout by [@leboff](https://github.com/leboff) in [#3783](https://github.com/SFDO-Tooling/CumulusCI/pull/3783)
- Added check_output true to get the logs of metadata retrieval by [@lakshmi2506](https://github.com/lakshmi2506) in [#3789](https://github.com/SFDO-Tooling/CumulusCI/pull/3789)

### Issues Fixed 🩴

- Fix retrieve unpackaged so it is usable in metadeploy by [@yippie](https://github.com/yippie) in [#3566](https://github.com/SFDO-Tooling/CumulusCI/pull/3566)

## New Contributors

- @yippie made their first contribution in [#3566](https://github.com/SFDO-Tooling/CumulusCI/pull/3566)

**Full Changelog**: https://github.com/SFDO-Tooling/CumulusCI/compare/v3.87.0...v3.88.0

<!-- latest-stop -->

## v3.87.0 (2024-05-17)

<!-- Release notes generated using configuration in .github/release.yml at main -->

## What's Changed

### Changes 🎉

- Don't add fullname tag in 2GP package.xml by [@leboff](https://github.com/leboff) in [#3748](https://github.com/SFDO-Tooling/CumulusCI/pull/3748)

## New Contributors

- @leboff made their first contribution in [#3748](https://github.com/SFDO-Tooling/CumulusCI/pull/3748)

**Full Changelog**: https://github.com/SFDO-Tooling/CumulusCI/compare/v3.86.1...v3.87.0

## v3.86.1 (2024-05-06)

<!-- Release notes generated using configuration in .github/release.yml at main -->

**Full Changelog**: https://github.com/SFDO-Tooling/CumulusCI/compare/v3.86.0...v3.86.1

## v3.86.0 (2024-03-27)

<!-- Release notes generated using configuration in .github/release.yml at main -->
Expand All @@ -14,8 +59,6 @@

**Full Changelog**: https://github.com/SFDO-Tooling/CumulusCI/compare/v3.85.0...v3.86.0

<!-- latest-stop -->

## v3.85.0 (2024-03-13)

<!-- Release notes generated using configuration in .github/release.yml at main -->
Expand Down
18 changes: 9 additions & 9 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ attrs==23.2.0
# referencing
authlib==1.3.0
# via simple-salesforce
babel==2.14.0
babel==2.15.0
# via sphinx
beautifulsoup4==4.12.3
# via furo
Expand Down Expand Up @@ -44,11 +44,11 @@ click==8.1.7
# snowfakery
colorama==0.4.6
# via tox
coverage[toml]==7.5.0
coverage[toml]==7.5.1
# via
# cumulusci (pyproject.toml)
# pytest-cov
cryptography==42.0.5
cryptography==42.0.7
# via
# authlib
# cumulusci (pyproject.toml)
Expand Down Expand Up @@ -131,7 +131,7 @@ jsonschema-specifications==2023.12.1
# via jsonschema
keyring==23.0.1
# via cumulusci (pyproject.toml)
lxml==5.2.1
lxml==5.2.2
# via cumulusci (pyproject.toml)
markdown-it-py==2.2.0
# via
Expand Down Expand Up @@ -171,7 +171,7 @@ pathspec==0.12.1
# via black
pkgutil-resolve-name==1.3.10
# via jsonschema
platformdirs==4.2.1
platformdirs==4.2.2
# via
# black
# tox
Expand All @@ -196,7 +196,7 @@ pydantic==1.10.14
# snowfakery
pyflakes==2.3.1
# via flake8
pygments==2.17.2
pygments==2.18.0
# via
# furo
# rich
Expand Down Expand Up @@ -277,7 +277,7 @@ robotframework-seleniumlibrary==5.1.3
# via cumulusci (pyproject.toml)
robotframework-stacktrace==0.4.1
# via robotframework-pabot
rpds-py==0.18.0
rpds-py==0.18.1
# via
# jsonschema
# referencing
Expand Down Expand Up @@ -370,7 +370,7 @@ vcrpy==6.0.1
# via
# cumulusci (pyproject.toml)
# pytest-vcr
virtualenv==20.26.1
virtualenv==20.26.2
# via
# pre-commit
# tox
Expand All @@ -380,7 +380,7 @@ xmltodict==0.13.0
# via cumulusci (pyproject.toml)
yarl==1.9.4
# via vcrpy
zipp==3.18.1
zipp==3.18.2
# via
# importlib-metadata
# importlib-resources
Expand Down
8 changes: 4 additions & 4 deletions requirements/prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ click==8.1.7
# via
# cumulusci (pyproject.toml)
# snowfakery
cryptography==42.0.5
cryptography==42.0.7
# via
# authlib
# cumulusci (pyproject.toml)
Expand Down Expand Up @@ -68,7 +68,7 @@ jinja2==3.1.3
# snowfakery
keyring==23.0.1
# via cumulusci (pyproject.toml)
lxml==5.2.1
lxml==5.2.2
# via cumulusci (pyproject.toml)
markdown-it-py==2.2.0
# via
Expand All @@ -91,7 +91,7 @@ pydantic==1.10.14
# via
# cumulusci (pyproject.toml)
# snowfakery
pygments==2.17.2
pygments==2.18.0
# via rich
pyjwt[crypto]==2.8.0
# via
Expand Down Expand Up @@ -186,7 +186,7 @@ urllib3==1.26.18
# snowfakery
xmltodict==0.13.0
# via cumulusci (pyproject.toml)
zipp==3.18.1
zipp==3.18.2
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
Expand Down

0 comments on commit 793c181

Please sign in to comment.