Skip to content

[ci] Pin Python 3.12 in the documentation workflow - #4298

Merged
evallesp merged 1 commit into
openstack-k8s-operators:mainfrom
Valkyrie00:fix/docs-ci-python-312
Oct 27, 2026
Merged

evallesp merged 1 commit into
openstack-k8s-operators:mainfrom
Valkyrie00:fix/docs-ci-python-312

Conversation

@Valkyrie00

Copy link
Copy Markdown
Contributor

The Documentation check job started failing on every PR touching a markdown file after GitHub began rolling ubuntu-latest from Ubuntu 24.04 to Ubuntu 26.04 (actions/runner-images#14748).

The new image ships Python 3.14 as the default python, and docs/source/build-docs.sh creates its virtualenv with a bare python -m venv.

The job therefore installs the pinned ansible-core==2.15.13 (from docs/doc-requirements.txt) under Python 3.14. That release parses module docs through the ast.Constant.s alias, removed in Python 3.14, so make docs fails on the first module:

ansible.errors.AnsibleParserError: Unable to parse documentation
in python file '../../plugins/modules/approve_csr.py':
'Constant' object has no attribute 's'

This is unrelated to the content of the affected PRs: the failure happens at ansible-doc-extractor, before the Sphinx build.


Add actions/setup-python@v5 pinned to 3.12 in the documentation workflow. build-docs.sh picks it up from PATH, so the docs virtualenv returns to the interpreter combination that was green until the runner image changed (Python 3.12 + ansible-core==2.15.13). ansible-core stays at 2.15.13, and the broader CI runtime migration to Python 3.12 / ansible-core 2.16 is intentionally left out of this PR.

Assisted-By: OpenCode

GitHub's `ubuntu-latest` now resolves to Ubuntu 26.04, whose default
`python` is 3.14. The docs venv is created with a bare `python -m venv`,
so `ansible-core==2.15.13` now runs under 3.14 and fails in
`ansible-doc-extractor` with `'Constant' object has no attribute 's'`
(the `ast.Constant.s` alias was removed in 3.14). Pin the workflow to
Python 3.12 to restore the previously green combination.

Signed-off-by: Vito Castellano <vcastell@redhat.com>
@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Pin Python 3.12 for documentation CI

🐞 Bug fix ⚙️ Configuration changes 🕐 Less than 10 minutes

Grey Divider

AI Description

• Pin the documentation workflow to Python 3.12 before building docs.
• Restore compatibility with the pinned ansible-core version without changing the broader CI
 runtime.
Diagram

graph TD
  runner["Ubuntu runner"] --> setup["Python 3.12 setup"] --> job["Documentation job"] --> script["Docs build script"] --> venv["Python virtualenv"] --> deps["Docs dependencies"]
Loading
High-Level Assessment

Pinning Python in the documentation job is the narrowest fix: it preserves the existing ansible-core dependency while avoiding reliance on the runner's default interpreter. Pinning an older runner image or upgrading ansible-core would broaden the change unnecessarily.

Files changed (1) +5 / -0

Bug fix (1) +5 / -0
documentation.ymlSet up Python 3.12 before documentation dependencies +5/-0

Set up Python 3.12 before documentation dependencies

• Adds actions/setup-python ahead of dependency installation and the docs build. This ensures build-docs.sh creates its virtual environment with Python 3.12 rather than the runner's default Python.

.github/workflows/documentation.yml

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build succeeded (check pipeline).
https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/89a46edd07b34eef834f6725e778fac1

✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 31s
✔️ cifmw-pod-pre-commit SUCCESS in 8m 41s

Warning:
File .kube/http-cache/bdd7b2cb6584e62d442216995e51db5f found in build home directory during playbook review.rdoproject.org/rdo-jobs/playbooks/base/pre.yaml for job cifmw-pod-ansible-test. Add to preserve-home-paths if safe, or otherwise remove.
File .kube/http-cache/3418855402ab8666a195458ea6d5d4a2 found in build home directory during playbook review.rdoproject.org/rdo-jobs/playbooks/base/pre.yaml for job cifmw-pod-ansible-test. Add to preserve-home-paths if safe, or otherwise remove.
File .kube/http-cache/a0a4de7d63733803eeececaa48e4969f found in build home directory during playbook review.rdoproject.org/rdo-jobs/playbooks/base/pre.yaml for job cifmw-pod-ansible-test. Add to preserve-home-paths if safe, or otherwise remove.
File .kube/cache/discovery/38.102.83.139_9023/servergroups.json found in build home directory during playbook review.rdoproject.org/rdo-jobs/playbooks/base/pre.yaml for job cifmw-pod-ansible-test. Add to preserve-home-paths if safe, or otherwise remove.
File .kube/cache/discovery/38.102.83.139_9023/v1/serverresources.json found in build home directory during playbook review.rdoproject.org/rdo-jobs/playbooks/base/pre.yaml for job cifmw-pod-ansible-test. Add to preserve-home-paths if safe, or otherwise remove.
File .ssh/config found in build home directory during playbook github.com/openstack-k8s-operators/ci-framework/ci/playbooks/pod-jobs.yml for job cifmw-pod-ansible-test. Add to preserve-home-paths if safe, or otherwise remove.
File .kube/http-cache/58d4363e5b5bd30e095238b0ec5d42f2 found in build home directory during playbook review.rdoproject.org/rdo-jobs/playbooks/base/pre.yaml for job cifmw-pod-pre-commit. Add to preserve-home-paths if safe, or otherwise remove.
File .kube/http-cache/596239d8158c9e304863ae34e9b235c0 found in build home directory during playbook review.rdoproject.org/rdo-jobs/playbooks/base/pre.yaml for job cifmw-pod-pre-commit. Add to preserve-home-paths if safe, or otherwise remove.
File .kube/http-cache/87a697f916b532cf44ccb197ff7ba2e3 found in build home directory during playbook review.rdoproject.org/rdo-jobs/playbooks/base/pre.yaml for job cifmw-pod-pre-commit. Add to preserve-home-paths if safe, or otherwise remove.
File .kube/cache/discovery/38.102.83.186_9023/servergroups.json found in build home directory during playbook review.rdoproject.org/rdo-jobs/playbooks/base/pre.yaml for job cifmw-pod-pre-commit. Add to preserve-home-paths if safe, or otherwise remove.
File .kube/cache/discovery/38.102.83.186_9023/v1/serverresources.json found in build home directory during playbook review.rdoproject.org/rdo-jobs/playbooks/base/pre.yaml for job cifmw-pod-pre-commit. Add to preserve-home-paths if safe, or otherwise remove.
File .ssh/config found in build home directory during playbook github.com/openstack-k8s-operators/ci-framework/ci/playbooks/pod-jobs.yml for job cifmw-pod-pre-commit. Add to preserve-home-paths if safe, or otherwise remove.

@evallesp evallesp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@openshift-ci

openshift-ci Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: evallesp

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@evallesp
evallesp merged commit 9232044 into openstack-k8s-operators:main Oct 27, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants