feat(valkey): expose instance version and allow changing it - #524
Merged
Merged
Conversation
x10an14-nav
force-pushed
the
add_valkey_version3
branch
2 times, most recently
from
September 16, 2026 12:48
7e82e85 to
b305e9e
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved issues remain in Valkey version precedence, prefixed-name compatibility, input validation, and GraphQL schema documentation.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds Valkey version exposure and update support through GraphQL, persistence, Aiven metadata loading, and integration coverage.
Changes:
- Adds Valkey version fields, inputs, validation, and update handling.
- Refactors shared Aiven and maintenance dataloaders.
- Updates OpenSearch validation, fixtures, generated code, dependencies, and development tooling.
File summaries
| File | Description |
|---|---|
internal/thirdparty/aiven/fake.go |
Adds type-specific fake metadata behavior. |
internal/thirdparty/aiven/fake_test.go |
Tests fake metadata isolation. |
internal/thirdparty/aiven/dataloader.go |
Adds shared Aiven metadata loading. |
internal/servicemaintenance/queries.go |
Uses value-based loader keys. |
internal/servicemaintenance/dataloader.go |
Updates maintenance loader key handling. |
internal/servicemaintenance/dataloader_test.go |
Tests loader key deduplication. |
internal/persistence/valkey/queries.go |
Implements Valkey version reads and updates. |
internal/persistence/valkey/queries_test.go |
Tests version precedence and mappings. |
internal/persistence/valkey/models.go |
Adds version models, conversion, and validation. |
internal/persistence/valkey/models_test.go |
Tests prefixed-name validation. |
internal/persistence/valkey/dataloader.go |
Adds the Valkey version loader. |
internal/persistence/valkey/client.go |
Handles qualified instance names. |
internal/persistence/opensearch/queries.go |
Reuses metadata loading and validation. |
internal/persistence/opensearch/models.go |
Updates content-length validation. |
internal/persistence/opensearch/models_test.go |
Tests content-length bounds. |
internal/persistence/opensearch/dataloader.go |
Uses the shared Aiven loader. |
internal/graph/valkey.resolvers.go |
Adds the Valkey version resolver. |
internal/graph/schema/valkey.graphqls |
Exposes Valkey version schema types and inputs. |
internal/graph/schema/opensearch.graphqls |
Updates content-length documentation. |
internal/graph/gengql/valkey.generated.go |
Generates Valkey GraphQL support. |
internal/graph/gengql/root_.generated.go |
Updates generated schema metadata. |
integration_tests/valkeyversion.lua |
Tests Valkey version reporting. |
integration_tests/valkey_crud.lua |
Updates Valkey CRUD expectations. |
integration_tests/opensearch_crud.lua |
Updates OpenSearch validation expectations. |
integration_tests/k8s_resources/valkey_version/dev/versionteam/valkey_pinned.yaml |
Adds a pinned-version fixture. |
integration_tests/k8s_resources/valkey_version/dev/versionteam/valkey_pending.yaml |
Adds a pending-version fixture. |
integration_tests/k8s_resources/valkey_version/dev/versionteam/valkey_oldrunning.yaml |
Adds a legacy-version fixture. |
integration_tests/k8s_resources/valkey_crud/dev/someteamname/app.yaml |
Adds a qualified Valkey reference fixture. |
go.sum |
Updates dependency checksums. |
go.mod |
Updates pgrator and related dependencies. |
flake.nix |
Updates development-shell tooling. |
flake.lock |
Updates Nix lock metadata. |
Review details
Files not reviewed (1)
- internal/graph/gengql/valkey.generated.go: Generated file
Suppressed comments (4)
internal/graph/schema/valkey.graphqls:261
- The new enum type itself is undocumented in the public schema, even though its values have descriptions. Add a concise description before the enum declaration.
enum ValkeyMajorVersion {
internal/graph/schema/valkey.graphqls:335
- The implementation and the new update test intentionally adopt the Aiven version when this input is omitted and the stored spec has no version, so this description is inaccurate for legacy instances. Clarify the legacy fallback (and preserve an existing desired version) so clients know omission can populate an empty spec.
"Major version of the Valkey instance. When omitted, the version is left unchanged."
version: ValkeyMajorVersion
internal/persistence/valkey/client.go:30
- Treating any name that starts with
NamePrefixas already qualified changes the Aiven name for existing Console-managed resources whose bare name was previously allowed to start with that prefix. Before this helper those resources were addressed asinstanceNamer(team, name); rejecting only new creates does not protect or migrate existing objects, so their state, version, and access lookups can target the wrong service.
func fullyQualifiedName(teamSlug slug.Slug, name string) string {
if strings.HasPrefix(name, NamePrefix(teamSlug)) {
return name
}
return instanceNamer(teamSlug, name)
internal/persistence/valkey/models.go:633
- The new
UpdateValkeyInput.Versionfield is not checked byValidate. A non-GraphQL caller can pass an unknown enum value;toPgrator()then returns empty andupdateVersionsilently falls back instead of reporting a field-scoped validation error. Validate the pointer when it is non-nil, as the other input enums are validated.
Version *ValkeyMajorVersion `json:"version,omitempty"`
Labels []*model.ResourceLabel `json:"labels,omitempty"`
- Files reviewed: 29/32 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The dependency bump this needed also moved OpenSearch's upgrade rules, leaving the copy kept here disagreeing with the one that decides admission. A rule owned in two places is wrong in one of them, so `pgrator` now decides alone.
x10an14-nav
force-pushed
the
add_valkey_version3
branch
from
September 16, 2026 13:34
b305e9e to
72277a1
Compare
x10an14-nav
marked this pull request as ready for review
September 16, 2026 13:35
x10an14-nav
enabled auto-merge (squash)
September 16, 2026 13:35
christeredvartsen
approved these changes
Sep 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.