feat: planner client and pressure reconciler with unit tests#734
Merged
feat: planner client and pressure reconciler with unit tests#734
Conversation
Add the library-side components for planner-driven runner management: - PlannerClient for communicating with the planner service - PressureReconciler for scaling runners based on pressure signals - Configuration fields for planner URL and token - Unit tests for both components
cbartz
commented
Feb 23, 2026
github-runner-manager/src/github_runner_manager/manager/pressure_reconciler.py
Show resolved
Hide resolved
github-runner-manager/src/github_runner_manager/manager/runner_manager.py
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds infrastructure for planner-based runner scaling to the github-runner-manager application. The implementation introduces a PlannerClient for communicating with an external planner service, and a PressureReconciler that uses pressure signals from the planner to scale runners up or down. The changes are designed to be integrated into the charm in follow-up PRs.
Changes:
- Added PlannerClient for HTTP communication with the planner service, including flavor retrieval and pressure streaming
- Added PressureReconciler that runs create/delete loops to maintain desired runner count based on planner pressure
- Extended ApplicationConfiguration with optional planner_url and planner_token fields
- Added comprehensive unit tests for both new components
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| github-runner-manager/src/github_runner_manager/planner_client.py | New HTTP client for planner service with flavor and pressure streaming support |
| github-runner-manager/src/github_runner_manager/manager/pressure_reconciler.py | New reconciler implementing planner-driven scaling with separate create/delete loops |
| github-runner-manager/src/github_runner_manager/configuration/base.py | Added optional planner_url and planner_token configuration fields |
| github-runner-manager/src/github_runner_manager/manager/runner_manager.py | Enhanced delete_runners docstring to clarify deletion behavior |
| github-runner-manager/tests/unit/test_planner_client.py | Unit tests for PlannerClient with mocked HTTP responses |
| github-runner-manager/tests/unit/test_pressure_reconciler.py | Unit tests for PressureReconciler covering error handling and reconciliation logic |
| github-runner-manager/tests/unit/test_config.py | Added tests for optional planner configuration fields |
| github-runner-manager/tests/unit/test_runner_scaler.py | Updated fixture to include planner configuration |
| github-runner-manager/pyproject.toml | Bumped version from 0.12.0 to 0.13.0 |
github-runner-manager/src/github_runner_manager/manager/pressure_reconciler.py
Outdated
Show resolved
Hide resolved
github-runner-manager/src/github_runner_manager/manager/pressure_reconciler.py
Show resolved
Hide resolved
github-runner-manager/src/github_runner_manager/planner_client.py
Outdated
Show resolved
Hide resolved
github-runner-manager/src/github_runner_manager/manager/pressure_reconciler.py
Outdated
Show resolved
Hide resolved
github-runner-manager/src/github_runner_manager/manager/pressure_reconciler.py
Outdated
Show resolved
Hide resolved
github-runner-manager/src/github_runner_manager/manager/pressure_reconciler.py
Outdated
Show resolved
Hide resolved
javierdelapuente
approved these changes
Feb 23, 2026
github-runner-manager/src/github_runner_manager/manager/pressure_reconciler.py
Outdated
Show resolved
Hide resolved
github-runner-manager/src/github_runner_manager/manager/pressure_reconciler.py
Outdated
Show resolved
Hide resolved
github-runner-manager/src/github_runner_manager/manager/pressure_reconciler.py
Outdated
Show resolved
Hide resolved
github-runner-manager/src/github_runner_manager/manager/pressure_reconciler.py
Outdated
Show resolved
Hide resolved
github-runner-manager/src/github_runner_manager/manager/pressure_reconciler.py
Outdated
Show resolved
Hide resolved
github-runner-manager/src/github_runner_manager/planner_client.py
Outdated
Show resolved
Hide resolved
florentianayuwono
approved these changes
Feb 24, 2026
Contributor
florentianayuwono
left a comment
There was a problem hiding this comment.
very neat and easy to read, thanks for the pr chris!
github-runner-manager/src/github_runner_manager/manager/pressure_reconciler.py
Show resolved
Hide resolved
github-runner-manager/src/github_runner_manager/manager/pressure_reconciler.py
Outdated
Show resolved
Hide resolved
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.
Applicable spec: ISD-244
Overview
PR to add pressure_reconciler on the github-runner manager application side.
To allow easier review, the functionality to use the planner is split into multiple PRs. Follow-up PR's to add using it in the charm and integration tests are expected.
The PR is based on the work in #705
Rationale
In order to use the planner, we need to add support to the github-runner-manager application.
Juju Events Changes
n/a
Module Changes
Library Changes
n/a
Checklist
urgent,trivial,complex).github-runner-manager/pyproject.toml.