chore: Refactor models and other shareable packages into importable pkg#762
chore: Refactor models and other shareable packages into importable pkg#762laouji wants to merge 6 commits into
Conversation
|
Important Review skippedToo many files! This PR contains 298 files, which is 148 over the limit of 150. To get a review, narrow the scope: Upgrade to a paid plan to raise the limit. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (298)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #762 +/- ##
==========================================
- Coverage 66.84% 65.58% -1.26%
==========================================
Files 923 861 -62
Lines 43125 39530 -3595
==========================================
- Hits 28827 25926 -2901
+ Misses 12393 11843 -550
+ Partials 1905 1761 -144 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
NumaryBot
left a comment
There was a problem hiding this comment.
🛑 Changes requested — automated review
The refactor leaves development Docker builds broken, drops CI execution for the moved domain tests, and leaves the connector scaffolding templates generating imports to removed packages. These are discrete follow-up changes needed for the move to be safe.
NumaryBot
left a comment
There was a problem hiding this comment.
🛑 Changes requested — automated review
The refactor mostly preserves code behavior, but introducing pkg/domain as a nested module without release tagging breaks the intended ability for external consumers to pin it to normal repository releases.
| @@ -0,0 +1,50 @@ | |||
| module github.com/formancehq/payments/pkg/domain | |||
There was a problem hiding this comment.
🟠 [major] Publish domain with submodule release tags
When an out-of-repo connector tries to pin github.com/formancehq/payments/pkg/domain to a payments release such as @vX.Y.Z, this nested go.mod makes Go look for tags prefixed with pkg/domain/, while the existing release workflow only creates root v*.*.* tags. That means the new shared domain module cannot be fetched at released versions unless consumers use pseudo-versions or add their own replace; either keep it in the root module or add matching submodule tagging.
NumaryBot
left a comment
There was a problem hiding this comment.
🛑 Changes requested — automated review
The patch introduces a call to a nonexistent method on the Storage interface, so the repository will not compile until that API is implemented or the call is changed.
| } | ||
|
|
||
| func (l *scopedAccountLookup) ListAccountsByConnector(ctx context.Context) ([]models.PSPAccount, error) { | ||
| accounts, err := l.storage.AccountsListAllByConnectorID(ctx, l.connectorID) |
There was a problem hiding this comment.
🔴 [blocker] Add the storage method before calling it
This new lookup implementation calls AccountsListAllByConnectorID, but storage.Storage, its concrete implementation, and the generated mock do not define that method. As a result, any build or test compiling internal/connectors/engine fails with l.storage.AccountsListAllByConnectorID undefined; either add the storage API/implementation/mock or use the existing AccountsList query path here.
Starts: EN-1270
This is part 1 of a project to libify connectors. All this does is move common code into pkg directory.
Libifying the connectors will come in a second PR.