Skip to content

build(deps): use released valkey-glide instead of the git fork - #98

Merged
delgod merged 1 commit into
9/edgefrom
valkey-glide
Aug 21, 2026
Merged

build(deps): use released valkey-glide instead of the git fork#98
delgod merged 1 commit into
9/edgefrom
valkey-glide

Conversation

@delgod

@delgod delgod commented Aug 20, 2026

Copy link
Copy Markdown
Member

Swaps the valkey-glide git fork for the released PyPI package — ^2.5 in both pyprojects (locks resolve 2.5.1).

The fork existed for upstream PR 5124 (mTLS), which merged Jan 2026 and has shipped since 2.4.0. It costs 272 s of Rust build on every spread job, ~34 jobs per CI run.

poetry install --only integration: 272 s → 0.6 s.

Two gotchas, both handled here

The sdist is incomplete. Wheels ship glide and glide_shared; every sdist from 2.2.10 to 2.5.1 ships only glide — which imports glide_shared. charmcraft installs with --no-binary=:all:, so glide-runner failed every hook with ModuleNotFoundError: No module named 'glide_shared'. Fixed by pinning that one package to its wheel: poetry-pip-extra-args: ["--only-binary=valkey-glide"].

glide renames error codes. Valkey replies NOPERM, glide ≥2.4 renders PermissionDenied. Two assertions in test_client_relation.py now accept either. NOAUTH/WRONGPASS still arrive verbatim via ClosingError, so helpers.py is untouched.

Both pyprojects pinned valkey-glide to skourta/valkey-glide@add-build-rs-to-async-client
(a15d4c3, a Feb-2026 dev snapshot), so every spread job compiled it from Rust source:
272 s of the ~274 s tox commands_pre. The reason expired — upstream PR 5124 ("Python: add
mTLS support") merged 2026-01-08 and ships in every release since 2.4.0. Move both to
`valkey-glide = "^2.5"` (locks resolve 2.5.1). Measured: 272 s -> 0.6 s warm, 11.2 s cold,
across 34 integration jobs per CI run.

Two things the switch needs on top of the version bump:

valkey-glide's wheels ship two top-level packages, `glide` and `glide_shared`, but its
sdist ships only `glide` — and `glide/_ffi_instance.py` imports `glide_shared._glide_ffi`.
`glide_shared` is not published separately, and no sdist from 2.2.10 to 2.5.1 contains it.
charmcraft's poetry plugin installs with `--no-binary=:all:`, so the glide-runner charm
built a glide that died on `ModuleNotFoundError: No module named 'glide_shared'`, failing
every hook from `install` onward. Pin that one package to its wheel with
`poetry-pip-extra-args: ["--only-binary=valkey-glide"]`, which is appended after the
plugin's own flag and wins because pip's per-package only_binary beats `:all:`.

glide also rewrites server error codes on the RequestError path: Valkey replies
`NOPERM No permissions to access a key`, glide >=2.4 renders `PermissionDenied: ...`.
Accept either spelling in test_client_relation.py so the assertion tracks the denial
rather than the client's wording. Connection-level errors (ClosingError) still quote the
server verbatim, so the NOAUTH/WRONGPASS checks in helpers.py are unaffected.

Verified on VM/lxd: test_charm.py 5/5 and test_client_relation.py 8/8, the latter
including test_mtls and test_certificate_authentication. k8s was not exercised locally.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@delgod
delgod requested review from reneradoi and skourta August 20, 2026 17:24
@delgod
delgod marked this pull request as ready for review August 20, 2026 17:25

@Mehdi-Bendriss Mehdi-Bendriss 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.

Thanks Mykola! This was a long awaited fix.
@skourta missed your window there :D

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

Very nice, this was still on the to-do list.

@delgod
delgod merged commit 3c9e51d into 9/edge Aug 21, 2026
130 of 137 checks passed
@delgod
delgod deleted the valkey-glide branch August 21, 2026 13:38
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