canonical / canonical/charm-integration-testing

bundle_builder_x: --all-channels override validation picks stale/oldest base revision for multi-base channels

Open
#962 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
6
Forks
1
Avg merge
1d 22h
Merged PRs (30d)
96

Description

While validating the `canonical-livepatch-server-k8s.yaml` override fix in #961 with
`--all-channels`, `test_charm_override_file_is_valid[canonical-livepatch-server-k8s[beta]]`
and `[edge]` failed with:

```
UnparsableCharmException: Charm 'canonical-livepatch-server-k8s' override declares
config keys not present in charm config at channel beta: ['ingress-interface']
```

## Root cause

Charmhub's `latest/beta` channel for this charm maps to three different
revisions, one per supported base:

```
beta ubuntu@20.04 rev 49
beta ubuntu@22.04 rev 89 <- current/actual latest
beta ubuntu@24.04 rev 50
```

rev 49 is a much older revision that predates the `ingress-interface` config
option entirely (confirmed via
`canonical/livepatch-k8s-operator` tag `rev49` vs `rev89` `config.yaml`).
`bundle_builder_x.charmhub.CharmhubClient` resolves the channel to base 20.04
(`_get_ubuntu_version_from_bases`: "Return first ubuntu version with matching
base") instead of the base actually intended/used by the rest of this
project's deployments, so validation checks config/endpoint keys against a
stale revision.

## Impact

Any override that adds a `configs:` entry and validates with `--all-channels`
against a charm whose channel spans multiple bases with divergent
revisions/config schemas can produce false failures unrelated to the override
itself.

Note: the default (non-`--all-channels`) validation used by
`scripts/bundle-builder-x-tests.sh overrides` is unaffected, since it only
checks one (the first-matched) channel per override criterion.

## Suggested fix

When resolving a channel with `--all-channels` (or generally, wherever a
requested base is not explicit), prefer the newest/highest base rather than
the first one encountered, or make base selection configurable/consistent with
how the actual test-plan runs select platform/base.

SQT-1178

Contributor guide

Open the contributing guide

Research direction

Start in bundle_builder_x/charmhub.py at CharmhubClient and _get_ubuntu_version_from_bases, then reproduce the beta and edge failures with test_charm_override_file_is_valid and --all-channels. Trace how the selected base and revision are chosen; done means multi-base channels validate against the intended newest or configurable base without breaking existing override tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.