Skip to content

wip(postgres): retire branch GraphQL contracts - #623

Merged
frodesundby merged 3 commits into
mainfrom
feat/postgres-branch-retirement
Nov 13, 2026
Merged

frodesundby merged 3 commits into
mainfrom
feat/postgres-branch-retirement

Conversation

@frodesundby

Copy link
Copy Markdown
Contributor

Remove public branch reads and compatibility schema, preserve historical activities and genuine Postgres issues, and build gRPC inventory directly from Postgres. Internal main-view/readiness helper cleanup remains on this branch before the final rollout.

Remove public branch reads and compatibility schema, preserve historical activities and genuine Postgres issues, and build gRPC inventory directly from Postgres. Internal main-view/readiness helper cleanup remains on this branch before the final rollout.

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

Legacy resource and issue types still emit the removed POSTGRES_BRANCH value in facets and are excluded by POSTGRES filters until refreshed, leaving a critical compatibility gap.

1 open issue
5 files not reviewed
  • internal/graph/gengql/complexity.go: Generated file
  • internal/graph/gengql/issues.generated.go: Generated file
  • internal/graph/gengql/persistence.generated.go: Generated file
  • internal/graph/gengql/schema.generated.go: Generated file
  • internal/graph/gengql/teams.generated.go: Generated file
What changed in this PR

This PR retires public Postgres branch contracts in Nais API, shifting clients to database-level operations while retaining historical activities and Postgres issue handling.

Changes:

  • Removes branch-specific GraphQL contracts, resolvers, and node registration.
  • Builds gRPC database inventory directly from logical Postgres resources.
  • Updates schema checks and integration tests for database-level queries and branchless access.
File Description
internal/​persistence/​postgres/​queries.go Removes branch lookup by node ID.
internal/​persistence/​postgres/​physical_status_test.go Checks physical resource identity without branch IDs.
internal/​persistence/​postgres/​node.go Removes branch identifier registration and helpers.
internal/​persistence/​postgres/​models.go Removes branch Node and Persistence implementations.
internal/​persistence/​postgres/​models_test.go Removes branch node-ID assertions.
internal/​kubernetes/​watchers/​postgres_contract_test.go Removes retired branch node lookup coverage.
internal/​issue/​model.go Removes the compatibility branch issue model.
internal/​grpc/​grpcdatabase/​server.go Constructs inventory directly from Postgres resources.
internal/​grpc/​grpcdatabase/​postgres_test.go Tests logical database inventory conversion.
internal/​grpc/​grpcdatabase/​postgres_branch_test.go Deletes branch-specific inventory naming tests.
internal/​graph/​schema/​postgres.graphqls Retires branch contracts and updates database descriptions.
internal/​graph/​schema/​issues.graphqls Removes branch issue types and enum values.
internal/​graph/​postgres.resolvers.go Removes branch resolvers and simplifies legacy access lookup.
internal/​graph/​postgres_schema_test.go Checks retired contracts and retained database/history types.
internal/​graph/​issues.resolvers.go Removes compatibility branch issue resolvers.
internal/​graph/​gengql/​teams.generated.go Removes generated branch inventory count handling.
internal/​graph/​gengql/​schema.generated.go Removes retired types from Node dispatch.
internal/​graph/​gengql/​root_.generated.go Updates generated schema, interfaces, and field dispatch.
internal/​graph/​gengql/​persistence.generated.go Removes branch handling from Persistence dispatch.
internal/​graph/​gengql/​issues.generated.go Removes generated branch issue handling.
internal/​graph/​gengql/​complexity.go Removes complexity rules for retired fields.
integration_tests/​postgres_workloads.lua Tests database-level workload relationships.
integration_tests/​postgres_issues.lua Updates issue queries and historical-row lookup.
integration_tests/​postgres_dual_read.lua Tests direct database reads, identity, and branchless access.
integration_tests/​postgres_branches.lua Replaces branch queries with database-level assertions.
integration_tests/​postgres_branch_selection.lua Updates relationship and provisioning-state queries.
integration_tests/​postgres_audit_log.lua Reads database metadata directly.
integration_tests/​label_selectors.lua Checks labels directly on Postgres databases.
integration_tests/​create_postgres_maintain_access.lua Removes branch selection from maintenance access requests.
integration_tests/​create_postgres_admin_access.lua Removes branch selection from admin access requests.
integration_tests/​create_postgres_access.lua Updates branchless access tests and retired-input rejection.

Review effort: Balanced

Comment thread internal/graph/schema/issues.graphqls Resolved
Normalize stored POSTGRES_BRANCH issue/resource types for filtering, ordering, and facet aggregation before checker refresh. Match legacy physical names for logical database filters and scopes while preserving stored row IDs and conversion metadata. Cover pre-refresh reads, mixed snapshots, zero-count facets, and scope isolation in integration tests.
@frodesundby
frodesundby marked this pull request as ready for review November 13, 2026 10:21
@frodesundby
frodesundby requested a review from a team as a code owner November 13, 2026 10:21
@frodesundby
frodesundby merged commit f4c7098 into main Nov 13, 2026
14 of 15 checks passed
@frodesundby
frodesundby deleted the feat/postgres-branch-retirement branch November 13, 2026 10:36
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