Open shayancanonical opened 2 months ago
@shayancanonical are you able to work around this issue by specifying the base to use?
@hmlanigan yes, i had to explicitly specify the base as a workaround to continue with testing our charms with juju 3.6-beta
Hi, we have started testing juju 3.6 nightly and it affects our CI. JFMI: is the fix planned here anytime soon (as Juju 3.6 LTS is approaching).
Thank you!
I believe this is due to a subtle change in Juju 3.6: https://bugs.launchpad.net/juju/+bug/2084767
That being said, there's also a bug in this library: #1171
The cause is a subtle change in Juju 3.6 response to ResolveCharms:
"url": "ch:amd64/<series>/keystone-690"
"url": "ch:amd64/keystone-690"
I've analysed the traffic dump:
{
"type": "Charms",
"request": "ResolveCharms",
"version": 6,
"params": {
"macaroon": null,
"resolve": [
{
"reference": "ch:keystone",
"charm-origin": {
"source": "charm-hub",
"architecture": "amd64",
"track": "victoria",
"risk": "stable",
"base": {
"channel": null,
"name": null
},
"revision": null
}
}
]
},
"request-id": 9
}
{
"request-id": 9,
"response": {
"Results": [
{
"url": "ch:amd64/keystone-690",
"charm-origin": {
"source": "charm-hub",
"type": "charm",
"id": "",
"risk": "stable",
"revision": 690,
"track": "victoria",
"architecture": "amd64",
"base": {
"name": "ubuntu",
"channel": "20.04/stable"
}
},
"supported-series": [
"focal"
]
}
]
}
}
supported-series
are defined in Charms v6 ResolveCharms:
Charms: 6
.ResolveCharms()
in: ResolveCharmsWithChannel
.macaroon: Macaroon
.macaroon: dict[Any, Any]
.resolve[0]: ResolveCharmWithChannel
.resolve[0].charm-origin: CharmOrigin
.resolve[0].charm-origin.architecture: str
.resolve[0].charm-origin.base: Base
.resolve[0].charm-origin.base.channel: str
.resolve[0].charm-origin.base.name: str
.resolve[0].charm-origin.branch: str
.resolve[0].charm-origin.hash: str
.resolve[0].charm-origin.id: str
.resolve[0].charm-origin.instance-key: str
.resolve[0].charm-origin.revision: int
.resolve[0].charm-origin.risk: str
.resolve[0].charm-origin.source: str
.resolve[0].charm-origin.track: str
.resolve[0].charm-origin.type: str
.resolve[0].reference: str
.resolve[0].switch-charm: bool
out: ResolveCharmWithChannelResults
.Results[0]: ResolveCharmWithChannelResult
.Results[0].charm-origin: CharmOrigin
.Results[0].charm-origin.architecture: str
.Results[0].charm-origin.base: Base
.Results[0].charm-origin.base.channel: str
.Results[0].charm-origin.base.name: str
.Results[0].charm-origin.branch: str
.Results[0].charm-origin.hash: str
.Results[0].charm-origin.id: str
.Results[0].charm-origin.instance-key: str
.Results[0].charm-origin.revision: int
.Results[0].charm-origin.risk: str
.Results[0].charm-origin.source: str
.Results[0].charm-origin.track: str
.Results[0].charm-origin.type: str
.Results[0].error: Error
.Results[0].error.code: str
.Results[0].error.info["abc"]: dict[Any, Any]
.Results[0].error.message: str
.Results[0].supported-series[0]: str
.Results[0].url: str
However, since the v7 schema is included in this project, the response definition in juju/client/_definitions.py doesn't have this field, as the v7 schema is as follows:
Charms: 7
.ResolveCharms()
in: ResolveCharmsWithChannel
.macaroon: Macaroon
.macaroon: dict[Any, Any]
.resolve[0]: ResolveCharmWithChannel
.resolve[0].charm-origin: CharmOrigin
.resolve[0].charm-origin.architecture: str
.resolve[0].charm-origin.base: Base
.resolve[0].charm-origin.base.channel: str
.resolve[0].charm-origin.base.name: str
.resolve[0].charm-origin.branch: str
.resolve[0].charm-origin.hash: str
.resolve[0].charm-origin.id: str
.resolve[0].charm-origin.instance-key: str
.resolve[0].charm-origin.revision: int
.resolve[0].charm-origin.risk: str
.resolve[0].charm-origin.source: str
.resolve[0].charm-origin.track: str
.resolve[0].charm-origin.type: str
.resolve[0].reference: str
.resolve[0].switch-charm: bool
out: ResolveCharmWithChannelResults
.Results[0]: ResolveCharmWithChannelResult
.Results[0].charm-origin: CharmOrigin
.Results[0].charm-origin.architecture: str
.Results[0].charm-origin.base: Base
.Results[0].charm-origin.base.channel: str
.Results[0].charm-origin.base.name: str
.Results[0].charm-origin.branch: str
.Results[0].charm-origin.hash: str
.Results[0].charm-origin.id: str
.Results[0].charm-origin.instance-key: str
.Results[0].charm-origin.revision: int
.Results[0].charm-origin.risk: str
.Results[0].charm-origin.source: str
.Results[0].charm-origin.track: str
.Results[0].charm-origin.type: str
.Results[0].error: Error
.Results[0].error.code: str
.Results[0].error.info["abc"]: dict[Any, Any]
.Results[0].error.message: str
.Results[0].supported-bases[0]: Base
.Results[0].supported-bases[0].channel: str
.Results[0].supported-bases[0].name: str
.Results[0].url: str
There's already a hack to account for this, though:
I suppose this work-around was never tested, because of the explicit series being returned by Juju up until 3.6
I think the correct resolution is to use the Charms facade version 7 for Juju that supports that (3.3+) and the old code path for older Juju versions we still support.
Description
We are using
ops_test.model.deploy
in our integration tests. While testing with juju 3.4.4 (along with python-libjuju^3.2.2
) we are able to run the following code:However, while testing with juju 3.6-beta2 (along with python-libjuju
3.5.2.0
), running the above code pulls in baseubuntu@20.04/stable
sometimes and baseubuntu@22.04/stable
other times. The charm mysql-test-app is available for both focal and jammy.Example of the same code but different bases pulled:
Because (likely) juju 3.6 no longer supports certain bases (like
ubuntu@20.04/stable
), the default base python-libjuju uses inops_test.model.deploy()
fails with an error trace (shown in the reproduce section)Urgency
Annoying bug in our test suite
Python-libjuju version
3.5.2.0
Juju version
3.6-beta2-ubuntu-amd64
Reproduce / Test
Using:
We get the following trace:
Using juju 3.6-beta2 directly: