Skip to content

Commit 452d7d2

Browse files
authored
Update .yaml workflows in update-python-config (#23573)
* Update .yaml workflows in update-python-config The CI file glob only matched .yml, missing workflows like claim-pypi-name.yaml and dependency-wheel-promotion.yaml, which is why some workflows still pinned older Python versions while the rest of the repo had moved on. * Add changelog entry
1 parent f585236 commit 452d7d2

4 files changed

Lines changed: 24 additions & 3 deletions

File tree

ddev/changelog.d/23573.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Include .yaml workflow files in update-python-config so all workflow Python pins are updated.

ddev/src/ddev/cli/meta/scripts/update_py_config.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ def integrations(app):
6060

6161

6262
def update_ci_files(app: Application, new_version: str, old_version: str, tracker: ValidationTracker):
63+
workflows_dir = app.repo.path / ".github" / "workflows"
6364
files_to_update = [
64-
*(app.repo.path / ".github" / "workflows").glob("*.yml"),
65-
*(app.repo.path / ".github" / "workflows" / "scripts").glob("*.sh"),
65+
*workflows_dir.glob("*.yml"),
66+
*workflows_dir.glob("*.yaml"),
67+
*(workflows_dir / "scripts").glob("*.sh"),
6668
]
6769

6870
# Patterns to match:

ddev/tests/cli/meta/scripts/conftest.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,19 @@ def fake_repo(tmp_path_factory, config_file, local_repo, ddev, mocker):
107107
""",
108108
)
109109

110+
write_file(
111+
repo_path / '.github' / 'workflows',
112+
'claim-pypi-name.yaml',
113+
f"""name: claim pypi name
114+
jobs:
115+
claim:
116+
steps:
117+
- uses: actions/setup-python@v6
118+
with:
119+
python-version: "{OLD_PYTHON_VERSION}"
120+
""",
121+
)
122+
110123
write_file(
111124
repo_path / 'ddev',
112125
'pyproject.toml',

ddev/tests/cli/meta/scripts/test_update_py_config.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def test_update_py_config(fake_repo, ddev):
1414
result = ddev('meta', 'scripts', 'update-python-config', NEW_PYTHON_VERSION)
1515

1616
assert result.exit_code == 0, result.output
17-
assert result.output.endswith('Python upgrades\n\nPassed: 9\n')
17+
assert result.output.endswith('Python upgrades\n\nPassed: 10\n')
1818

1919
contents = constant_file.read_text()
2020
assert f'PYTHON_VERSION = {OLD_PYTHON_VERSION!r}' not in contents
@@ -25,6 +25,11 @@ def test_update_py_config(fake_repo, ddev):
2525
assert f'PYTHON_VERSION: "{OLD_PYTHON_VERSION}"' not in contents
2626
assert f'PYTHON_VERSION: "{NEW_PYTHON_VERSION}"' in contents
2727

28+
yaml_workflow = fake_repo.path / '.github' / 'workflows' / 'claim-pypi-name.yaml'
29+
contents = yaml_workflow.read_text()
30+
assert f'python-version: "{OLD_PYTHON_VERSION}"' not in contents
31+
assert f'python-version: "{NEW_PYTHON_VERSION}"' in contents
32+
2833
hatch_file = fake_repo.path / 'dummy' / 'hatch.toml'
2934
contents = hatch_file.read_text()
3035
assert f'python = ["{OLD_PYTHON_VERSION}"]' not in contents

0 commit comments

Comments
 (0)