Skip to content

Add Python 3.11 to 3006.x build matrix (#69526) - #69527

Merged
dwoz merged 10 commits into
saltstack:3006.xfrom
dwoz:fix/issue-69526-py311-3006x
Jun 30, 2026
Merged

dwoz merged 10 commits into
saltstack:3006.xfrom
dwoz:fix/issue-69526-py311-3006x

Conversation

@dwoz

@dwoz dwoz commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

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.py re-renders the ci/nightly/scheduled/staging workflows 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:

  • All onedir-deps, build-salt-onedir and build-packages jobs succeed on Linux/Windows/macOS for the new 3.11.15 interpreter
  • pkg + functional + integration test slugs run green on the rebuilt onedirs
  • No regressions specific to py3.11 stdlib differences (asyncio, ssl, importlib.metadata) light up

User-visible upgrade note: the onedir extras-3.10 directory becomes extras-3.11, so users of salt-pip-installed extensions will need to reinstall them after upgrade. Captured in the changelog entry.

Fixes #69526

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
dwoz added 4 commits June 25, 2026 15:09
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.
@dwoz

dwoz commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

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 cause

3006.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

Test Failure
`test_x509_v2::test_sign_remote_certificate` `ca_server did not respond` -- peer publish drops
`test_x509_v2::test_sign_remote_certificate_compound_match` same
`test_state_x509_v2::test_certificate_managed_remote` `assert 1 == 0` (peer publish drops)
`test_state_pillar_errors::test_state_apply_continues_after_pillar_error_is_fixed` `FactoryTimeout` after 50s
`test_state_queue::test_state_queue_true` `Job failed: ProcessResult`
`test_state_queue_loop::test_state_queue_no_loop` `Job failed: ProcessResult`
`test_state_state_events::test_{highstate,sls,sls_id}_state_events` `assert 1 == 0`
`test_pillar::test_pillar_refresh_pillar_items` `FactoryTimeout`
`netapi/test_client::test_local{,_async}` leaked test-pollution minions (`minion-XXX-{highstate,sls,top,empty-string}`)
`netapi/rest_tornado/test_minions_api_handler::test_post{,_with_client}` same
`netapi/rest_tornado/test_root_handler::test_{simple,multi}_local_async_post*` same

Action on this PR

Nothing -- 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.

@sujitdb sujitdb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

This branch was previously deployed

1 inactive deployment
ci — 6fb5b3dc Deployed Jun 30, 2026 by dwoz via Build Onedir Packages / macOS (x86_64) #24883
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants