Skip to content

feat(garm-configurator): integrate with image builder via github_runner_image_v0#222

Open
cbartz wants to merge 2 commits into
mainfrom
feat/image-builder-integration-ISD-5735
Open

feat(garm-configurator): integrate with image builder via github_runner_image_v0#222
cbartz wants to merge 2 commits into
mainfrom
feat/image-builder-integration-ISD-5735

Conversation

@cbartz
Copy link
Copy Markdown
Collaborator

@cbartz cbartz commented Jun 3, 2026

What this PR does

Wires the garm-configurator charm to the github-runner-image-builder-operator via the github_runner_image_v0 relation. The configurator forwards its OpenStack credentials to the image builder and waits for the resulting image UUID before reporting Active.

Why we need it

ISD-5735: the image UUID needs to flow automatically into the scaleset configuration sent to GARM, rather than being set manually.

Test plan

Unit tests cover the credential forwarding and status transitions. Integration tests deploy a fake image builder via any-charm and verify the full credential + UUID handshake end-to-end against a real Juju/microk8s environment.

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
  • Technical author has been assigned to review the PR in case of documentation changes
  • 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: N/A — existing test_garm_configurator.py already covered
  • If this PR involves a Grafana dashboard: N/A
  • If this PR involves Terraform: N/A
  • If this PR involves Rockcraft: N/A

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

Integrates the garm-configurator charm with an image builder operator via the github_runner_image_v0 relation, forwarding OpenStack credentials over the relation and consuming the resulting image UUID for status/state.

Changes:

  • Added a new requires: image relation endpoint using the github_runner_image_v0 interface.
  • Implemented holistic reconciliation to forward six OpenStack credential fields to connected image-builder relations and to set unit status based on whether an image UUID is available.
  • Added unit + integration coverage for relation data propagation and UUID consumption using any-charm as a fake provider.

Reviewed changes

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

Show a summary per file
File Description
charms/garm-configurator/charmcraft.yaml Declares the new image requires endpoint/interface.
charms/garm-configurator/src/charm.py Adds unified _reconcile across config and relation events; forwards credentials; sets Waiting/Active based on UUID presence.
charms/garm-configurator/src/charm_state.py Extends CharmState with image_id sourced from relation unit data.
charms/garm-configurator/tests/unit/test_charm.py Adds Scenario-based unit tests for credential forwarding and status behavior when UUID is absent/present.
charms/tests/integration/conftest.py + charms/tests/integration/test_garm_configurator.py Adds an any-charm fake image builder and an end-to-end integration test validating relation data flow.

Comment thread charms/garm-configurator/src/charm.py Outdated
Comment thread charms/tests/integration/test_garm_configurator.py
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

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

Comment thread charms/garm-configurator/src/charm.py Outdated
Comment thread charms/tests/integration/test_garm_configurator.py Outdated
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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread charms/garm-configurator/src/charm.py Outdated
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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread charms/tests/integration/test_garm_configurator.py
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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread charms/garm-configurator/src/charm.py Outdated
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

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@cbartz cbartz force-pushed the feat/image-builder-integration-ISD-5735 branch 6 times, most recently from e18c863 to 8c2ad23 Compare June 3, 2026 08:26
@cbartz cbartz requested a review from Copilot June 3, 2026 08:27
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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread charms/garm-configurator/src/charm.py Outdated
@cbartz cbartz force-pushed the feat/image-builder-integration-ISD-5735 branch from 8c2ad23 to 15869cc Compare June 3, 2026 08:31
@cbartz cbartz requested a review from Copilot June 3, 2026 08:31
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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread charms/garm-configurator/src/charm_state.py
@cbartz cbartz force-pushed the feat/image-builder-integration-ISD-5735 branch from 911e84e to c72c372 Compare June 3, 2026 08:41
@cbartz cbartz requested a review from Copilot June 3, 2026 08:41
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

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

Comment thread charms/garm-configurator/src/charm.py
Comment thread charms/garm-configurator/tests/unit/test_charm.py
Comment thread charms/garm-configurator/src/charm.py
@cbartz cbartz force-pushed the feat/image-builder-integration-ISD-5735 branch from c72c372 to 0321d70 Compare June 3, 2026 08:49
@cbartz cbartz requested a review from Copilot June 3, 2026 08:49
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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread charms/garm-configurator/charmcraft.yaml
@cbartz cbartz force-pushed the feat/image-builder-integration-ISD-5735 branch from 0321d70 to 0244ea2 Compare June 3, 2026 08:55
@cbartz cbartz requested a review from Copilot June 3, 2026 08:55
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

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

Comment thread charms/garm-configurator/src/charm.py
Comment thread charms/tests/integration/test_garm_configurator.py
Comment thread charms/tests/integration/test_garm_configurator.py Outdated
@cbartz cbartz force-pushed the feat/image-builder-integration-ISD-5735 branch from 0244ea2 to d8f0057 Compare June 3, 2026 09:02
@cbartz cbartz requested a review from Copilot June 3, 2026 09:02
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

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@cbartz cbartz force-pushed the feat/image-builder-integration-ISD-5735 branch from d8f0057 to 4277973 Compare June 3, 2026 09:15
…er_image_v0

Adds the image relation (github_runner_image_v0 interface) to the
garm-configurator charm so it can supply OpenStack credentials to the
image builder and receive the resulting image UUID.

- charmcraft.yaml: add requires.image endpoint
- charm.py: single _reconcile handles config_changed and all image
  relation events; forwards six OpenStack credential fields to every
  active image relation; reports WaitingStatus until a UUID arrives,
  ActiveStatus otherwise; explicitly excludes the breaking relation from
  writes and status checks during relation_broken
- charm_state.py: add IMAGE_RELATION_NAME constant and image_id field
  on CharmState, populated from the provider's unit relation data
- unit tests (23): credential forwarding, invalid-config guard,
  Waiting/Active status transitions, relation_broken exclusion
- integration tests: any-charm fake image builder writes a synthetic
  UUID on relation_joined; test polls show-unit from both sides to
  verify all six credential fields (including password) and the UUID
@cbartz cbartz force-pushed the feat/image-builder-integration-ISD-5735 branch from 4277973 to e8f4b8c Compare June 3, 2026 09:27
self.on[IMAGE_RELATION_NAME].relation_changed,
self.on[IMAGE_RELATION_NAME].relation_broken,
]:
self.framework.observe(event, self._reconcile)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

holistic pattern

@cbartz cbartz marked this pull request as ready for review June 3, 2026 11:03
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.

2 participants