Skip to content

feat(valkey): expose instance version and allow changing it - #524

Merged
x10an14-nav merged 1 commit into
mainfrom
add_valkey_version3
Sep 16, 2026
Merged

x10an14-nav merged 1 commit into
mainfrom
add_valkey_version3

Conversation

@x10an14-nav

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI 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.

🟡 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 NamePrefix as 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 as instanceNamer(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.Version field is not checked by Validate. A non-GraphQL caller can pass an unknown enum value; toPgrator() then returns empty and updateVersion silently 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.

Comment thread internal/graph/schema/valkey.graphqls
Comment thread internal/persistence/valkey/queries.go Outdated
Comment thread internal/graph/schema/valkey.graphqls
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
x10an14-nav marked this pull request as ready for review September 16, 2026 13:35
@x10an14-nav
x10an14-nav requested a review from a team as a code owner September 16, 2026 13:35
@x10an14-nav
x10an14-nav enabled auto-merge (squash) September 16, 2026 13:35
@x10an14-nav
x10an14-nav merged commit 7276bad into main Sep 16, 2026
11 checks passed
@x10an14-nav
x10an14-nav deleted the add_valkey_version3 branch September 16, 2026 14:45
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.

3 participants