Skip to content

Commit c731219

Browse files
authored
Merge pull request #3844 from SFDO-Tooling/cumulusci-v4
Release v4.0.0
2 parents 42093d7 + d89b621 commit c731219

50 files changed

Lines changed: 2228 additions & 855 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/feature_test.yml

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,22 @@ jobs:
2222
uses: actions/checkout@v4
2323
with:
2424
fetch-depth: 1
25-
- name: Set up Python 3.8
25+
- name: Set up Python 3.11
2626
id: py
2727
uses: actions/setup-python@v4
2828
with:
29-
python-version: 3.8
30-
cache: pip
31-
cache-dependency-path: "requirements/*.txt"
29+
python-version: 3.11
30+
- name: Set up uv
31+
uses: SFDO-Tooling/setup-uv@main
32+
with:
33+
version: "0.5.0"
34+
enable-cache: true
3235
- name: Install dependencies
33-
run: pip install -r requirements_dev.txt
36+
run: uv sync --group docs
3437
- name: Build Docs
35-
run: make docs
38+
run: |
39+
cd docs
40+
uv run sphinx-build -b html . ./_build
3641
3742
unit_tests:
3843
name: "Unit tests: ${{ matrix.os }}-${{ matrix.python-version }}"
@@ -41,39 +46,39 @@ jobs:
4146
fail-fast: false
4247
matrix:
4348
os: [macos-latest, SFDO-Tooling-Ubuntu, SFDO-Tooling-Windows]
44-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
45-
exclude:
46-
- os: macos-latest
47-
python-version: 3.8
48-
include:
49-
- os: macos-13
50-
python-version: 3.8
49+
python-version: ["3.11", "3.12", "3.13"]
5150
steps:
5251
- uses: actions/checkout@v4
5352
- name: Set up Python
5453
uses: actions/setup-python@v4
5554
with:
5655
python-version: "${{ matrix.python-version }}"
57-
cache: pip
58-
cache-dependency-path: "requirements/*.txt"
56+
- name: Set up uv
57+
uses: SFDO-Tooling/setup-uv@main
58+
with:
59+
version: "0.5.0"
60+
enable-cache: true
5961
- name: Install dependencies
60-
run: pip install -r requirements_dev.txt
62+
run: uv sync -p ${{ matrix.python-version }}
6163
- name: Run Pytest
62-
run: pytest --cov-report= --cov=cumulusci
64+
run: uv run pytest --cov-report= --cov=cumulusci
6365

6466
robot_api:
6567
name: "Robot: No browser"
6668
runs-on: SFDO-Tooling-Ubuntu
6769
steps:
6870
- uses: actions/checkout@v4
69-
- name: Set up Python 3.8
71+
- name: Set up Python 3.11
7072
uses: actions/setup-python@v4
7173
with:
72-
python-version: 3.8
73-
cache: pip
74-
cache-dependency-path: "requirements/*.txt"
75-
- name: Install Python dependencies
76-
run: pip install -r requirements_dev.txt
74+
python-version: 3.11
75+
- name: Set up uv
76+
uses: SFDO-Tooling/setup-uv@main
77+
with:
78+
version: "0.5.0"
79+
enable-cache: true
80+
- name: Install dependencies
81+
run: uv sync -p 3.11
7782
- name: Install sfdx
7883
run: |
7984
mkdir sfdx
@@ -90,15 +95,15 @@ jobs:
9095
SFDX_HUB_USERNAME: ${{ secrets.SFDX_HUB_USERNAME }}
9196
- name: Run robot tests
9297
run: |
93-
coverage run --append $(which cci) task run robot \
98+
uv run cci task run robot \
9499
--org dev \
95100
-o name "CumulusCI" \
96101
-o suites cumulusci/robotframework/tests \
97102
-o include no-browser
98103
- name: Delete scratch org
99104
if: always()
100105
run: |
101-
cci org scratch_delete dev
106+
uv run cci org scratch_delete dev
102107
- name: Store robot results
103108
if: failure()
104109
uses: actions/upload-artifact@v4

.github/workflows/pre-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
runs-on: SFDO-Tooling-Ubuntu
2323
steps:
2424
- uses: actions/checkout@main
25-
- name: Set up Python 3.8
25+
- name: Set up Python 3.11
2626
uses: actions/setup-python@v4
2727
with:
28-
python-version: 3.8
28+
python-version: 3.11
2929
cache: pip
3030
- name: Install build tool
3131
run: python -m pip install hatch

.github/workflows/release.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,13 @@ jobs:
1515
runs-on: SFDO-Tooling-Ubuntu
1616
steps:
1717
- uses: actions/checkout@main
18-
- name: Set up Python 3.8
18+
- name: Set up Python 3.11
1919
uses: actions/setup-python@v4
2020
with:
21-
python-version: 3.8
21+
python-version: 3.11
2222
cache: pip
2323
- name: Install build tools
2424
run: python -m pip install hatch tomli tomli-w
25-
- name: Pin dependencies
26-
run: python utility/pin_dependencies.py
2725
- name: Build source tarball and binary wheel
2826
run: hatch build -c
2927
- name: Upload to PyPI

.github/workflows/release_test.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ jobs:
3737
runs-on: SFDO-Tooling-Ubuntu
3838
steps:
3939
- uses: actions/checkout@v3
40-
- name: Set up Python 3.8
40+
- name: Set up Python 3.11
4141
uses: actions/setup-python@v4
4242
with:
43-
python-version: 3.8
43+
python-version: 3.11
4444
cache: pip
45-
cache-dependency-path: "requirements/*.txt"
45+
cache-dependency-path: "pyproject.toml"
4646
- name: Install build tools
4747
run: pip install hatch
4848
- name: Test source tarball and binary wheel
@@ -71,14 +71,19 @@ jobs:
7171
concurrency: release
7272
steps:
7373
- uses: actions/checkout@v3
74-
- name: Set up Python 3.8
74+
- name: Set up Python 3.11
7575
uses: actions/setup-python@v4
7676
with:
77-
python-version: 3.8
77+
python-version: 3.11
7878
cache: pip
79-
cache-dependency-path: "requirements/*.txt"
79+
cache-dependency-path: "pyproject.toml"
80+
- name: Set up uv
81+
uses: SFDO-Tooling/setup-uv@main
82+
with:
83+
version: "0.5.0"
84+
enable-cache: true
8085
- name: Install Python dependencies
81-
run: pip install -r requirements_dev.txt
86+
run: uv sync
8287
- name: Install sfdx
8388
run: |
8489
mkdir sfdx
@@ -95,17 +100,17 @@ jobs:
95100
- name: Run ci_feature flow
96101
run: |
97102
cd CumulusCI-Test
98-
coverage run --append --rcfile=../pyproject.toml --source=../cumulusci $(which cci) flow run ci_feature --org scratch --delete-org
103+
uv run cci flow run ci_feature --org scratch --delete-org
99104
- name: Run ci_beta flow
100105
run: |
101106
cd CumulusCI-Test
102-
coverage run --append --rcfile=../pyproject.toml --source=../cumulusci $(which cci) flow run ci_beta --org scratch --delete-org
107+
uv run cci flow run ci_beta --org scratch --delete-org
103108
- name: Run ci_master flow
104109
run: |
105110
cd CumulusCI-Test
106-
coverage run --append --rcfile=../pyproject.toml --source=../cumulusci $(which cci) flow run ci_master --org scratch --delete-org
111+
uv run cci flow run ci_master --org scratch --delete-org
107112
- name: Run release_beta flow
108113
run: |
109114
export SFDX_HUB_KEY="$(echo $SFDX_HUB_KEY_BASE64 | base64 --decode)"
110115
cd CumulusCI-Test
111-
coverage run --append --rcfile=../pyproject.toml --source=../cumulusci $(which cci) flow run release_beta --org packaging
116+
uv run cci flow run release_beta --org packaging

.github/workflows/slow_integration_tests.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525
runs-on: SFDO-Tooling-Ubuntu
2626
steps:
2727
- uses: actions/checkout@v2
28-
- name: Set up Python 3.8
28+
- name: Set up Python 3.11
2929
uses: actions/setup-python@v4
3030
with:
31-
python-version: 3.8
31+
python-version: 3.11
3232
cache: pip
33-
cache-dependency-path: "requirements/*.txt"
33+
cache-dependency-path: "pyproject.toml"
3434
- name: Install Python dependencies
3535
run: |
3636
python -m pip install -U pip
37-
pip install -r requirements_dev.txt
37+
pip install .[test]
3838
- name: Install sfdx
3939
run: |
4040
mkdir sfdx
@@ -73,14 +73,14 @@ jobs:
7373
# org-shape: "prerelease"
7474
steps:
7575
- uses: actions/checkout@v2
76-
- name: Set up Python 3.8
76+
- name: Set up Python 3.11
7777
uses: actions/setup-python@v4
7878
with:
79-
python-version: 3.8
79+
python-version: 3.11
8080
cache: pip
81-
cache-dependency-path: "requirements/*.txt"
81+
cache-dependency-path: "pyproject.toml"
8282
- name: Install Python dependencies
83-
run: pip install -r requirements_dev.txt
83+
run: pip install .[test]
8484
- name: Install sfdx
8585
run: |
8686
mkdir sfdx

.github/workflows/update_dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ jobs:
77
update_python_dependencies:
88
uses: SFDO-Tooling/.github/.github/workflows/update_python_dependencies.yml@main
99
with:
10-
python-version: 3.8
10+
python-version: 3.11

cumulusci/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.93.0"
1+
__version__ = "4.0.0"

cumulusci/cli/tests/test_org.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,6 @@ def test_org_list(self, cli_tbl):
730730
],
731731
title="Connected Orgs",
732732
)
733-
734733
assert scratch_table_call in cli_tbl.call_args_list
735734
assert connected_table_call in cli_tbl.call_args_list
736735
runtime.keychain.cleanup_org_cache_dirs.assert_called_once()

cumulusci/core/config/scratch_org_config.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def days_alive(self) -> Optional[int]:
6161
return delta.days + 1
6262

6363
def create_org(self) -> None:
64-
"""Uses sfdx force:org:create to create the org"""
64+
"""Uses sf org create scratch to create the org"""
6565
if not self.config_file:
6666
raise ScratchOrgException(
6767
f"Scratch org config {self.name} is missing a config_file"
@@ -72,7 +72,7 @@ def create_org(self) -> None:
7272
args: List[str] = self._build_org_create_args()
7373
extra_args = os.environ.get("SFDX_ORG_CREATE_ARGS", "")
7474
p: sarge.Command = sfdx(
75-
f"force:org:create --json {extra_args}",
75+
f"org create scratch --json {extra_args}",
7676
args=args,
7777
username=None,
7878
log_note="Creating scratch org",
@@ -139,33 +139,32 @@ def _build_org_create_args(self) -> List[str]:
139139
args = ["-f", self.config_file, "-w", "120"]
140140
devhub_username: Optional[str] = self._choose_devhub_username()
141141
if devhub_username:
142-
args += ["--targetdevhubusername", devhub_username]
142+
args += ["--target-dev-hub", devhub_username]
143143
if not self.namespaced:
144-
args += ["-n"]
144+
args += ["--no-namespace"]
145145
if self.noancestors:
146-
args += ["--noancestors"]
146+
args += ["--no-ancestors"]
147147
if self.days:
148-
args += ["--durationdays", str(self.days)]
148+
args += ["--duration-days", str(self.days)]
149149
if self.release:
150-
args += [f"release={self.release}"]
150+
args += [f"--release={self.release}"]
151151
if self.sfdx_alias:
152152
args += ["-a", self.sfdx_alias]
153153
with open(self.config_file, "r") as org_def:
154154
org_def_data = json.load(org_def)
155155
org_def_has_email = "adminEmail" in org_def_data
156156
if self.email_address and not org_def_has_email:
157-
args += [f"adminEmail={self.email_address}"]
157+
args += [f"--admin-email={self.email_address}"]
158158
if self.default:
159-
args += ["-s"]
160-
if instance := self.instance or os.environ.get("SFDX_SIGNUP_INSTANCE"):
161-
args += [f"instance={instance}"]
159+
args += ["--set-default"]
160+
162161
return args
163162

164163
def _choose_devhub_username(self) -> Optional[str]:
165164
"""Determine which devhub username to specify when calling sfdx, if any."""
166165
# If a devhub was specified via `cci org scratch`, use it.
167166
# (This will return None if "devhub" isn't set in the org config,
168-
# in which case sfdx will use its defaultdevhubusername.)
167+
# in which case sf will use its target-dev-hub.)
169168
devhub_username = self.devhub
170169
if not devhub_username and self.keychain is not None:
171170
# Otherwise see if one is configured via the "devhub" service
@@ -178,7 +177,7 @@ def _choose_devhub_username(self) -> Optional[str]:
178177
return devhub_username
179178

180179
def generate_password(self) -> None:
181-
"""Generates an org password with: sfdx force:user:password:generate.
180+
"""Generates an org password with: sf org generate password.
182181
On a non-zero return code, set the password_failed in our config
183182
and log the output (stdout/stderr) from sfdx."""
184183

@@ -187,7 +186,7 @@ def generate_password(self) -> None:
187186
return
188187

189188
p: sarge.Command = sfdx(
190-
"force:user:password:generate",
189+
"org generate password",
191190
self.username,
192191
log_note="Generating scratch org user password",
193192
)
@@ -214,13 +213,13 @@ def can_delete(self) -> bool:
214213
return bool(self.date_created)
215214

216215
def delete_org(self) -> None:
217-
"""Uses sfdx force:org:delete to delete the org"""
216+
"""Uses sf org delete scratch to delete the org"""
218217
if not self.created:
219218
self.logger.info("Skipping org deletion: the scratch org does not exist.")
220219
return
221220

222221
p: sarge.Command = sfdx(
223-
"force:org:delete -p", self.username, "Deleting scratch org"
222+
"org delete scratch -p", self.username, "Deleting scratch org"
224223
)
225224
sfdx_output: List[str] = list(p.stdout_text) + list(p.stderr_text)
226225

cumulusci/core/config/sfdx_org_config.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ def sfdx_info(self):
2727
if not self.print_json:
2828
self.logger.info(f"Getting org info from Salesforce CLI for {username}")
2929

30-
# Call force:org:display and parse output to get instance_url and
30+
# Call org display and parse output to get instance_url and
3131
# access_token
32-
p = sfdx("force:org:display --json", self.username)
32+
p = sfdx("org display --json", self.username)
3333

3434
org_info = None
3535
stderr_list = [line.strip() for line in p.stderr_text]
@@ -166,7 +166,7 @@ def get_access_token(self, **userfields):
166166
else:
167167
username = result[0]["Username"]
168168

169-
p = sfdx(f"force:org:display --targetusername={username} --json")
169+
p = sfdx(f"org display --target-org={username} --json")
170170
if p.returncode:
171171
output = p.stdout_text.read()
172172
try:
@@ -183,9 +183,9 @@ def get_access_token(self, **userfields):
183183
return info["result"]["accessToken"]
184184

185185
def force_refresh_oauth_token(self):
186-
# Call force:org:display and parse output to get instance_url and
186+
# Call org display and parse output to get instance_url and
187187
# access_token
188-
p = sfdx("force:org:open -r", self.username, log_note="Refreshing OAuth token")
188+
p = sfdx("org open -r", self.username, log_note="Refreshing OAuth token")
189189

190190
stdout_list = [line.strip() for line in p.stdout_text]
191191

@@ -198,7 +198,7 @@ def force_refresh_oauth_token(self):
198198

199199
# Added a print json argument to check whether it is there or not
200200
def refresh_oauth_token(self, keychain, print_json=False):
201-
"""Use sfdx force:org:describe to refresh token instead of built in OAuth handling"""
201+
"""Use sfdx org display to refresh token instead of built in OAuth handling"""
202202
if hasattr(self, "_sfdx_info"):
203203
# Cache the sfdx_info for 1 hour to avoid unnecessary calls out to sfdx CLI
204204
delta = datetime.datetime.utcnow() - self._sfdx_info_date
@@ -208,7 +208,7 @@ def refresh_oauth_token(self, keychain, print_json=False):
208208
# Force a token refresh
209209
self.force_refresh_oauth_token()
210210
self.print_json = print_json
211-
# Get org info via sfdx force:org:display
211+
# Get org info via sf org display
212212
self.sfdx_info
213213
# Get additional org info by querying API
214214
self._load_orginfo()

0 commit comments

Comments
 (0)