Skip to content

patch: move Glide to the requirer charm#39

Merged
skourta merged 329 commits into9/edgefrom
client-charm-cw
Apr 22, 2026
Merged

patch: move Glide to the requirer charm#39
skourta merged 329 commits into9/edgefrom
client-charm-cw

Conversation

@skourta
Copy link
Copy Markdown
Contributor

@skourta skourta commented Apr 13, 2026

This pull request introduces significant enhancements to the integration test client charm for Valkey, focusing on improved testing capabilities, especially around continuous writes and flexible client configuration. It also includes some internal refactoring and minor fixes. The most important changes are grouped below.

Integration test charm enhancements:

  • Added a new continuous_writes.py daemon script to support robust, background continuous-write testing, including state tracking, atomic state updates, config hot-reload, and graceful shutdown. This enables advanced data consistency and disruption testing for Valkey deployments.
  • Extended the charmcraft.yaml for the integration test requirer charm with several new actions: execute, start-continuous-writes, get-continuous-writes-state, assert-continuous-writes-increasing, clear-continuous-writes, stop-continuous-writes, and seed-data. These actions facilitate advanced integration and consistency testing scenarios.
  • Added support for a new glide-config config option, allowing the charm to connect directly to Valkey using arbitrary endpoints and credentials, independent of relations.

Valkey client improvements:

  • Refactored the ValkeyClient class to support multiple endpoints, optional password, and improved TLS configuration. Added new methods for seeding data (seed_data) and executing arbitrary commands (execute_command), with robust result handling for different Valkey response types. [1] [2]

Charm core/status logic fixes:

  • Changed how statuses are set and retrieved in the core charm code, removing use of the StartStatuses enum for running status and updating status management to use the new unit_server.update method and improved status list retrieval. [1] [2] [3]
  • Fixed the order of TLS status checks in the TLS manager to ensure correct status reporting.

Miscellaneous:

  • Minor formatting and consistency fixes in charmcraft.yaml and import statements. [1] [2] [3] [4]

These changes collectively provide much more powerful tools for integration and disruption testing of Valkey, as well as cleaner and more robust status management in the charm.

Base automatically changed from dpe-9326-failover-tests to 9/edge April 17, 2026 09:45
Copilot AI review requested due to automatic review settings April 17, 2026 10:10
Copy link
Copy Markdown

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

This PR moves Valkey/Glide-based integration test interactions into a dedicated “glide-runner” (requirer) charm, adding action-driven continuous-writes and command execution capabilities, and updates the main charm’s status/TLS handling accordingly.

Changes:

  • Introduces a new requirer charm workflow for executing Valkey commands and running continuous-writes via Juju actions (including config-driven connectivity via glide-config).
  • Refactors integration test helpers/tests to use runner-based endpoints and action calls (including K8s endpoint support).
  • Adjusts charm status/TLS logic (e.g., start-state/status tracking changes, TLS status ordering).

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/integration/tls/test_tls.py Updates TLS integration tests to deploy/use glide-runner and endpoint-based helpers.
tests/integration/tls/test_private_key.py Refactors private-key TLS tests to use glide-runner and updated helper APIs.
tests/integration/tls/test_certificate_rotation.py Refactors certificate rotation tests to use glide-runner and updated helper APIs.
tests/integration/tls/test_certificate_options.py Refactors certificate options tests to deploy glide-runner and use endpoint-based helpers.
tests/integration/test_charm.py Refactors core integration tests to deploy glide-runner and use new helper signatures.
tests/integration/helpers.py Adds K8s endpoints helper, replaces direct Glide usage with runner execute action, and refactors auth/ping/replica helpers.
tests/integration/ha/test_scaling.py Migrates HA scaling tests to action-driven continuous-writes and runner-based seed-data.
tests/integration/ha/test_network_cut.py Migrates network-cut HA tests to action-driven continuous-writes and runner-based checks.
tests/integration/ha/test_failover.py Migrates failover HA tests to action-driven continuous-writes and runner-based checks.
tests/integration/glide_helpers.py Adds JSON (de)serialization for GlideClientConfiguration for passing via action params.
tests/integration/cw_helpers.py Replaces subprocess-based continuous writes with runner charm action helpers and config wiring.
tests/integration/continuous_writes.py Removes the old local continuous-writes implementation (replaced by runner charm daemon).
tests/integration/conftest.py Adds fixtures for deploying the glide-runner charm and removes old ContinuousWrites fixtures.
tests/integration/clients/requirer-charm/src/glide_helpers.py Adds runner-side config deserialization and command result normalization.
tests/integration/clients/requirer-charm/src/cw_helpers.py Adds runner-side daemon support helpers (PID wait, LLEN helper).
tests/integration/clients/requirer-charm/src/continuous_writes.py Adds runner-side continuous-writes daemon with state tracking and hot reload.
tests/integration/clients/requirer-charm/src/client.py Refactors ValkeyClient to support multi-endpoint configs and adds seed/execute APIs.
tests/integration/clients/requirer-charm/src/charm.py Adds new actions (execute/seed/continuous-writes) and glide-config support to the runner charm.
tests/integration/clients/requirer-charm/charmcraft.yaml Registers new actions and adds glide-config charm config option.
src/statuses.py Removes unused running attribute from a StartStatuses entry.
src/managers/tls.py Fixes TLS status check ordering for correct status reporting.
src/managers/cluster.py Adjusts status retrieval to use status state store for running-status-only behavior.
src/events/base_events.py Updates start handling to use unit_server.update instead of setting StartStatuses running status.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/integration/clients/requirer-charm/src/charm.py Outdated
Comment thread tests/integration/clients/requirer-charm/src/charm.py
Comment thread tests/integration/clients/requirer-charm/src/charm.py
Comment thread tests/integration/ha/test_failover.py
Comment thread tests/integration/ha/test_scaling.py
Comment thread tests/integration/helpers.py
Comment thread tests/integration/helpers.py
Comment thread tests/integration/clients/requirer-charm/charmcraft.yaml Outdated
Copy link
Copy Markdown
Contributor

@reneradoi reneradoi left a comment

Choose a reason for hiding this comment

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

The TLS configuration for the client in the requirer charm is fine now, thank you for fixing it.

Comment thread tests/integration/clients/requirer-charm/src/charm.py Outdated
Comment thread tests/integration/clients/requirer-charm/src/client.py
Comment thread tests/integration/clients/requirer-charm/src/charm.py
Comment thread tests/integration/clients/requirer-charm/src/charm.py
Mehdi-Bendriss
Mehdi-Bendriss previously approved these changes Apr 21, 2026
Copy link
Copy Markdown
Contributor

@Mehdi-Bendriss Mehdi-Bendriss left a comment

Choose a reason for hiding this comment

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

Thanks Smail!

Copy link
Copy Markdown
Contributor

@reneradoi reneradoi left a comment

Choose a reason for hiding this comment

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

Great work!

@skourta skourta merged commit efa1952 into 9/edge Apr 22, 2026
65 of 66 checks passed
@skourta skourta deleted the client-charm-cw branch April 22, 2026 10:24
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.

4 participants