-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Remove unused Analytics CRD #336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis change removes the v1beta1 Analytics CRD and its generated deepcopy methods, deletes the analytics module initializer and its resource import, removes Ledger’s watch dependency on Analytics, and removes the Ledger code that injected EMIT_LOGS based on Analytics readiness. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Operator
participant LedgerReconciler as Ledger Reconciler
participant Builder as Ledger Deployment Builder
participant K8s as Kubernetes API
rect rgb(245,245,255)
note over LedgerReconciler,Builder: Previous (with Analytics dependency)
Operator->>LedgerReconciler: Reconcile Ledger
LedgerReconciler->>Builder: createLedgerContainerFull(...)
Builder->>K8s: Check Analytics dependency status
alt Analytics ready
Builder->>Builder: Append env EMIT_LOGS=true
else Not ready/absent
Builder->>Builder: No EMIT_LOGS
end
Builder-->>LedgerReconciler: Deployment spec
end
rect rgb(245,255,245)
note over LedgerReconciler,Builder: Now (Analytics removed)
Operator->>LedgerReconciler: Reconcile Ledger
LedgerReconciler->>Builder: createLedgerContainerFull(...)
note right of Builder: No Analytics check<br/>No EMIT_LOGS injection
Builder-->>LedgerReconciler: Deployment spec
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
⛔ Files ignored due to path filters (9)
📒 Files selected for processing (8)
💤 Files with no reviewable changes (8)
Comment |
39e5280 to
b2166ab
Compare
Remove the Analytics CRD and all related code as it has never been used. Changes: - Remove Analytics CRD types and generated code - Remove Analytics resource reconciler - Remove Analytics CRD manifests and RBAC roles - Remove Analytics sample configuration - Remove Analytics Helm CRD template - Remove Analytics watch dependency from Ledger - Remove Analytics-based EMIT_LOGS environment variable logic from Ledger - Update generated deepcopy code - Update RBAC role manifests The Analytics CRD was introduced but never actually implemented or used in production. This cleanup reduces maintenance burden and simplifies the codebase.
b2166ab to
d43dca0
Compare
Summary
This PR removes the Analytics CRD and all related code, as it has never been used in production.
Motivation
The Analytics CRD was introduced but never actually implemented or utilized. Removing this unused code:
Changes
Removed Files
api/formance.com/v1beta1/analytics_types.go- Analytics CRD type definitionsinternal/resources/analytics/init.go- Analytics reconciler (empty implementation)config/crd/bases/formance.com_analytics.yaml- CRD manifestconfig/rbac/formance.com_analytics_*.yaml- RBAC roles (editor/viewer)config/samples/formance.com_v1beta1_analytics.yaml- Sample configurationhelm/crds/templates/crds/apiextensions.k8s.io_v1_customresourcedefinition_analytics.formance.com.yaml- Helm CRD templateCode Changes
internal/resources/all.go: Removed Analytics package importinternal/resources/ledgers/init.go: Removed Analytics watch dependencyinternal/resources/ledgers/deployments.go: Removed Analytics-basedEMIT_LOGSenvironment variable logicapi/formance.com/v1beta1/zz_generated.deepcopy.go: Regenerated without Analytics typesconfig/rbac/role.yaml: Regenerated RBAC manifestTesting
Compilation
go build -o bin/manager ./cmd/main.go # ✅ SuccessManifests Generation
Breaking Changes
AnalyticsCRD will be removed.Impact Assessment: None expected, as this CRD was never used in production. No existing Analytics resources should exist in any environment.
Migration Notes
If for any reason Analytics resources exist in a cluster (highly unlikely):
kubectl get analytics --all-namespaceskubectl delete analytics --all --all-namespacesBenefits
✅ Reduced complexity: One less CRD to maintain
✅ Cleaner codebase: Removed ~700 lines of unused code
✅ Better clarity: No confusion about unused features
✅ Easier maintenance: Fewer resources to manage and update