Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
14953bf
Add support for integration test with juju secrets
yhaliaw Apr 17, 2026
c8dbc15
Remove incorrect argument for juju.deploy
yhaliaw Apr 17, 2026
97345c0
Merge remote-tracking branch 'origin/main' into feat/juju-secret-config
cbartz Apr 17, 2026
725e81c
fix(test): remove invalid log kwarg from juju.deploy
cbartz Apr 17, 2026
1715b66
docs: document juju secret config options in changelog
cbartz Apr 17, 2026
ef2e801
test(integration): skip test_charm_upgrade until latest/edge has secr…
cbartz Apr 17, 2026
e70587b
fix(charm_state): mention token-secret-id in missing-auth error
cbartz Apr 17, 2026
cdf2060
Apply suggestions from code review
cbartz Apr 17, 2026
028b739
docs(test): explain why plaintext fallback is not used in upgrade tes…
cbartz Apr 17, 2026
77067cb
fix(charm_state): tailor openstack clouds yaml parse error to source
cbartz Apr 17, 2026
8de25ca
refactor(charm): collapse config-changed flush detection into a loop
cbartz Apr 17, 2026
2bd7e7f
refactor(test): thread openstack clouds yaml as helper parameter
cbartz Apr 17, 2026
0b97597
fix(charm_state): silence bandit on openstack secret-id constant
cbartz Apr 17, 2026
dbd8a6a
fix(charm): track plaintext clouds yaml + sharpen secret error paths
cbartz Apr 17, 2026
d959a99
refactor(charm): don't track plaintext openstack-clouds-yaml in _stored
cbartz Apr 17, 2026
262747a
fix(charm_state): don't log decrypted clouds.yaml on parse error
cbartz Apr 17, 2026
5e80b6a
Enable the upgrade charm test
yhaliaw Apr 20, 2026
5075455
Revert "Enable the upgrade charm test"
yhaliaw Apr 20, 2026
a517f96
Remove extra code
yhaliaw Apr 20, 2026
b6ea872
test: skip fork path-change integration test
cbartz Apr 20, 2026
b3ca376
Add back from None for avoid lint
yhaliaw Apr 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor(test): thread openstack clouds yaml as helper parameter
Mirror the token path: let deploy_github_runner_charm own the clouds
secret creation through a dedicated `openstack_clouds_yaml` parameter
instead of sniffing the plaintext value out of the caller's config dict
and then clearing it. Removes the clear/update/clear dance and the
lingering plaintext in the deploy config mapping.
  • Loading branch information
cbartz committed Apr 17, 2026
commit 2bd7e7fd6f0b96f28511133bea473b3fc3e0ab88
3 changes: 1 addition & 2 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
BASE_VIRTUAL_MACHINES_CONFIG_NAME,
DOCKERHUB_MIRROR_CONFIG_NAME,
LABELS_CONFIG_NAME,
OPENSTACK_CLOUDS_YAML_CONFIG_NAME,
OPENSTACK_FLAVOR_CONFIG_NAME,
OPENSTACK_NETWORK_CONFIG_NAME,
PATH_CONFIG_NAME,
Expand Down Expand Up @@ -635,13 +634,13 @@ def app_openstack_runner_fixture(
no_proxy=openstack_config.no_proxy,
),
reconcile_interval=DEFAULT_RECONCILE_INTERVAL,
openstack_clouds_yaml=openstack_config.clouds_yaml_contents,
constraints={
"root-disk": "51200M",
"mem": "2048M",
"virt-type": "virtual-machine",
},
config={
OPENSTACK_CLOUDS_YAML_CONFIG_NAME: openstack_config.clouds_yaml_contents,
OPENSTACK_NETWORK_CONFIG_NAME: openstack_config.network_name,
OPENSTACK_FLAVOR_CONFIG_NAME: openstack_config.flavor_name,
USE_APROXY_CONFIG_NAME: bool(openstack_config.http_proxy),
Expand Down
19 changes: 4 additions & 15 deletions tests/integration/helpers/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@
GITHUB_APP_CLIENT_ID_CONFIG_NAME,
GITHUB_APP_INSTALLATION_ID_CONFIG_NAME,
GITHUB_APP_PRIVATE_KEY_SECRET_ID_CONFIG_NAME,
OPENSTACK_CLOUDS_YAML_CONFIG_NAME,
OPENSTACK_CLOUDS_YAML_SECRET_ID_CONFIG_NAME,
PATH_CONFIG_NAME,
RECONCILE_INTERVAL_CONFIG_NAME,
TEST_MODE_CONFIG_NAME,
TOKEN_CONFIG_NAME,
TOKEN_SECRET_ID_CONFIG_NAME,
)
from manager_service import _get_log_file_path
Expand Down Expand Up @@ -121,6 +119,7 @@ def deploy_github_runner_charm(
github_config: "GitHubConfig",
proxy_config: "ProxyConfig",
reconcile_interval: int,
openstack_clouds_yaml: str | None = None,
constraints: dict | None = None,
config: dict | None = None,
deploy_kwargs: dict | None = None,
Expand All @@ -137,6 +136,7 @@ def deploy_github_runner_charm(
proxy_config: Object providing proxy settings with attributes `http_proxy`,
`https_proxy`, and `no_proxy`.
reconcile_interval: Time between reconcile for the application.
openstack_clouds_yaml: Plaintext OpenStack clouds.yaml to wrap in a Juju secret.
constraints: The custom machine constraints to use. See DEFAULT_RUNNER_CONSTRAINTS
otherwise.
config: Additional custom config to use.
Expand Down Expand Up @@ -186,28 +186,17 @@ def deploy_github_runner_charm(
secret_names.append(token_secret_name)
default_config[TOKEN_SECRET_ID_CONFIG_NAME] = str(token_secret_id)

Comment thread
cbartz marked this conversation as resolved.
clouds_yaml = None
if config:
clouds_yaml = cast(str | None, config.get(OPENSTACK_CLOUDS_YAML_CONFIG_NAME))

if clouds_yaml and not (config and config.get(OPENSTACK_CLOUDS_YAML_SECRET_ID_CONFIG_NAME)):
if openstack_clouds_yaml:
openstack_secret_name = f"{app_name}-openstack-clouds"
openstack_secret_id = juju.add_secret(
name=openstack_secret_name,
content={"clouds-yaml": clouds_yaml},
content={"clouds-yaml": openstack_clouds_yaml},
)
secret_names.append(openstack_secret_name)
default_config[OPENSTACK_CLOUDS_YAML_SECRET_ID_CONFIG_NAME] = str(openstack_secret_id)

default_config[TOKEN_CONFIG_NAME] = ""
default_config[OPENSTACK_CLOUDS_YAML_CONFIG_NAME] = ""

if config:
default_config.update(config)
Comment thread
cbartz marked this conversation as resolved.
if TOKEN_SECRET_ID_CONFIG_NAME in default_config:
default_config[TOKEN_CONFIG_NAME] = ""
if OPENSTACK_CLOUDS_YAML_SECRET_ID_CONFIG_NAME in default_config:
default_config[OPENSTACK_CLOUDS_YAML_CONFIG_NAME] = ""

juju.deploy(
charm_file,
Expand Down
3 changes: 1 addition & 2 deletions tests/integration/test_charm_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

from charm_state import (
BASE_VIRTUAL_MACHINES_CONFIG_NAME,
OPENSTACK_CLOUDS_YAML_CONFIG_NAME,
OPENSTACK_FLAVOR_CONFIG_NAME,
OPENSTACK_NETWORK_CONFIG_NAME,
USE_APROXY_CONFIG_NAME,
Expand Down Expand Up @@ -87,8 +86,8 @@ def test_charm_upgrade(
no_proxy=openstack_config.no_proxy,
),
reconcile_interval=5,
openstack_clouds_yaml=openstack_config.clouds_yaml_contents,
config={
OPENSTACK_CLOUDS_YAML_CONFIG_NAME: openstack_config.clouds_yaml_contents,
OPENSTACK_NETWORK_CONFIG_NAME: openstack_config.network_name,
OPENSTACK_FLAVOR_CONFIG_NAME: openstack_config.flavor_name,
USE_APROXY_CONFIG_NAME: "true",
Expand Down
Loading