Skip to content

feat: rename transactions module to transactionplane#411

Merged
paul-nicolas merged 3 commits intomainfrom
paul-nicolas/rename-transactions-svc
Feb 26, 2026
Merged

feat: rename transactions module to transactionplane#411
paul-nicolas merged 3 commits intomainfrom
paul-nicolas/rename-transactions-svc

Conversation

@paul-nicolas
Copy link
Contributor

Summary

  • Rename the transactions service/module to transactionplane (no hyphen) throughout the operator codebase
  • Docker image name uses transaction-plane (with hyphen) as the only exception
  • Fix GatewayHTTPAPI resource naming to use strings.ToLower instead of LowerCamelCaseKind, ensuring RFC 1123 compliance for multi-word kind names like TransactionPlane

Test plan

  • All existing tests pass (just tests)
  • Pre-commit checks pass (lint, generate, manifests, Helm lint/template, docs)
  • Verify CRD deployment on a test cluster

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
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

Walkthrough

This 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

Cohort / File(s) Summary
CRD Type Definitions
api/formance.com/v1beta1/transactionplane_types.go
Renamed primary CRD type and all associated wrappers from Transactions to TransactionPlane, including spec, status, and list types. Updated struct field types, method receivers, scheme registration, and documentation strings.
Generated Code
api/formance.com/v1beta1/zz_generated.deepcopy.go
Updated all autogenerated deepcopy functions to operate on TransactionPlane, TransactionPlaneList, TransactionPlaneSpec, and TransactionPlaneStatus types instead of their Transactions counterparts.
Documentation
docs/09-Configuration reference/01-Settings.md, docs/09-Configuration reference/02-Custom Resource Definitions.md
Updated configuration and CRD documentation to reflect transactionplane resource naming, including settings key from transactions.worker-enabled to transactionplane.worker-enabled and CRD schema documentation.
Core Utilities
internal/core/module.go
Added new exported function LowerCaseKind(ctx Context, ob client.Object) string to retrieve Kubernetes object kinds in lowercase format, with corresponding strings import addition.
Resource Registration
internal/resources/all.go
Replaced resource package import from transactions to transactionplane, updating which package is initialized on import.
Resource Implementation
internal/resources/transactionplane/deployments.go, internal/resources/transactionplane/init.go
Refactored package name from transactions to transactionplane and updated all function signatures, type references, identity strings, and broker/dependency wiring to use TransactionPlane resource and related naming conventions.
Gateway HTTP APIs
internal/resources/gatewayhttpapis/create.go
Replaced manual string lowercasing and LowerCamelCaseKind usage with new LowerCaseKind utility function for object kind derivation.
Tests
internal/tests/transactionplane_controller_test.go
Updated test suite to use TransactionPlane and TransactionPlaneSpec types, adjusted resource references, deployment expectations, and settings keys to align with refactored naming.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • feat: add transactions module #394: Main PR that introduced the initial Transactions CRD/module rename and refactoring to TransactionPlane—directly modifies the same entities added in this change.

Suggested reviewers

  • Dav-14

Poem

🐰 From Transactions we hop to a newer name,
TransactionPlane now claims the frame,
Types renamed with a careful touch,
Deepcopy dancing, refactoring's clutch,
The plane takes flight, organized and bright! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: renaming the transactions module to transactionplane, which is the primary objective of the changeset.
Description check ✅ Passed The description is directly related to the changeset, providing a clear summary of the rename, the hyphenation exception for Docker images, and the GatewayHTTPAPI naming fix.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch paul-nicolas/rename-transactions-svc

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@paul-nicolas paul-nicolas marked this pull request as ready for review February 26, 2026 12:58
@paul-nicolas paul-nicolas requested a review from a team as a code owner February 26, 2026 12:58
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
internal/resources/gatewayhttpapis/create.go (1)

16-19: Minor optimization: LowerCaseKind is 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 repeated transactionplane literals 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 95100f4 and ab7d6f7.

⛔ Files ignored due to path filters (9)
  • .earthly/k8s-versions.yaml is excluded by !**/*.yaml
  • config/crd/bases/formance.com_transactionplanes.yaml is excluded by !**/*.yaml
  • config/crd/kustomization.yaml is excluded by !**/*.yaml
  • config/rbac/role.yaml is excluded by !**/*.yaml
  • helm/crds/Chart.yaml is excluded by !**/*.yaml
  • helm/crds/templates/crds/apiextensions.k8s.io_v1_customresourcedefinition_transactionplanes.formance.com.yaml is excluded by !**/*.yaml
  • helm/operator/Chart.lock is excluded by !**/*.lock, !**/*.lock
  • helm/operator/Chart.yaml is excluded by !**/*.yaml
  • helm/operator/templates/gen/rbac.authorization.k8s.io_v1_clusterrole_formance-manager-role.yaml is excluded by !**/gen/**, !**/*.yaml, !**/gen/**
📒 Files selected for processing (10)
  • api/formance.com/v1beta1/transactionplane_types.go
  • api/formance.com/v1beta1/zz_generated.deepcopy.go
  • docs/09-Configuration reference/01-Settings.md
  • docs/09-Configuration reference/02-Custom Resource Definitions.md
  • internal/core/module.go
  • internal/resources/all.go
  • internal/resources/gatewayhttpapis/create.go
  • internal/resources/transactionplane/deployments.go
  • internal/resources/transactionplane/init.go
  • internal/tests/transactionplane_controller_test.go

@paul-nicolas paul-nicolas merged commit dc7d03f into main Feb 26, 2026
6 checks passed
@paul-nicolas paul-nicolas deleted the paul-nicolas/rename-transactions-svc branch February 26, 2026 13:06
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