feat: added new projector domain; updated controlplane-api#321
Open
feat: added new projector domain; updated controlplane-api#321
Conversation
Member
ron96g
commented
Apr 10, 2026
- feat(controlplane-api): evolve schemas for projector and relocate shared model types
- feat(projector): add CQRS projector for materializing CR state into PostgreSQL
…red model types Prepare the controlplane-api module for the upcoming projector by evolving ent schemas and relocating shared domain types: - Add metadata mixin (name, namespace, labels, annotations, generation, resourceVersion, creationTimestamp, deletionTimestamp) replacing the narrower namespace-only mixin - Extend approval/approvalrequest schemas with new fields for state tracking (requesterInfo, deciderInfo, decisions, availableTransitions) - Add team/zone metadata fields and application-level zone foreign key - Relocate embedded model types (Upstream, ApprovalConfig, RequesterInfo, DeciderInfo, Decision, AvailableTransition) from internal/resolvers/model to pkg/model for cross-module imports - Regenerate all ent and gqlgen code - Add .gitignore for build artifacts
…ostgreSQL Add the projector module — a read-only Kubernetes controller that watches Custom Resources and maintains a materialised relational read-model in PostgreSQL via the ent ORM. This implements the query-side projection in a CQRS architecture: - Generic pipeline: SyncEventHandler → ReadOnlyReconciler → Processor (translate K8s object → upsert/delete in DB) - Domain modules for zone, group, team, application, apiexposure, apisubscription, approval, and approvalrequest — each with its own translator, repository, and typed module registration - Infrastructure layer: DeleteCache (last-known object on delete), EdgeCache (ristretto-based FK ID cache), IDResolver (cache-first, DB-fallback FK lookups) - Per-module Prometheus metrics (reconcile latency, upsert/delete/skip counters, error counters) - Leader election, env-var configuration, and health/ready probes - Add projector job to CI workflow and dependabot config
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
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.