Skip to content

feat(aiven)!: expose Valkey version and error when no version is known - #508

Open
x10an14-nav wants to merge 1 commit into
mainfrom
add_valkey_version
Open

feat(aiven)!: expose Valkey version and error when no version is known#508
x10an14-nav wants to merge 1 commit into
mainfrom
add_valkey_version

Conversation

@x10an14-nav

Copy link
Copy Markdown
Contributor

Aiven reports what an instance is actually running, so it outranks the CR, which only records what was asked for. An unknown version previously became V2 by default, so the API asserted a version nobody chose and the update path could validate an upgrade against that guess. V1 is no longer offered by Aiven for OpenSearch.

BREAKING CHANGE: version is now required on createValkey and updateValkey. V1 is removed from OpenSearchMajorVersion.

Closes: https://github.com/nais/system/pull/539

@x10an14-nav
x10an14-nav requested a review from a team as a code owner August 28, 2026 15:55
@x10an14-nav
x10an14-nav requested a balanced review from Copilot and removed request for a team August 28, 2026 15:55
@x10an14-nav x10an14-nav self-assigned this Aug 28, 2026
@x10an14-nav
x10an14-nav requested a review from thokra-nav August 28, 2026 15:57
@x10an14-nav

Copy link
Copy Markdown
Contributor Author

@thokra-nav Sorry, du kan ignorere/vente til neste uke og når copilot har gått igjennom.

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.

Pull request overview

Exposes authoritative Aiven versions for Valkey and OpenSearch and validates upgrades against running versions.

Changes:

  • Adds Valkey version inputs, persistence, GraphQL exposure, and upgrade validation.
  • Centralizes Aiven version loading and removes OpenSearch V1 support.
  • Expands integration coverage and updates the Nix toolchain.

Reviewed changes

Copilot reviewed 22 out of 24 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
internal/thirdparty/aiven/versionloader.go Adds shared version loader.
internal/thirdparty/aiven/fake.go Adds fake version metadata.
internal/thirdparty/aiven/dataloader.go Registers shared loader.
internal/persistence/valkey/queries.go Persists and updates versions.
internal/persistence/valkey/models.go Adds version models and validation.
internal/persistence/opensearch/queries.go Uses Aiven versions.
internal/persistence/opensearch/models.go Removes V1 support.
internal/persistence/opensearch/dataloader.go Removes domain-specific loader.
internal/graph/valkey.resolvers.go Resolves Valkey versions.
internal/graph/schema/valkey.graphqls Exposes version API.
internal/graph/schema/opensearch.graphqls Removes V1 enum value.
internal/graph/gengql/valkey.generated.go Updates generated Valkey GraphQL code.
internal/graph/gengql/root_.generated.go Updates generated schema code.
internal/cmd/api/http.go Initializes the shared loader.
integration_tests/valkeyversion.lua Tests version queries.
integration_tests/valkey_crud.lua Updates version mutation tests.
integration_tests/opensearchversion.lua Updates reported version expectations.
integration_tests/opensearch_version_defects.lua Tests version-source edge cases.
integration_tests/opensearch_crud.lua Updates supported-version tests.
integration_tests/k8s_resources/opensearch_version/dev/myteam/opensearch-myteam-nometa.yaml Adds CR-fallback fixture.
integration_tests/k8s_resources/opensearch_version/dev/myteam/opensearch-myteam-nocrd.yaml Adds unknown-version fixture.
integration_tests/activitylog_filter.lua Supplies required Valkey version.
flake.nix Updates Go and Prettier configuration.
flake.lock Updates pinned nixpkgs.
Files not reviewed (1)
  • internal/graph/gengql/valkey.generated.go: Generated file
Suppressed comments (2)

internal/graph/schema/valkey.graphqls:69

  • The public enum itself is missing a GraphQL description; descriptions on its values do not document the enum type. Add a concise description before the declaration.
enum ValkeyMajorVersion {

internal/graph/schema/valkey.graphqls:66

  • desiredMajor is derived exclusively from the running Aiven version, so it reports the actual major rather than the desired version described by this public field. Either source the desired value from the persisted configuration or rename this field to actualMajor before exposing the API.
	"The desired major version of the Valkey instance."
	desiredMajor: ValkeyMajorVersion!

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/persistence/valkey/queries.go
Comment thread internal/persistence/opensearch/queries.go Outdated
Comment thread internal/persistence/opensearch/queries.go
Comment thread internal/graph/schema/valkey.graphqls
Comment thread flake.nix Outdated
Comment thread internal/graph/schema/opensearch.graphqls

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.

Pull request overview

Copilot reviewed 21 out of 24 changed files in this pull request and generated 3 comments.

Files not reviewed (2)
  • internal/graph/gengql/opensearch.generated.go: Generated file
  • internal/graph/gengql/valkey.generated.go: Generated file
Suppressed comments (1)

internal/persistence/valkey/queries.go:557

  • All modified Valkey updates submit V9_0, matching the fake Aiven version 9.0.2, so updateValkeyVersion returns before exercising this validation and CR-write path. Add integration cases for a valid V9_0V9_1 upgrade and a rejected downgrade or missing-version source.
	if err := input.Version.ValidateUpgradePath(oldMajor); err != nil {
		return nil, err
Comment thread internal/graph/schema/valkey.graphqls
Comment thread internal/graph/schema/opensearch.graphqls Outdated
Comment thread flake.nix
@x10an14-nav
x10an14-nav force-pushed the add_valkey_version branch 3 times, most recently from 6c5b51a to d7c9f0c Compare August 31, 2026 15:36
@x10an14-nav
x10an14-nav requested a balanced review from Copilot September 1, 2026 06:59

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.

Pull request overview

Copilot reviewed 27 out of 30 changed files in this pull request and generated 3 comments.

Files not reviewed (2)
  • internal/graph/gengql/opensearch.generated.go: Generated file
  • internal/graph/gengql/valkey.generated.go: Generated file
Suppressed comments (2)

internal/graph/schema/valkey.graphqls:308

  • The breaking-change contract says createValkey.version is required, but this field is nullable and is also absent from the checked-in executable schema/unmarshaller (root_.generated.go:31820-31837, valkey.generated.go:2627). As shipped, clients cannot supply it and every create defaults to V9_1. Make the field non-null and regenerate the GraphQL artifacts.
	version: ValkeyMajorVersion

internal/graph/schema/opensearch.graphqls:254

  • The PR states that V1 is removed, but deprecation leaves it in the public enum and the Go model still accepts and converts it. Clients can therefore continue submitting V1. Remove it from the public input contract and reject it for new targets, while retaining any internal representation needed to read legacy instances.
	V1 @deprecated(reason: "This version is deprecated.")
Comment thread internal/graph/gengql/root_.generated.go Outdated
Comment thread internal/persistence/valkey/models.go
Comment thread internal/graph/schema/opensearch.graphqls Outdated

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Aiven reports what an instance is actually running, so it outranks the CR, which only records what was asked for.
An unknown version previously became `V2` by default, so the API asserted a version nobody chose and the update path could validate an upgrade against that guess.
`V1` is no longer offered by Aiven for OpenSearch, thus deprecated.

BREAKING CHANGE: `version` is now required on `updateValkey`, and `V1` OpenSearch will trigger error w/Aiven, so error here.

Closes: nais/system#539
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment