Repository navigation
wip(postgres): retire branch GraphQL contracts - #623
Merged
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
🟡 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 fileinternal/graph/gengql/issues.generated.go: Generated fileinternal/graph/gengql/persistence.generated.go: Generated fileinternal/graph/gengql/schema.generated.go: Generated fileinternal/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
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
marked this pull request as ready for review
November 13, 2026 10:21
thokra-nav
approved these changes
Nov 13, 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.

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.