update to cmem-plugin-template v9.6.1 and fix red test suite - #11
Merged
Merged
Conversation
Replays the template diff onto this repository and refreshes the locked dependencies that come with it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UhUJZ7EwjXm7mN2jAdZzvn
Coverage Report
|
Replays the v9.5.0 -> v9.6.1 template diff on top of the existing update. This restores the [tool.pytest.ini_options] table, whose absence let pytest's rootdir walk escape the project directory. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UhUJZ7EwjXm7mN2jAdZzvn
Three independent causes made the whole suite red. Debian 11 reached end of life and its packages were removed from deb.debian.org/debian-security, so building the test container failed with apt-get exit code 100 on systemd, libexpat1 and systemd-timesyncd. Move the container to debian:trixie-slim, which also pre-creates /var/run/sshd, hence the mkdir -p. Verified against OpenSSH 10.0p2 that RSA, ed25519-with-passphrase and password authentication all still work, as do the three deliberately unreadable fixtures. Testcontainers' Ryuk reaper bind-mounts the Docker socket, which Docker Desktop refuses for its per-user socket path, erroring every test before the container was even reached. The fixtures close their own containers, so disable the reaper by default in conftest. All ten ssh_client.connect() call sites left paramiko's allow_agent and look_for_keys at their True defaults, so the plugin offered the host's SSH agent keys and ~/.ssh private keys to the remote server before the key the task was configured with. Besides exposing credentials the task was never given, this exhausted sshd's MaxAuthTries and made a wrong username surface as SSHException instead of AuthenticationException. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qrn7YeZRTzyPMTZTkArKpZ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates this repository to
cmem-plugin-templatev9.6.1 viacopier update, refreshes the locked dependencies that come with it, and fixes the red test suite.Template update
…access to.Those files…); corrected while resolvingISC004.This request was originally raised against v9.5.0; a second commit moves it to v9.6.1, which restores the
[tool.pytest.ini_options]table. Without it pytest's rootdir walk escapes the project directory, sopytest-dotenvstops finding.envand the Corporate Memory integration tests run unconfigured.Test suite fixes
The suite was fully red, from three independent causes. An earlier note on this request blamed missing Docker or service credentials — that was wrong, and is corrected here.
1. The test container could no longer be built. Debian 11 reached end of life and its packages were removed from
deb.debian.org/debian-security, soapt-getexited 100 onsystemd,libexpat1andsystemd-timesyncd. This is what CI has been failing on. The container moves todebian:trixie-slim, which also pre-creates/var/run/sshd, hence themkdir -p.Verified against OpenSSH 10.0p2 that everything the tests rely on still holds: RSA, ed25519-with-passphrase and password authentication, plus the three deliberately unreadable fixtures (
/etc/sudoers,/etc/restricted.txt,/restricted). RSA continues to work viarsa-sha2-512/256.2. Ryuk could not start on Docker Desktop. The testcontainers reaper bind-mounts the Docker socket, which Docker Desktop refuses for its per-user socket path, so every test errored before the container was reached. The fixtures already close their own containers, so the reaper is redundant here and is now disabled by default in
conftest.py.setdefaultkeeps an explicit override working. This affected local runs only; CI uses a standard socket.3. A real defect in the plugin, not in the tests.
test_plugin_wrong_usernamefailed withSSHException: No existing sessioninstead ofAuthenticationException. All tenssh_client.connect()call sites left paramiko'sallow_agentandlook_for_keysat theirTruedefaults, so the plugin offered the host's SSH agent keys and~/.sshprivate keys to the remote server before the key the task was configured with:Running inside Corporate Memory this means a task offers the deployment host's private keys to whatever remote server it points at, and may authenticate with credentials it was never configured with. It also exhausts sshd's
MaxAuthTries, which is why the server disconnects mid-handshake and the error degrades. Fixed at all ten call sites, with a### Fixedchangelog entry.This passes in CI regardless, because CI has no SSH agent — only the container build failure was visible there.
Verification
task checkpasses end to end locally: ruff, mypy (22 source files), deptry, trivy and 36 passed.Follow-up, not addressed here
The same
MaxAuthTriesdynamic means a user whose configured key is rejected by a server with a low limit can still seeNo existing sessionrather than a readable authentication error. Worth translating that disconnect into a proper message if the UI text should be reliable.