Skip to content

Add scaleset configurations#221

Open
yhaliaw wants to merge 5 commits into
mainfrom
feat/garm-configurator-scaleset-config
Open

Add scaleset configurations#221
yhaliaw wants to merge 5 commits into
mainfrom
feat/garm-configurator-scaleset-config

Conversation

@yhaliaw
Copy link
Copy Markdown
Collaborator

@yhaliaw yhaliaw commented Jun 3, 2026

What this PR does

Add the scaleset configurations for GARM configurator charm.

AI summary

This pull request adds comprehensive support for configuring GitHub runner scalesets in the garm-configurator charm. It introduces new configuration options for scaleset management, validates these options, and extends both the charm's logic and its tests to ensure robust handling of various configuration scenarios.

Key changes:

Configuration and validation for scalesets:

  • Added new config options (name, flavor, os-arch, min-idle-runner, max-runner, labels, repo, org, runner-group, pre-install-scripts) to charmcraft.yaml for flexible scaleset configuration.
  • Introduced constants for these new config keys in charm_state.py for maintainability.
  • Implemented the ScalesetConfig class with validation logic, ensuring required fields are present, numeric fields are non-negative, and that repo and org are mutually exclusive but at least one is set.

Charm state and integration:

  • Updated the CharmState class and its from_charm method to include and initialize the new ScalesetConfig. [1] [2]

Testing enhancements:

  • Expanded unit and integration tests to cover new configuration options and validation logic, including cases for missing, empty, or invalid values, and correct handling of mutually exclusive options. [1] [2] [3] [4]

Why we need it

Needed to support the scaleset features of GARM charm.

Checklist

  • Changes comply with the project's coding standards and guidelines (see CONTRIBUTING.md and STYLE.md)
  • CONTRIBUTING.md has been updated upon changes to the contribution/development process (e.g. changes to the way tests are run)
  • Technical author has been assigned to review the PR in case of documentation changes (usually *.md files)
  • I updated docs/changelog.md with user-relevant changes
  • I used AI to assist with preparing this PR
  • I added or updated tests as needed (unit and integration)
  • If integration test modules are used: I updated the workflow configuration
    (e.g., in .github/workflows/integration_tests.yaml, ensure the modules list is correct)
  • If this PR involves a Grafana dashboard: I added a screenshot of the dashboard
  • If this PR involves Terraform: terraform fmt passes and tflint reports no errors
  • If this PR involves Rockcraft: I updated the version

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

Adds scaleset configuration support to the garm-configurator charm by introducing new charm config options, parsing/validating them into charm state, and extending unit/integration coverage to exercise the new validation paths.

Changes:

  • Added scaleset-related config options to charmcraft.yaml and corresponding config key constants/state parsing in charm_state.py.
  • Implemented ScalesetConfig validation (required fields, non-negative numeric fields, repo/org mutual exclusivity).
  • Updated unit and integration tests plus changelog to reflect the new required configuration.

Reviewed changes

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

Show a summary per file
File Description
docs/changelog.md Adds a dated changelog entry for scaleset configuration support.
charms/tests/integration/test_garm_configurator.py Updates deployment config in integration tests to include required scaleset settings.
charms/garm-configurator/tests/unit/test_charm.py Adds unit tests covering new scaleset validation cases (missing/empty fields, negative values, repo/org constraints).
charms/garm-configurator/src/charm_state.py Introduces ScalesetConfig and wires it into CharmState.from_charm() validation/parsing.
charms/garm-configurator/charmcraft.yaml Adds new user-facing config options for scaleset configuration.

Comment thread charms/garm-configurator/src/charm_state.py Outdated
Comment thread charms/garm-configurator/charmcraft.yaml
Comment thread charms/garm-configurator/charmcraft.yaml Outdated
yhaliaw and others added 3 commits June 3, 2026 10:34
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@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.

lgtm thanks andrew! im not sure if this is needed now, but there r terraform module tests as well that we can add on :)

f"{SCALESET_MIN_IDLE_RUNNER_CONFIG_NAME} must be non-negative"
)

max_runner = int(charm.config.get(SCALESET_MAX_RUNNER_CONFIG_NAME, 0))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can we add a check that max >= min?

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.

3 participants