Skip to content

feat: use planner reconciler#735

Merged
cbartz merged 43 commits intomainfrom
feat/planner-reconciler-ISD4104-part2
Feb 26, 2026
Merged

feat: use planner reconciler#735
cbartz merged 43 commits intomainfrom
feat/planner-reconciler-ISD4104-part2

Conversation

@cbartz
Copy link
Collaborator

@cbartz cbartz commented Feb 23, 2026

Applicable spec: ISD-244

Overview

This PR is a follow-up of #734 to use the planner in the charm.

It adds the usage upon relating with the planner, while keeping the legacy mode still available for charms that are not integrated with the planner.

It also adds an application level integration test.

A follow-up PR to remove the legacy code and end-to-test based on the planner is expected.

Rationale

We need to use the planner upon relating.

Juju Events Changes

n/a

Module Changes

Mainly adaptions on charm state and on the cli in the application and application level integration tests

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.
    application version is not bumped, because the application was not used yet

@cbartz cbartz force-pushed the feat/planner-reconciler-ISD4104-part2 branch from 575a78e to ac79755 Compare February 24, 2026 08:58
@cbartz cbartz force-pushed the feat/planner-reconciler-ISD4104-part2 branch from ac79755 to 6afe25d Compare February 24, 2026 13:12
@cbartz cbartz changed the title [WIP] feat: use planner reconciler feat: use planner reconciler Feb 24, 2026
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 follows up on planner integration work by wiring the charm/application to run in “planner mode” when planner relation/config is present, while keeping the legacy reconcile path available.

Changes:

  • Add planner relation-derived config into charm state and propagate it into ApplicationConfiguration.
  • Add planner-mode startup path in github-runner-manager CLI (PressureReconciler create/delete loops) plus a new application-level integration test with a planner stub.
  • Update CI/workflow and test harness pieces to run the new integration test and capture logs.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/charm_state.py Adds PlannerConfig and reads endpoint/token from planner relation into CharmState.
src/factories.py Passes planner URL/token into ApplicationConfiguration.
tests/unit/conftest.py Updates CharmState fixture to include planner_config.
tests/unit/test_charm_state.py Adds unit tests for _build_planner_config_from_charm.
tests/unit/test_factories.py Adds unit test asserting planner fields are propagated into app config.
github-runner-manager/src/github_runner_manager/cli.py Switches between planner mode (PressureReconciler) and legacy mode based on planner config.
github-runner-manager/src/github_runner_manager/manager/pressure_reconciler.py Adds build_pressure_reconciler() helper and adjusts delete-loop interval semantics.
github-runner-manager/src/github_runner_manager/configuration/base.py Updates reconcile_interval doc to “minutes”.
github-runner-manager/tests/integration/planner_stub.py Adds a lightweight Flask-based planner stub server for integration tests.
github-runner-manager/tests/integration/test_planner_runner.py Adds end-to-end-ish integration test that scales runner based on planner pressure.
github-runner-manager/tests/integration/conftest.py Centralizes wait_for_runner helpers and adds a planner_stub fixture.
github-runner-manager/tests/integration/test_debug_ssh.py Reuses shared runner-wait helper and wires planner config into test app setup.
github-runner-manager/tests/integration/factories.py Adds optional planner URL/token into generated app config.
github-runner-manager/tests/integration/application.py Adds optional log file handler for CLI subprocess.
github-runner-manager/tox.ini Adjusts integration test command/posargs behavior.
.github/workflows/test_github_runner_manager.yaml Adds test_planner_runner to integration test matrix.
docs/adr/001_pressure_reconciler_design.md Adds ADR describing the two-loop pressure reconciler approach.
docs/changelog.md Notes planner-driven pressure reconciler addition and fixes indentation.

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.

pre approving this PR thanks chris!

@github-actions
Copy link
Contributor

TICS Quality Gate

✔️ Passed

github-runner-operator

See the results in the TICS Viewer

The following files have been checked for this project
  • github-runner-manager/src/github_runner_manager/cli.py
  • github-runner-manager/src/github_runner_manager/configuration/base.py
  • github-runner-manager/src/github_runner_manager/manager/pressure_reconciler.py
  • github-runner-manager/src/github_runner_manager/openstack_cloud/openstack_runner_manager.py
  • github-runner-manager/tests/integration/application.py
  • github-runner-manager/tests/integration/conftest.py
  • github-runner-manager/tests/integration/factories.py
  • github-runner-manager/tests/integration/planner_stub.py
  • github-runner-manager/tests/integration/test_debug_ssh.py
  • github-runner-manager/tests/integration/test_planner_runner.py
  • src/charm_state.py
  • src/factories.py
  • tests/integration/helpers/common.py
  • tests/unit/conftest.py
  • tests/unit/test_charm_state.py
  • tests/unit/test_factories.py

.github/workflows/tics.yaml / TICS / TICS GitHub Action

@cbartz cbartz merged commit 1104964 into main Feb 26, 2026
128 of 134 checks passed
@cbartz cbartz deleted the feat/planner-reconciler-ISD4104-part2 branch February 26, 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