Skip to content

feat: add candidate quality gates for solution promotion - #477

Open
lucabello wants to merge 2 commits into
mainfrom
feat/solution-quality-gates
Open

feat: add candidate quality gates for solution promotion#477
lucabello wants to merge 2 commits into
mainfrom
feat/solution-quality-gates

Conversation

@lucabello

@lucabello lucabello commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a scheduled quality gate that deploys the COS and COS Lite solutions from each supported branch, runs their solution tests, and promotes every pinned charm from beta to candidate once all solutions pass on that branch.

Closes canonical/observability#489

Changes

  • quality-gates.just: just module (imported into the main justfile as quality-gates) with recipes to test a solution, promote a solution's charms, and list a product module's charm/track pins
  • tests/solution/{cos,cos-lite}: minimal Terraform wrapper modules and solution test entrypoints
  • .github/workflows/quality-gates-candidate.yaml: branch matrix trigger, runs on a monthly schedule or manual dispatch
  • .github/workflows/_quality-gate-candidate-branch.yaml: reusable workflow that discovers solutions dynamically per branch, tests each one, then promotes once all pass

Notes

Solutions are discovered from tests/solution/*/terraform, so adding a new solution or branch requires no workflow changes.

Add automated testing and promotion workflow for the COS and COS
Lite solutions. On a schedule, each supported branch deploys its
solutions via Terraform, runs solution tests, and promotes every
pinned charm from beta to candidate once all solutions pass.

Solutions are discovered dynamically from the tests/solution
directory so new solutions or branches require no workflow changes.
The quality-gates.just module can also be run locally to test or
promote a solution without needing CI.
@lucabello
lucabello requested a review from a team as a code owner August 24, 2026 14:41

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

A couple smaller comments, but as this will be WIP in the next PRs, they aren't blocking.

Comment thread quality-gates.just
# Init/apply a solution's Terraform module, then run its solution test suite
[group("test")]
[working-directory("./tests/solution")]
test-solution solution="cos-lite":

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.

In the promote tests, we likely want to be passing the risk to the module in order to really test the beta risk here. I think we don't do that yet?

Comment thread quality-gates.just
charm_keys=$(awk '
/data[[:space:]]*"juju_charm"[[:space:]]*"/ { in_block=1; next }
in_block && /^\}/ { in_block=0; charm=""; key=""; next }
in_block && match($0, /charm[[:space:]]*=[[:space:]]*"([^"]*)"/, m) { charm=m[1] }

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.

Worth checking if the matchers will work with github runners. We might be using mawk there, this might not support the three-param match.

Comment thread quality-gates.just
charms_tracks=$(just charm-tracks "{{solution}}" "{{ref}}")
if [ -z "$charms_tracks" ]; then
echo "No pinned charms found for solution '{{solution}}'; nothing to promote."
exit 0

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.

I wonder if this shouldn't exit with a non-zero exit code. What are the odds we'll trigger promotion but won't actually want to promote anything?

Comment thread .github/workflows/_quality-gate-candidate-branch.yaml Outdated
Co-authored-by: Mateusz Kulewicz <mateusz.kulewicz@canonical.com>
Signed-off-by: Luca Bello <36242061+lucabello@users.noreply.github.com>
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