Moved transactioner interface to pkg - #4359
Conversation
Signed-off-by: anushasunkada <anushasunkada@gmail.com>
📝 WalkthroughWalkthroughThe transaction abstraction is moved from the internal transaction package to ChangesTransactioner provider migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@backend/pkg/thunderidengine/providers/interface.go`:
- Around line 259-266: Update docs/content/apis.mdx to document the public
providers.Transactioner contract, including migration from the former internal
transaction interface, and document WithTransactioner as the engine injection
option with its expected lifecycle and configuration. Apply the documentation
changes for the interface in backend/pkg/thunderidengine/providers/interface.go
and the injection option in backend/pkg/thunderidengine/engine.go; no code
changes are required.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 7f682237-2640-4c4e-b644-1837029a16ae
⛔ Files ignored due to path filters (2)
backend/tests/mocks/database/providermock/DBClientInterface_mock.gois excluded by!**/*_mock.gobackend/tests/mocks/database/providermock/DBProviderInterface_mock.gois excluded by!**/*_mock.go
📒 Files selected for processing (60)
backend/internal/cert/service.gobackend/internal/consent/service.gobackend/internal/consent/store.gobackend/internal/entity/init.gobackend/internal/entity/service.gobackend/internal/entity/store.gobackend/internal/entitytype/file_based_store.gobackend/internal/entitytype/init.gobackend/internal/entitytype/service.gobackend/internal/entitytype/store.gobackend/internal/flow/flowexec/init.gobackend/internal/flow/flowexec/service.gobackend/internal/flow/mgt/cache_backed_store.gobackend/internal/flow/mgt/file_based_store.gobackend/internal/flow/mgt/init.gobackend/internal/flow/mgt/service.gobackend/internal/flow/mgt/store.gobackend/internal/flow/session/service.gobackend/internal/group/file_based_store.gobackend/internal/group/init.gobackend/internal/group/service.gobackend/internal/group/service_test.gobackend/internal/idp/file_based_store.gobackend/internal/idp/init.gobackend/internal/idp/service.gobackend/internal/idp/store.gobackend/internal/inboundclient/init.gobackend/internal/inboundclient/service.gobackend/internal/inboundclient/store.gobackend/internal/notification/file_based_store.gobackend/internal/notification/init.gobackend/internal/notification/mgt_service.gobackend/internal/notification/store.gobackend/internal/oauth/init.gobackend/internal/oauth/oauth2/authz/init.gobackend/internal/oauth/oauth2/authz/service.gobackend/internal/oauth/oauth2/dcr/service.gobackend/internal/ou/file_based_store.gobackend/internal/ou/init.gobackend/internal/ou/service.gobackend/internal/ou/store.gobackend/internal/resource/file_based_store.gobackend/internal/resource/init.gobackend/internal/resource/init_test.gobackend/internal/resource/service.gobackend/internal/resource/store.gobackend/internal/role/assignment_service.gobackend/internal/role/file_based_store.gobackend/internal/role/init.gobackend/internal/role/service.gobackend/internal/role/store.gobackend/internal/runtimestore/dbstore/init.gobackend/internal/runtimestore/init.gobackend/internal/runtimestore/redisstore/init.gobackend/internal/system/database/provider/dbclient.gobackend/internal/system/database/provider/dbprovider.gobackend/internal/system/transaction/transactioner.gobackend/internal/system/transaction/transactioner_test.gobackend/pkg/thunderidengine/engine.gobackend/pkg/thunderidengine/providers/interface.go
|
|
||
| // Transactioner provides transaction management with automatic nesting detection. | ||
| type Transactioner interface { | ||
| // Transact executes the given function within a transaction. | ||
| // If a transaction already exists in the context, it reuses it. | ||
| // Otherwise, it creates a new transaction and commits/rolls back automatically. | ||
| Transact(ctx context.Context, txFunc func(context.Context) error) error | ||
| } |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift
🔴 Documentation Required
This PR introduces user-facing changes that are not covered by documentation updates under docs/.
Please update the relevant documentation before merging.
Missing documentation:
providers.Transactioner: Document the new public transaction provider contract and migration from the internal transaction interface indocs/content/apis.mdx.WithTransactioner: Document the public engine injection option and its expected lifecycle/configuration indocs/content/apis.mdx.
As per path instructions, exported client-facing interface changes require documentation under docs/.
📍 Affects 2 files
backend/pkg/thunderidengine/providers/interface.go#L259-L266(this comment)backend/pkg/thunderidengine/engine.go#L491-L495
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@backend/pkg/thunderidengine/providers/interface.go` around lines 259 - 266,
Update docs/content/apis.mdx to document the public providers.Transactioner
contract, including migration from the former internal transaction interface,
and document WithTransactioner as the engine injection option with its expected
lifecycle and configuration. Apply the documentation changes for the interface
in backend/pkg/thunderidengine/providers/interface.go and the injection option
in backend/pkg/thunderidengine/engine.go; no code changes are required.
Source: Path instructions
Purpose
Moved transactioner interface to pkg
Approach
Related Issues
Related PRs
Checklist
breaking changelabel added.Security checks
Summary by CodeRabbit
New Features
Refactor