Skip to content

fix: verify server fixes on the target host instead of the agent host - #237

Open
jay23606 wants to merge 1 commit into
open-devops-agent:mainfrom
jay23606:pr-go/193-bug-fixverifier-checks-services-on-the-a
Open

jay23606 wants to merge 1 commit into
open-devops-agent:mainfrom
jay23606:pr-go/193-bug-fixverifier-checks-services-on-the-a

Conversation

@jay23606

Copy link
Copy Markdown

Bug

FixVerifier._verify_server_fix checked a service on the machine running the agent (platform.system() plus a local subprocess.run of systemctl is-active or sc query), not on the server that was fixed. A service of the same name on the agent host could report "running", and a missing service on the agent host could report failure, so resolved could be wrong (#193).

Change

  • agent/core.py: _verification_expected_state passes the incident's host as target_host for server, linux, windows and rhel incidents.
  • tools/fix_verifier.py: the service check goes through ServerCollector (detect_os and _run, as in collectors/server.py). A remote target uses SSH argv. A Windows target uses the PowerShell Get-Service check, and other targets use systemctl is-active. Local checks with no target still run in the local shell. The result records target_host and os_family.
  • tests/test_fix_verifier.py: the existing local test now patches ServerCollector. New tests cover a remote SSH check, a remote Windows check through PowerShell, and a local check.

Testing

  • PYTHONPATH=.pr-go/shim python -m pytest tests/test_fix_verifier.py -q -p no:cacheprovider -W ignore::DeprecationWarning passed (38 tests).
  • Run against a copy of the base commit with the new test file, TestServerVerificationTarget fails 3 of 3. The remote SSH test fails, which shows the base code runs the local check.
  • Not run in CI: python3 -m pytest tests/test_fix_verifier.py::TestServerVerificationTarget::test_remote_server_service_is_checked_over_ssh -q failed on the base commit with /usr/bin/python3: No module named pytest.

Regression test: untested here: CI verifies this change

Fixes #193

@jay23606
jay23606 marked this pull request as ready for review November 27, 2026 22:14

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] FixVerifier checks services on the agent host instead of the target server

1 participant