feat: rename transactions module to transactionplane#411
Conversation
Rename the transactions service/module to transactionplane throughout: - Go types, package, CRD, deployments, settings, broker topics, auth clients - Docker image uses "transaction-plane" (with hyphen) as the only exception - Fix GatewayHTTPAPI resource naming to use strings.ToLower instead of LowerCamelCaseKind to comply with RFC 1123 for multi-word kind names
WalkthroughThis PR performs a comprehensive refactoring that renames the Transactions CRD and associated types to TransactionPlane across the codebase. Changes include renaming public types (Transactions→TransactionPlane, TransactionsSpec→TransactionPlaneSpec, TransactionsStatus→TransactionPlaneStatus, TransactionsList→TransactionPlaneList), updating package names from transactions to transactionplane, adding a new LowerCaseKind utility function, updating documentation and configuration references, and aligning all tests accordingly. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
internal/resources/gatewayhttpapis/create.go (1)
16-19: Minor optimization:LowerCaseKindis called twice for the same owner.The function computes the same value twice. Consider storing it once for reuse.
♻️ Suggested optimization
func Create(ctx core.Context, owner v1beta1.Module, options ...option) error { objectName := core.LowerCaseKind(ctx, owner) _, _, err := core.CreateOrUpdate[*v1beta1.GatewayHTTPAPI](ctx, types.NamespacedName{ - Name: core.GetObjectName(owner.GetStack(), core.LowerCaseKind(ctx, owner)), + Name: core.GetObjectName(owner.GetStack(), objectName), },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/resources/gatewayhttpapis/create.go` around lines 16 - 19, In Create, avoid calling core.LowerCaseKind twice: compute it once (you already assign objectName := core.LowerCaseKind(ctx, owner)) and reuse that variable in the types.NamespacedName Name and any other places instead of calling core.LowerCaseKind(ctx, owner) again (update the call to core.GetObjectName(owner.GetStack(), objectName) and any duplicate calls to use objectName).internal/tests/transactionplane_controller_test.go (1)
113-113: Consider extracting repeatedtransactionplaneliterals into local constants.This would reduce drift risk in future renames and keep the test intent clearer.
♻️ Suggested refactor
+const ( + transactionPlaneResource = "transactionplane" + transactionPlaneWorkerResource = "transactionplane-worker" + transactionPlaneWorkerEnabledKey = "transactionplane.worker-enabled" +) ... - workerEnabledSettings = settings.New(uuid.NewString(), "transactionplane.worker-enabled", "true", stack.Name) + workerEnabledSettings = settings.New(uuid.NewString(), transactionPlaneWorkerEnabledKey, "true", stack.Name) ... - return LoadResource(stack.Name, "transactionplane", deployment) + return LoadResource(stack.Name, transactionPlaneResource, deployment) ... - return LoadResource("", transactionPlane.Name+"-transactionplane", consumer) + return LoadResource("", transactionPlane.Name+"-"+transactionPlaneResource, consumer) ... - return LoadResource(stack.Name, "transactionplane-worker", deployment) + return LoadResource(stack.Name, transactionPlaneWorkerResource, deployment)Also applies to: 135-135, 226-226, 234-234, 331-331, 335-335, 341-341
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/tests/transactionplane_controller_test.go` at line 113, The test repeats the literal "transactionplane" in multiple LoadResource calls (e.g., the call shown LoadResource(stack.Name, "transactionplane", deployment) in transactionplane_controller_test.go); extract that string into a local constant (e.g., const resourceType = "transactionplane") at the top of the test function or test file and replace all hard-coded occurrences (also noted around other LoadResource calls) with that constant to reduce duplication and ease future renames.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@internal/resources/gatewayhttpapis/create.go`:
- Around line 16-19: In Create, avoid calling core.LowerCaseKind twice: compute
it once (you already assign objectName := core.LowerCaseKind(ctx, owner)) and
reuse that variable in the types.NamespacedName Name and any other places
instead of calling core.LowerCaseKind(ctx, owner) again (update the call to
core.GetObjectName(owner.GetStack(), objectName) and any duplicate calls to use
objectName).
In `@internal/tests/transactionplane_controller_test.go`:
- Line 113: The test repeats the literal "transactionplane" in multiple
LoadResource calls (e.g., the call shown LoadResource(stack.Name,
"transactionplane", deployment) in transactionplane_controller_test.go); extract
that string into a local constant (e.g., const resourceType =
"transactionplane") at the top of the test function or test file and replace all
hard-coded occurrences (also noted around other LoadResource calls) with that
constant to reduce duplication and ease future renames.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (9)
.earthly/k8s-versions.yamlis excluded by!**/*.yamlconfig/crd/bases/formance.com_transactionplanes.yamlis excluded by!**/*.yamlconfig/crd/kustomization.yamlis excluded by!**/*.yamlconfig/rbac/role.yamlis excluded by!**/*.yamlhelm/crds/Chart.yamlis excluded by!**/*.yamlhelm/crds/templates/crds/apiextensions.k8s.io_v1_customresourcedefinition_transactionplanes.formance.com.yamlis excluded by!**/*.yamlhelm/operator/Chart.lockis excluded by!**/*.lock,!**/*.lockhelm/operator/Chart.yamlis excluded by!**/*.yamlhelm/operator/templates/gen/rbac.authorization.k8s.io_v1_clusterrole_formance-manager-role.yamlis excluded by!**/gen/**,!**/*.yaml,!**/gen/**
📒 Files selected for processing (10)
api/formance.com/v1beta1/transactionplane_types.goapi/formance.com/v1beta1/zz_generated.deepcopy.godocs/09-Configuration reference/01-Settings.mddocs/09-Configuration reference/02-Custom Resource Definitions.mdinternal/core/module.gointernal/resources/all.gointernal/resources/gatewayhttpapis/create.gointernal/resources/transactionplane/deployments.gointernal/resources/transactionplane/init.gointernal/tests/transactionplane_controller_test.go
Summary
transactionsservice/module totransactionplane(no hyphen) throughout the operator codebasetransaction-plane(with hyphen) as the only exceptionGatewayHTTPAPIresource naming to usestrings.ToLowerinstead ofLowerCamelCaseKind, ensuring RFC 1123 compliance for multi-word kind names likeTransactionPlaneTest plan
just tests)