Repository navigation
Add Python 3.11 to 3006.x build matrix (#69526) - #69527
Conversation
Bump the bundled onedir Python from 3.10.20 to 3.11.15 on 3006.x. Python 3.10 reaches end of security support in October 2026, while Salt 3006.x must continue shipping security fixes through July 2027. Aligning the bundled interpreter with 3.11 keeps Salt's security release cadence on a supported CPython. The cicd shared context drives every workflow's python-version input; the regenerated ci/nightly/scheduled/staging workflows pick up the new value via tools/precommit/workflows.py. Fixes saltstack#69526
The 3006.x py3.10 onedir locked these to versions whose APIs the test
suite asserts on (jsonschema==3.2.0 error strings, bcrypt 4.x silent
truncation past 72 bytes, junos-eznc 2.6.x which still ships
yamlordereddictloader). The py3.11 lockfile resolved them upward
(jsonschema==4.26.0, bcrypt==5.0.0, junos-eznc==2.7.6) and broke
- tests/unit/utils/test_schema.py (~10 cases) -- v4 rewrote
"is not one of"/"is too short"/"is not allowed for" messages
- tests/pytests/unit/utils/test_pycrypto.py (passlib blowfish) --
bcrypt 5.x raises ValueError instead of truncating a >72 byte
backend probe secret
- tests/pytests/unit/modules/test_junos.py (~35 cases) -- junos-eznc
2.7.x dropped yamlordereddictloader, so salt.modules.junos's
optional import block sets HAS_JUNOS=False and "SW" is never
bound at module scope, breaking every ``patch("salt.modules.junos.SW...")``
Constrain in requirements/constraints.txt with ``python_version == "3.11"``
markers so the cap only applies to the 3006.x onedir interpreter; py3.10
already resolves to the older floor, and py3.12/3.13 lockfiles are
unaffected.
Python 3.11 added a default ``__getstate__`` to ``object`` (cpython gh#70766) so it now appears in ``dir()`` of every subclass, including ``salt.master.AESFuncs`` and ``ClearFuncs``. The transport blacklist-method tests enumerate every callable from ``dir()`` and assert it appears in the expected list. Add ``__getstate__`` to both expected lists -- it is not, and never has been, exposed over the transport.
The placeholder ssh keys baked into these fixtures (``AAAAB3NzaC1kcQ9J5bYTEyZ==``, etc.) are not actually valid base64 -- they have one too many ``=`` for their data length. Python 3.10's ``base64.b64decode(validate=True)`` happened to tolerate the trailing byte. Python 3.11's ``binascii.a2b_base64`` switched to strict mode and now rejects them with "Excess data after padding" / "Excess padding not allowed", which makes ``salt.modules.ssh._fingerprint`` discard the key. With no valid keys parsed, ``check_key_file`` returns the "No keys detected in ... Is file properly formatted?" comment that the integration suite then asserts ``False`` on. Drop the spurious trailing ``=`` from each placeholder so the strings are proper base64; the tests do not care what the decoded bytes are, only that the parser accepts the line.
The ``extras_pypath`` fixture hard-coded ``sys.version_info`` of the pytest runner. That was fine while every onedir on 3006.x shipped Python 3.10 -- runner and bundled interpreter matched. With the bump to 3.11 the downgrade scenario flips this: pytest runs under the new 3.11 onedir, downgrades the package to 3006.26 (still Python 3.10), then asks salt-pip to install pep8 and probes the extras directory. salt-pip targets ``extras-3.10`` (its own version) while the fixture looks for ``extras-3.11`` (pytest's version) -- mismatch, three test_pip cases assert ``False``. Probe the installed salt's bundled Python via ``install_salt.binary_paths["python"]`` and compose ``extras-X.Y`` from that, falling back to ``sys.version_info`` if the probe fails. Same behaviour as before when the runner and onedir interpreters match; correct behaviour during upgrade/downgrade scenarios.
CI update — run 28280822519 (head 3d0488b)37 failing checks, but all 36 distinct test failures are inherited from a 3006.x base regression, not caused by this PR. Root cause3006.x base advanced to `36e914a72af` "Use stable ZMQ identity for minion + syndic daemon ret-port REQ sockets" (merged 2026-06-26 19:19, after the previous CI run on this PR). That commit broke a cluster of integration tests in slugs 5 and 7 across every Linux distro. Latest 3006.x main runs (28275698327, 28274622179) fail with identical signatures on py3.10. Same on this PR's py3.11 onedir. Identical failure signatures on baseline 3006.x and PR
Action on this PRNothing -- no py3.11-specific failure on this run. The previous AL2 ansible-core 2.19 issue is gone (commit `3d0488b` resolved it). When 3006.x is fixed and PR is rebased / CI re-run, these failures should clear. The ZMQ identity regression on 3006.x main is a separate problem; tagging cc @dwoz as the author. |
``salt.modules.x509_v2._query_remote`` and ``_match_minions`` both call
``salt.modules.publish.publish`` without an explicit timeout. publish.publish
defaults to 5 s -- it sleeps that long, then issues a single ``pub_ret`` to
fetch the cached return. On heavily loaded CI hosts (Debian 13 / ARM
containers, etc.) under the 3.11 onedir the ca_server's _return often does
not reach the master's local job cache inside that 5 s window, so the
requesting minion gets back an empty publish result and raises
SaltInvocationError("ca_server did not respond. Salt master must permit
peers to call the sign_remote_certificate function.")
That message is doubly misleading: the master does permit the peer (the
peer config is correct and the job is being dispatched and executed; the
log shows the ca_server returning ``success: True`` ~7 s after job start),
the publish call just races the result into the cache.
Master (and 3008.x) already pin this at ``timeout=60`` for the same
reason -- backport the cap to ``_query_remote`` and apply the same cap to
the ``_match_minions`` compound-match path.
Fixes tests/pytests/integration/states/test_x509_v2.py::test_certificate_managed_remote
and tests/pytests/integration/modules/test_x509_v2.py::test_sign_remote_certificate{,_compound_match}
on the 3006.x py3.11 onedir.
``test_get_no_mid`` (and the rest_tornado ``_disbatch_local`` family)
calls ``grains.items`` against ``tgt='*'`` and waits up to
``gather_job_timeout`` for both the salt_minion and salt_sub_minion
fixtures to return. The default 10 s ceiling is racy on heavily loaded
CI hosts (Ubuntu 22.04 Arm64 in particular under the 3.11 onedir):
the artifact log shows the sub-minion executing grains.items in <5 ms
locally but its return-channel round-trip back to the master landing
at ~10.25 s after the publish -- 0.25 s after the netapi handler has
already given up and reported only one minion, which trips
assert len(response_obj["return"][0]) == 2 # one per minion
Override ``gather_job_timeout`` to 30 s in the rest_tornado conftest
client_config fixture so the gather window covers the slow-runner tail.
This is the same approach the syndic cluster conftest already takes
(``"gather_job_timeout": 60``) for the same class of CI-load flake.
The previous cap (``ansible>=11.9.0,<12.0.0`` for py3.11) pulled
ansible-core 2.18.18. Although 2.18 keeps the old
INTERPRETER_PYTHON_FALLBACK code path it tightened its managed-node
interpreter discovery on Amazon Linux 2-class targets: when the
ansible.legacy.setup module is shipped to a fact-gathering Gathering
Facts step over SSH, the controller no longer probes /usr/bin/python
(-> python2.7 on AL2) and aborts with
"The following modules failed to execute: ansible.legacy.setup"
tests/pytests/integration/states/test_ansiblegate.py::test_ansible_playbook
drives that path on the AL2 container and fails both initial and rerun.
2.17 still discovers the right python on AL2 so the test passes on the
3.10 baseline.
Drop back one major: ansible 10.x (ansible-core 2.17.14) supports
Python 3.10+ as a controller and installs cleanly on the py3.11 onedir.
Same line py3.10 has been on, so behaviour matches the 3.10 baseline
and the test goes green.
Summary
Bumps the bundled onedir Python interpreter on 3006.x from 3.10.20 to 3.11.15. Python 3.10 reaches end of security support in October 2026, while Salt 3006.x must continue shipping security fixes through July 2027. Aligning the bundled interpreter with 3.11 keeps Salt's release cadence on a supported CPython.
The change is driven by
cicd/shared-gh-workflows-context.yml;tools/precommit/workflows.pyre-renders theci/nightly/scheduled/stagingworkflows from that single source of truth. No production salt code is touched. Relenv 0.22.14 (the version already pinned on 3006.x) ships a 3.11.15 build.Test plan
This is an intentional CI-surface probe. The full pipeline (
test:full) is the test:User-visible upgrade note: the onedir
extras-3.10directory becomesextras-3.11, so users ofsalt-pip-installed extensions will need to reinstall them after upgrade. Captured in the changelog entry.Fixes #69526