Skip to content

fix: fail closed in FixVerifier when target identifiers are missing - #81

Merged
OkiriGabriel merged 1 commit into
open-devops-agent:mainfrom
OpeyemiAdeniji:fix/fix-verifier-fail-closed
Oct 15, 2026
Merged

OkiriGabriel merged 1 commit into
open-devops-agent:mainfrom
OpeyemiAdeniji:fix/fix-verifier-fail-closed

Conversation

@OpeyemiAdeniji

Copy link
Copy Markdown
Contributor

Description

FixVerifier reported passed: True without observing the target in three places. They now fail closed with a reason, following the #53 pattern used for CI/CD, cloud and ArgoCD:

  • k8s with no pod_name/namespace
  • server/linux/windows/rhel with no service_name
  • any incident type with no verifier (helm, terraform, others): now "not implemented" instead of a generic pass

Fixes #69

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring
  • New platform/collector support

Platform/Component

  • Core Agent
  • Kubernetes
  • CI/CD
  • Cloud Provider
  • ArgoCD
  • Docker
  • API Server
  • Tools/Executor
  • Documentation
  • Tests

Testing

  • Unit tests added/updated
  • Integration tests pass
  • Manual testing performed
  • Tested with dummy data
  • Tested in production-like environment

New TestFailClosedVerification class in tests/test_fix_verifier.py (12 tests):

  • 10 fail-closed cases (k8s without identifiers, server without service_name, helm/terraform/unknown types, and verify_fix for an unsupported type). Before the fix, all 10 fail; after it, they pass.
  • 2 regression guards confirming k8s and server verification still observe the target when identifiers are present.
  • Every subprocess.run call is mocked, so nothing touches real infrastructure. The helm verify_fix test also stubs _monitor_stability, so a regression fails fast instead of sleeping for 300 seconds.

Full suite after the change: 290 passed, 2 skipped (278 passed, 2 skipped before).

Manual check: ran the repro script from #69, and all four calls now return False (they returned True before). Also ran the incident types through agent.core._verification_expected_state into the verifier: helm and terraform report "not implemented", and k8s and server with missing identifiers report which identifier is required.

Test Configuration

OS: Windows (Git Bash)
Python Version: 3.12.10
Kubernetes Version: N/A
Cloud Provider: N/A

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Screenshots (if applicable)

N/A

Breaking Changes

None to the API. See the behavior change under Additional Notes.

Additional Notes

  • Behavior change: incident types without a verifier (helm, terraform, others) now end with status: "failed" and no 300s stability monitoring, instead of a false success. That could read as "the fix failed" rather than "couldn't verify". I kept passed: False as the issue asks. If you'd prefer a distinct "unverified" status, I can add one.
  • _verification_expected_state in agent/core.py is unchanged; it no longer needs to change once the verifier fails closed.
  • Follow-up (not in this PR): real helm status / terraform observation.

Reviewer Checklist

  • Code quality is acceptable
  • Tests are comprehensive
  • Documentation is updated
  • No security concerns
  • Performance impact is acceptable

@OkiriGabriel
OkiriGabriel merged commit ac942a9 into open-devops-agent:main Oct 15, 2026
10 checks passed
@OpeyemiAdeniji
OpeyemiAdeniji deleted the fix/fix-verifier-fail-closed branch October 16, 2026 17:09
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] K8s, server, Helm, and Terraform verification still pass without observing the target

2 participants