Skip to content

Conversation

@jajeffries
Copy link
Contributor

This pull request introduces significant improvements to job tracking and policy status reporting in the policy management system. The main changes include integrating a JobStore into the policy manager and runner, enabling detailed tracking of job executions for each policy, and exposing comprehensive policy/job status information via the server status endpoint. Additionally, the PolicyRunner logic is refactored for cleaner job lifecycle management and metric reporting.

Job tracking and policy status enhancements:

  • Integrated a JobStore instance into PolicyManager and passed it to each PolicyRunner, allowing centralized tracking of jobs associated with policy executions. (worker/worker/policy/manager.py, worker/worker/policy/runner.py) [1] [2] [3] [4] [5] [6]
  • Added a new get_policy_statuses method to PolicyManager that returns a list of policies with their status and associated jobs, including those with jobs but no active runner. (worker/worker/policy/manager.py)

PolicyRunner job lifecycle and metric refactoring:

  • Refactored PolicyRunner.run to use helper methods for job creation, status updates, and metric recording, ensuring job status is updated on both success and failure, and added more granular metrics and logging. (worker/worker/policy/runner.py) [1] [2] [3] [4]

API and test updates:

  • Updated the server status endpoint to include the new detailed policies/job status in its response. (worker/worker/server.py)
  • Adjusted and extended tests to verify the new job tracking and policy status reporting behavior. (worker/tests/policy/test_manager.py, worker/tests/test_server.py) [1] [2]

@jajeffries jajeffries marked this pull request as draft December 22, 2025 10:52
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.

2 participants