Skip to content

feat: added new projector domain; updated controlplane-api#321

Open
ron96g wants to merge 3 commits intomainfrom
feat/projector
Open

feat: added new projector domain; updated controlplane-api#321
ron96g wants to merge 3 commits intomainfrom
feat/projector

Conversation

@ron96g
Copy link
Copy Markdown
Member

@ron96g 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

ron96g added 2 commits April 10, 2026 16:19
…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
Copilot AI review requested due to automatic review settings April 10, 2026 14:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@github-advanced-security
Copy link
Copy Markdown

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:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

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