Skip to content

feat(garm): expose runner instance cleanup APIs - #310

Open
yanksyoon wants to merge 2 commits into
mainfrom
feat/isd-6082-api
Open

feat(garm): expose runner instance cleanup APIs#310
yanksyoon wants to merge 2 commits into
mainfrom
feat/isd-6082-api

Conversation

@yanksyoon

Copy link
Copy Markdown
Member

Summary

  • Add charm-side wrappers for listing runners in a scaleset.
  • Add runner deletion wrapper with GARM force and GitHub authorization-bypass flags.
  • Convert scaleset IDs to the generated client's required string type.

Test plan

  • pytest -q tests/unit/test_garm_api.py

Part of the stacked implementation for ISD-6082. Follow-up cleanup orchestration PRs will target this branch.

Refs: ISD-6082

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 extends the charms/garm charm-side Python wrapper around the generated GARM OpenAPI client to expose runner instance cleanup primitives (list instances for a scaleset + delete an instance with GARM cleanup flags), with accompanying unit tests. This supports the broader cleanup orchestration work for ISD-6082.

Changes:

  • Add GarmAuthenticatedClient.list_scale_set_instances() wrapper that converts integer scaleset IDs to the generated client’s required string type.
  • Add GarmAuthenticatedClient.delete_instance() wrapper exposing force_remove and bypass_gh_unauthorized flags.
  • Add unit tests covering ID conversion and delete flag passthrough.

Reviewed changes

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

File Description
charms/garm/src/garm_api.py Adds authenticated wrapper methods around InstancesApi for listing scaleset instances and deleting an instance with cleanup flags.
charms/garm/tests/unit/test_garm_api.py Adds unit tests validating scaleset ID string conversion and delete flag passthrough behavior.
Suppressed comments (1)

charms/garm/tests/unit/test_garm_api.py:273

  • This new test’s docstring doesn’t follow the arrange/act/assert convention used throughout this module, which makes it harder to quickly scan what behavior is being verified.
    """Runner deletion exposes GARM's force and authorization-bypass flags."""

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread charms/garm/tests/unit/test_garm_api.py Outdated


def test_list_scale_set_instances_converts_id_to_string():
"""The generated client requires the scaleset ID as a string."""
Comment thread charms/garm/src/garm_api.py
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.

4 participants