Commit Graph

3615 Commits (43a78e6f44a2f221803fe4e347b04cd6adce701f)
 

Author SHA1 Message Date
Alex Willmer 43a78e6f44 Merge remote-tracking branch 'upstream/master' into docs-master 2 months ago
Alex Willmer 6e4336ce0e
Merge pull request #1140 from moreati/prep-0.3.12
Prep 0.3.12
2 months ago
Alex Willmer 61b800781b Begin v0.3.13 development 2 months ago
Alex Willmer 298d28a650 Prep v0.3.12 2 months ago
Alex Willmer 3f288f934a docs: Correct 0.3.11 release month
Reports of Mitogen's time machine will have been greatly exaggerated.
2 months ago
Alex Willmer 8f7ec88a9f
Merge pull request #1139 from moreati/github-action-all-greens
CI: Add re-actors/alls-green GitHub Actions job
2 months ago
Alex Willmer b05b2c8c8e CI: Add re-actors/alls-green GitHub Actions job
This will allow a single job to be required in the GitHub branch protection
web UI; regardless of which jobs are added to or removed from the matrix of
platform specific, Ansible specific jobs.
2 months ago
Alex Willmer c9f2d905a0
Merge pull request #1137 from moreati/test-targets-disabled
tests: Ignore inventory files of inactive tests & benchmarks
2 months ago
Alex Willmer 3504bea3bb tests: Ignore inventory files of inactive tests & benchmarks
These targets are not used by any active tests, and the large numbers of hosts
multiply the size of the taskvars disctionary in memory to many (10s) MiB.

refs #1058
2 months ago
Alex Willmer de3c6dcdc9
Merge pull request #1136 from moreati/fail_msg
tests: Improve Ansible fail_msg formatting
2 months ago
Alex Willmer 6accc87da1 tests: Improve Ansible fail_msg formatting
By switching to block style (`|`) with clip (no `-` or `+`) the failure
messages don't require quoting and gain a single trailing newline. This causes
Ansible to print them as block style, when using the yaml stdout callback
plugin. As a result the values have one less layer of quoting and quote
escaping, making them much easier to read.
2 months ago
Alex Willmer 17d3f39e44
Merge pull request #1114 from moreati/ansible_ssh_password
`ansible_ssh_password` support
2 months ago
Alex Willmer 551690ee1d ansible_mitogen: Handle templated connection passwords and ansible_ssh_password
This switches `ansible_mitogen.transport_config.PlayContextSpec.password()` to
Ansible's plugin option framework. As a result
- The relatively recent `ansible_ssh_password` variable is now respected.
- The SSH connection password can be templated and specified as a play
  variable. Task variables will probably also work, but testing was blocked
  by #1132.

There is a chance this change will cause a regression in another connection
plugin (e.g. mitogen_docker), but nothing turned up in the test suite.
I intend ot migrate other connection configuration to
`ansible_mitogen.transport_config.PlayContextSpec._connect_option()`, the next
candidate is the remote port.

fixes #1106
2 months ago
Alex Willmer 3bdd3e237a tests: Coverage of support for ansible_ssh_password variable 2 months ago
michael.dsilva d0993e9918 allow ansible_ssh_password as it is documented as valid in current ansible documentation
Co-authored-by: Alex Willmer <alex@moreati.org.uk>
2 months ago
Alex Willmer 1d47004625 Merge branch 'master' into docs-master 2 months ago
Alex Willmer ab2a921744
Merge pull request #1130 from moreati/prep-0.3.11
Prep v0.3.11
2 months ago
Alex Willmer 809d169d36 Begin v0.3.12dev 2 months ago
Alex Willmer c63dc0e080 Prepare v0.3.11 2 months ago
Alex Willmer a51909ea79
Merge pull request #1128 from moreati/github-actions
CI: Begin migration from Azure DevOps to GitHub actions
2 months ago
Alex Willmer 90ad993c1a Merge branch 'master' into docs-master 2 months ago
Alex Willmer 4f60d01f09 CI: Enable GitHub Actions testing workflow
This replicate the existing Azure DevOps workflow, and adds a couple of new
jobs (Python 2.7 on macOS, Python + vanilla Ansible on Linux).

The GitHub Actions use container images hosted on GitHub Container Registry
(GHCR, ghcr.io/mitogen-hq). These images have been copied straight from the
existing Amazon Elastic Cloud Registry (AWS ECR, public.ecr.aws/n5z0e8q9).

A short period of parallel running is planned. Then a second PR will remove
the Azure DevOps workflow.
2 months ago
Alex Willmer 27214517a7 tests: Use a subprocess to check discovered python == running
This replaces the use of `os.path.realpath()` which gave incorrect results on
macOS - depending on the exact Python build, Python version, macOS version,
installation method, and phase of the moon.

realpath information kept around to aid debugging.
2 months ago
Alex Willmer c6c8bfb690 tests: Skip vanilla Ansible on Linux unpriviliged -> unprivileged become
CI containers lack the necessary `setfacl` command. This has not previously
been noticed because no vanilla Ansible jobs were being run on Linux, only on
macOS.

refs #1118
2 months ago
Alex Willmer 8b92e09655 ci: Extract container registry location into variables
Preperation for migrating from Azure DevOps with Amazon Elastic Container
Registry (AWS ECR), to GitHub Actions with GitHub Container Registry (GHCR).

DebOps tests are not currently being run, the updates to .ci/debops*.py are
best effort only.
2 months ago
Alex Willmer b926795973 ci: Move container registry authentication to an Azure Devops step
This aims to
- Reduce duplication
- Seperate CI specific setup from test setup
- Prepare for migration from Azure DevOps to GitHub Actions
2 months ago
Alex Willmer 2e2dfb147e
Merge pull request #1127 from moreati/import-cleanups
Consolidate backward compatibility imports and polyfills
2 months ago
Alex Willmer 0e7eefbc70 tests: Remove unused import 2 months ago
Alex Willmer 34088a8b7f ansible_mitogen: Consolidate Python 2 & 3 compatibility
Rough guidelines, in decending preference:
- Use mitogen.core if possible
- Use ansible.module_utils.six if possible
- Embed a getattr() or try/except

viewkeys() et al can't be brought into mitogen.core because that package still
targets Python 2.4. dict.viewkeys() were introduced in Python 2.7.
2 months ago
Alex Willmer 0a908d76da ansible_mitogen: Remove fallback imports for Ansible < 2.10 2 months ago
Alex Willmer b1fd6038bf ansible_mitogen: Remove Python 2.4 and 2.5 backward compatibility fallbacks
Because ansible_mitogen >= 0.3 supports Ansible >= 2.10 and Ansible 2.10
requires supports Python >= 2.7 on controllers and Python >= 2.6 on targets
these are dead weight.

See
- https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix
- tox.ini
2 months ago
Alex Willmer c6cf08ab39 mitogen: Consolidate back compatibility fallbacks and polyfills in mitogen.core
This saves some bytes on the wire ad simplifies reasoning about the code.
2 months ago
Alex Willmer c6c262c751 Merge branch 'master' into docs-master 2 months ago
Alex Willmer ce6297b0e9 Begin v0.3.11 2 months ago
Alex Willmer cea2e7b98d Prepare v0.3.10 2 months ago
Gaige B Paulsen 2ba1b2b3f8
Fix: termios.error: (22, 'Invalid argument') during `become` on Solaris/Illumos/SmartOS (#1089)
This fixes compatibility with Solaris/Illumos/SmartOS, addressing an issue that shows up most frequently with become. The issue was mostly due to differences in how the TTY driver is handled and the pty driver not supporting echo on both sides of the pipe (as designed, from a Solaris point of view).

Fixes #950

Co-authored-by: Alex Willmer <alex@moreati.org.uk>
2 months ago
Alex Willmer b8b15580af
Merge pull request #1119 from moreati/ci-resourcewarnings
CI: Reliability, eliminate a race condition and some resource leaks
2 months ago
Alex Willmer d032c591c2 tests: Retry container process check during teardown
I'm about 75% sure the check is an unavoidable race condition, see
https://github.com/mitogen-hq/mitogen/issues/694#issuecomment-2338001694. If
it occurs again, then reopen the issue.

Fixes #694
2 months ago
Alex Willmer 315204271e tests: Don't suppress output while testing unix Listener
It's not noisy, and it has been hiding an error I wasn't aware of.
2 months ago
Alex Willmer a3192d2beb mitogen: close mitogen.unix.Listener socket in error conditions
To avoid ResourceWarning
2 months ago
Alex Willmer 598de81143 mitogen: Fix subprocess ResourceWarning
Python 3.x emits `ResourceWarning`s if certains resources aren't correctly
closed. Due to the way Mitogen has been terminating child processes this has
been occurring.

```
test_dev_tty_open_succeeds
(create_child_test.TtyCreateChildTest.test_dev_tty_open_succeeds) ...
/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/subprocess.py:1127:
ResourceWarning: subprocess 3313 is still running
  _warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
ok
```

During garbage collection subprocess.Popen() objects emit
ResourceWarning("subprocess 123 is still running")
if proc.returncode hasn't been set. Typically calling proc.wait() does so,
once the sub-process has exited. Calling os.waitpid(proc.pid, 0) also waits
for the sub-process to exit, but it doesn't update proc.returncode, so the
ResourceWarning is still emitted.

This change exposes `subprocess.Popen` methods on
`mitogen.parent.PopenProcess`, so that the returncode can be set.

See https://gist.github.com/moreati/b8d157ff82cb15234bece4033accc5e5
2 months ago
Alex Willmer 7238403392 tests: Add missing logging import 2 months ago
Alex Willmer 7c92b8ef2b tests: Shutdown contexts on completion
This should terminate any child processes and connections.
2 months ago
Alex Willmer 7d9eebdb9a tests: Close file object in six_brokenpkg 2 months ago
Alex Willmer 16c602aaa2
Merge pull request #1117 from moreati/macos-no-py311
ci: Drop macOS Python 3.12 + Ansible 9 tests
3 months ago
Alex Willmer 4b4bfdc0f3 ci: Drop macOS Python 3.12 + Ansible 9 tests
They were meant to be replaced by Python 3.12 + ANsible 10, not supplemented.
3 months ago
Alex Willmer a8c0a414b8
Merge pull request #1071 from moreati/ansible-unpin
tests: Unpin versions of Ansible 2.10, 3, & 4
3 months ago
Alex Willmer f76ccbf8ed tests: Unpin versions of Ansible 2.10, 3, & 4 3 months ago
Alex Willmer fc7b7eaba1
Merge pull request #1115 from moreati/pr956
Initial support for templated `ansible_ssh_args`,   `ansible_ssh_common_args`, and `ansible_ssh_extra_args`
3 months ago
Alex Willmer 79ed797bad tests: Test templating of ansible_ssh_common_args et al
refs #905
3 months ago