Skip to content

feat: planner client and pressure reconciler with unit tests#734

Merged
cbartz merged 22 commits intomainfrom
feat/planner-reconciler-ISD4104-part1
Feb 24, 2026
Merged

feat: planner client and pressure reconciler with unit tests#734
cbartz merged 22 commits intomainfrom
feat/planner-reconciler-ISD4104-part1

Conversation

@cbartz
Copy link
Collaborator

@cbartz cbartz commented Feb 23, 2026

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

  • 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

Library Changes

n/a

Checklist

  • The charm style guide was applied.
  • The contributing guide was applied.
  • The changes are compliant with ISD054 - Managing Charm Complexity
  • The documentation for charmhub is updated.
  • The PR is tagged with appropriate label (urgent, trivial, complex).
  • The changelog is updated with changes that affects the users of the charm.
  • The application version number is updated in github-runner-manager/pyproject.toml.

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
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@cbartz cbartz mentioned this pull request Feb 23, 2026
7 tasks
Copy link
Contributor

@florentianayuwono florentianayuwono left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very neat and easy to read, thanks for the pr chris!

@cbartz cbartz merged commit ca637f1 into main Feb 24, 2026
124 of 133 checks passed
@cbartz cbartz deleted the feat/planner-reconciler-ISD4104-part1 branch February 24, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants