feat(garm): expose runner instance cleanup APIs - #310
Open
yanksyoon wants to merge 2 commits into
Open
Conversation
yanksyoon
requested review from
cbartz,
florentianayuwono,
javierdelapuente,
weiiwang01 and
yhaliaw
as code owners
August 18, 2026 06:11
This was referenced Aug 18, 2026
florentianayuwono
approved these changes
Aug 18, 2026
Contributor
There was a problem hiding this comment.
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 exposingforce_removeandbypass_gh_unauthorizedflags. - 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.
|
|
||
|
|
||
| def test_list_scale_set_instances_converts_id_to_string(): | ||
| """The generated client requires the scaleset ID as a string.""" |
weiiwang01
approved these changes
Aug 19, 2026
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.
Summary
Test plan
pytest -q tests/unit/test_garm_api.pyPart of the stacked implementation for ISD-6082. Follow-up cleanup orchestration PRs will target this branch.
Refs: ISD-6082