Skip to content

Conversation

@jajeffries
Copy link
Contributor

This pull request refactors the job tracking system in the SNMP discovery policy codebase, replacing the concept of "jobs" with "runs" throughout the implementation and tests. The change standardizes terminology and updates all relevant data structures, methods, and test cases to use Run/RunStore instead of Job/JobStore. This improves clarity and consistency in how policy executions are tracked.

Core Refactor: Jobs → Runs

  • Removed JobStore and related types and methods from policy/job.go, replacing them with RunStore and associated Run types.
  • Updated Manager, Runner, and related constructors to use RunStore instead of JobStore, and changed all references from jobs to runs [1] [2] [3] [4].
  • Refactored logic in Runner.run to create, update, and track runs instead of jobs, including status updates and ingestion metadata [1] [2].

Status and API Changes

  • Changed the Status struct and related methods in Manager to report runs instead of jobs, including renaming fields and updating status derivation logic.

Test Suite Updates

  • Updated all unit tests in policy/job_test.go to remove job-related tests and presumably migrate them to new run-related tests.
  • Refactored runner_test.go to use RunStore and validate run creation, status, and entity counts, ensuring all test logic aligns with the new terminology and data structures [1] [2] [3] [4] [5] [6] [7] [8] [9].

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