feat(aiven)!: expose Valkey version and error when no version is known - #508
feat(aiven)!: expose Valkey version and error when no version is known#508x10an14-nav wants to merge 1 commit into
Conversation
|
@thokra-nav Sorry, du kan ignorere/vente til neste uke og når copilot har gått igjennom. |
There was a problem hiding this comment.
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
desiredMajoris 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 toactualMajorbefore 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.
8596f05 to
1e6c93e
Compare
There was a problem hiding this comment.
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 version9.0.2, soupdateValkeyVersionreturns before exercising this validation and CR-write path. Add integration cases for a validV9_0→V9_1upgrade and a rejected downgrade or missing-version source.
if err := input.Version.ValidateUpgradePath(oldMajor); err != nil {
return nil, err
6c5b51a to
d7c9f0c
Compare
There was a problem hiding this comment.
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.versionis 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 toV9_1. Make the field non-null and regenerate the GraphQL artifacts.
version: ValkeyMajorVersion
internal/graph/schema/opensearch.graphqls:254
- The PR states that
V1is removed, but deprecation leaves it in the public enum and the Go model still accepts and converts it. Clients can therefore continue submittingV1. 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.")
d7c9f0c to
68277d6
Compare
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
68277d6 to
c6345c9
Compare
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
V2by default, so the API asserted a version nobody chose and the update path could validate an upgrade against that guess.V1is no longer offered by Aiven for OpenSearch.BREAKING CHANGE:
versionis now required oncreateValkeyandupdateValkey.V1is removed fromOpenSearchMajorVersion.Closes: https://github.com/nais/system/pull/539