Commit Graph

3931 Commits (ced63f96d96975d0ba06842b8f1fb6341d0cecdd)
 

Author SHA1 Message Date
Alex Willmer ced63f96d9
Merge pull request #1332 from moreati/release-v0.3.27
Release v0.3.27
3 months ago
Alex Willmer cbf47967b1 Merge commit '154331e455a3153252e44fe41a9e0b3d08ccf477' into release-v0.3.27 3 months ago
Alex Willmer 154331e455 Prepare v0.3.27 3 months ago
Alex Willmer b8d3f86b12
Merge pull request #1328 from moreati/issue1325-scan_code_imports-refactor
mitogen: Refactor `mitogen.master.scan_code_imports()` -> `mitogen.imports.codeobj_imports()`
3 months ago
Alex Willmer 0e5f47f145 mitogen: Refactor scan_code_imports() as mitogen.imports.codeobj_imports()
This replaces `mitogen.master.scan_code_imports()` with
`mitogen.imports.codeobj_imports()`. The Python 3.x implementation now uses
`str.find()`, relying on Python >= 3.6 "widecode" format. Behaviour and
semantics should be unchanged. Now implementations are approx
- 1.5 x faster on Python 2.x
- 2 - 3 x faster on Python 3.x

Before
```console
$ ./tests/bench/scan_code
scan_code_imports python2.7  100 loops, best of 3: 3.19 msec per loop
scan_code_imports python3.9  500 loops, best of 5: 685 usec per loop
scan_code_imports python3.10  500 loops, best of 5: 727 usec per loop
scan_code_imports python3.11  500 loops, best of 5: 601 usec per loop
scan_code_imports python3.12  500 loops, best of 5: 609 usec per loop
scan_code_imports python3.13  500 loops, best of 5: 586 usec per loop
```

After
```console
codeobj_imports python2.7  1000 loops, best of 3: 1.98 msec per loop
codeobj_imports python3.9  1000 loops, best of 5: 302 usec per loop
codeobj_imports python3.10  1000 loops, best of 5: 297 usec per loop
codeobj_imports python3.11  1000 loops, best of 5: 243 usec per loop
codeobj_imports python3.12  1000 loops, best of 5: 278 usec per loop
codeobj_imports python3.13  1000 loops, best of 5: 259 usec per loop
```
```console
$ uname -a
Darwin kintha 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:29 PDT
2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6000 arm64
```
4 months ago
Alex Willmer 3093d0bb2d tests: Add scan_code_imports benchmark
```console
$ ./tests/bench/scan_code
scan_code_imports python2.7  100 loops, best of 3: 3.19 msec per loop
scan_code_imports python3.9  500 loops, best of 5: 685 usec per loop
scan_code_imports python3.10  500 loops, best of 5: 727 usec per loop
scan_code_imports python3.11  500 loops, best of 5: 601 usec per loop
scan_code_imports python3.12  500 loops, best of 5: 609 usec per loop
scan_code_imports python3.13  500 loops, best of 5: 586 usec per loop
```
4 months ago
Alex Willmer 2fd88298ae tests: Improve master_test.ScanCodeImportsTest coverage
This covers existing behaviours of `mitogen.master.scan_code_imports()` some
of which are relied on, some not, but regardless weren't tested. Notably
- Explicit relative imports return level > 0
- Imports inside `class` and `def` are excluded
- Imports inside other blocks are included
- Python 3.x prunes impossible if/else branches (previously unknown)

It also
- Decouples the test results from the implementation details of the unit test.
- Fixes a missing import
- Fixes at least one Python 2.4 incompatibility (use of with block)
4 months ago
Alex Willmer 1386529493
Merge pull request #1330 from moreati/gha-workflow-cleanup
CI: Refactor and de-duplicate Github Actions workflow
4 months ago
Alex Willmer 618eccc0f3 CI: Set macOS failed logins limit of mitogen test users to 1000
refs #1315
4 months ago
Alex Willmer 9e3377c0a8 CI: Combine build deps & tooling steps 4 months ago
Alex Willmer e3241912f7 CI: Factor out .ci/show_python_versions 4 months ago
Alex Willmer 9b6fc117f9 CI: Remove unused python_version vars from Ubuntu 22.04 jobs 4 months ago
Alex Willmer f77db1da59
Merge pull request #1321 from moreati/release-v0.3.26
Release v0.3.26
4 months ago
Alex Willmer 4cad51a629
Merge pull request #1320 from moreati/prepare-v0.3.26
Prepare v0.3.26
4 months ago
Alex Willmer fd1d45568a Merge commit '5908936' into release-v0.3.26 4 months ago
Alex Willmer 7fb7567809 Begin v0.3.27dev 4 months ago
Alex Willmer 5908936f8c Prepare v0.3.26 4 months ago
Alex Willmer 64feda250e
Merge pull request #1300 from moreati/issue712-stdout-non-blocking
stdio EAGAIN investigation
4 months ago
Alex Willmer 17bee70dc2 mitogen: Fix BlockingIOError & EAGAIN in subprocess stdio
Mitogen was leaving the stdout and stderr of subprocesses in non-blocking
mode. When Python code ran in the remote process created by Mitogen calls such
as `print(long_string)` or `os.stout.write(bigger_than_the_buffer)` sometimes
raised `BlockingIOError`, or similar.

This change
- Removes code in `mitogen.core.Side` that set blocking/non-blocking mode
- Adds blocking/non-blocking control to `os.mitogen.pipe()` and a new
  function `mitogen.core.socketpair()`
- Replaces `mitogen.core.set_block` and `mitogen.core.set_nonblock`
  with `mitogen.core.set_blocking`, mirroring `os.set_blocking`
- Updates call sites as appropriate
- Adds tests for new functions and arguments
- Adds a regression test for subprocess stdio blocking/non-blocking

fixes #712
4 months ago
Alex Willmer 4529a217e8
Merge pull request #1301 from moreati/repear-delay-simplify
mitogen: Simplify `mitogen.parent.Reaper._calc_delay()` calculation
4 months ago
Alex Willmer fde2dda87e mitogen: Simplify `mitogen.parent.Reaper._calc_delay()` calculation 4 months ago
Alex Willmer 65db935c57
Merge pull request #1311 from moreati/issue1309
ansible_mitogen: Fix `become_method=doas`, add tests
4 months ago
Alex Willmer 868d77a402 ansible_mitogen: Fix become_method=doas, add tests 4 months ago
Alex Willmer d6e74ad663
Merge pull request #1319 from moreati/ci-job-names
CI: Abbreviate Github Actions job names
4 months ago
Alex Willmer 32f6d0c358 CI: Abbreviate Github Actions job names
This is to prevent job names being truncated in the Github Actions web UI. So
it is obvious at a glance which jobs have failed. Previously one had to click
into the details to know which job was which, leading to confusion and wasted
time.

This also

- removes braced ranges in `testenv.setenv`. They appear not to be supported
  by tox (see https://github.com/tox-dev/tox/issues/3571)
- fixes the env var `DEFAULT_STDOUT_CALLBACK` -> `ANSIBLE_STDOUT_CALLBACK`

as a result of these test output format was previously not as intended for
some Ansible versions.
4 months ago
Alex Willmer 021d712edc
Merge pull request #1316 from moreati/release-v0.3.25
Release v0.3.25
4 months ago
Alex Willmer 536ab7d78e Merge commit 'dfafa14' into release-v0.3.25 4 months ago
Alex Willmer 53ab2b2a4d
Merge pull request #1313 from moreati/prep-0.3.25
Prep 0.3.25
4 months ago
Alex Willmer 7f84874755 Begin 0.3.26dev 4 months ago
Alex Willmer dfafa1430e Prepare v0.3.25 4 months ago
Alex Willmer d240a78af3
Merge pull request #1308 from moreati/prep-v0.3.25b1
Prepare v0.3.25b1
4 months ago
Alex Willmer fa22aa1c8e Resume 0.3.25dev 4 months ago
Alex Willmer 2ae35c8a15 Prepare v0.3.25b1 4 months ago
Alex Willmer 058787ff83
Merge pull request #1304 from moreati/issue1303
CI: Switch to archived Debian 10 (buster) apt repository
5 months ago
Alex Willmer 573303ac73 CI: Switch to archived Debian 10 (buster) apt repository
The Debian project recently removed this EOL version from the live mirrors.
5 months ago
Alex Willmer bb18d9e77a
Merge pull request #1298 from feteu/patch-1
Update missing host key checking argument in docs/ansible_detailed.rst
5 months ago
Fabio Greco d818b201b3
Update missing host key checking argument in docs/ansible_detailed.rst
The arguments ansible_ssh_host_key_checking and ansible_host_key_checking were missing in the documentation, while being introduced with the commit "5749845324"
5 months ago
Alex Willmer 2ff904951c
Merge pull request #1296 from moreati/prep-0.3.25a3
Prep 0.3.25a3, again
5 months ago
Alex Willmer d4adce5d7e Resume 0.3.25dev 5 months ago
Alex Willmer 8ccaa48d2a Correct v0.3.25a3 __version__ tuple 5 months ago
Alex Willmer d6b5ea0787
Merge pull request #1295 from moreati/prep-0.3.25a3
Prepare 0.3.25a3
5 months ago
Alex Willmer 8090943031 Resume 0.3.25dev 5 months ago
Alex Willmer 945933854a Prepare v0.3.25a3 5 months ago
Alex Willmer 72cfc785db
Merge pull request #1294 from moreati/issue1281
ansible_mitogen: Support ANSIBLE_SSH_VERBOSITY with Ansible >= 12
5 months ago
Alex Willmer c1296b5d75 ansible_mitogen: Support ANSIBLE_SSH_VERBOSITY with Ansible >= 12
In vanilla Ansible >= 12 (ansible-core 2.19)
- ssh connection plugin `verbosity` controls `ssh [-v[v[v]]]`
- config option `DEFAULT_VERBOSITY` controls whether that output is displayed

In vanilla Ansible <= 11 (ansible-core <= 2.18)
- `DEFAULT_VERBOSITY` controls both `ssh` verbosity & display verbositty

As of this change
- Mitogen + Ansible >= 12 behaviour matches vanilla Ansible >= 12.
- Mitogen + Ansible <= 11 behaviour remains unchanged
  - `DEFAULT_VERBOSITY` only controls display verbosity.
- Mitogen + Ansible respect the Ansible variable `mitogen_ssh_debug_level`

I've chosen not to retroactively replicate the old vanilla Ansible behaviour
in Mitogen + Ansible <= 11 cases. I'm pretty sure it was an oversight,
rather than a design choice, but Ansible+Mitogen with `ANSIBLE_VERBOSITY=3`
is already very verbose.

fixes #1282

See
- https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-verbosity
- https://docs.ansible.com/ansible/devel/collections/ansible/builtin/ssh_connection.html#parameter-verbosity
5 months ago
Alex Willmer 4dc286371f
Merge pull request #1289 from moreati/issue1275-ssh_askpass
CI: Test SSH password authentication without sshpass command
5 months ago
Alex Willmer 55b0ece0e7 CI: Test SSH password authentication without sshpass command
Ansible 12 (ansible-core 2.19) has gained support for specifying an SSH
password, without requiring `sshpass`. It specifies the environment variable
`SSH_ASKPASS` such that `ansible` itself is called.

Mitogen is already able to support this. This change provides test coverage of
the new feature by not installing `sshpass` on macOS runners. when Ansible 12
is under test. Ubuntu runners come with `sshpass` pre-installed.

Required Ansible is also bumped to the latest pre-releases, for relevant
fixes.
5 months ago
Alex Willmer 3cba11a126 CI: Fix ansible_version comparison with ansible-core 2.19.0rc1
Note that tests/ansible/integration/ssh/templated_by_play_taskvar.yml was
previously erroniously being skipped with ansible-core 2.19.0a<N> and
2.19.0b<N>.

fixes #1293
refs #1175
5 months ago
Alex Willmer 98ae5e2c32
Merge pull request #1291 from moreati/issue1285-ci-callback-format
CI: replace `stdout=yaml` with `result_format=yaml` for Ansible >= 6 tests
5 months ago
Alex Willmer f330c2b158 CI: replace stdout=yaml with result_format=yaml for Ansible >= 6 tests
Ansible >= 12 (ansible-core >= 2.19) deprecates `stdout_callback=yaml`,
superceded by `callback_result_format=yaml`. There is a change in behaviour:
`callback_result_format` applies to output of both `ansible-playbook` _and_
`ansible`.

Tests that run `ansible` in a subprocess are now explicitly configured to use
json (even if they don't inspect that output yet) for more assert-able output
across all versions of Ansible.
5 months ago