-
Notifications
You must be signed in to change notification settings - Fork 0
fix(payments): connector type is missing in the request #30
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
f3d9f72 to
f7f19e6
Compare
WalkthroughAdds extraction of "provider" from config to set Connector in V3InstallConnectorRequest during CreateConfig. Updates unit and integration tests to expect Connector and to validate exact request payloads instead of permissive predicates. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Caller
participant R as CreateConfig
participant Cfg as Unstructured Config
participant API as Connectors API
C->>R: CreateConfig(config)
R->>Cfg: Read fields (type, provider, settings)
Note right of R: Extract "provider" and set<br/>request.Connector accordingly
R->>API: V3InstallConnectorRequest{ Type, Connector, Config... }
API-->>R: InstallConnectorResponse
R-->>C: Result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
internal/resources/payments_connectors.go(1 hunks)internal/resources/payments_connectors_test.go(2 hunks)tests/integration/payments_connectors_test.go(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Tests (E2E)
🔇 Additional comments (3)
internal/resources/payments_connectors_test.go (2)
40-40: LGTM!The test correctly validates that the Connector field is populated with the provider value from the config.
74-74: LGTM!The test correctly validates that the Connector field is populated with the provider value for the Adyen connector type.
tests/integration/payments_connectors_test.go (1)
74-87: Excellent test improvement!Replacing the flexible
gomock.Condmatcher with an explicit struct expectation makes the test more precise and clearly validates that the Connector field is correctly populated. This change ensures the fix is properly tested and prevents regressions.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #30 +/- ##
==========================================
+ Coverage 56.90% 56.94% +0.04%
==========================================
Files 19 19
Lines 1448 1454 +6
==========================================
+ Hits 824 828 +4
- Misses 518 519 +1
- Partials 106 107 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
internal/resources/payments_connectors.go (1)
75-91: Ensure Connector is always populated (fallback to Type, set after unmarshal).If "provider" is absent, Connector becomes empty. Fallback to Type after unmarshalling and assign Connector then.
- provider := "" - if v, ok := snakeAS["provider"]; ok { - if n, ok := v.(string); ok { - provider = n - } - } + provider := "" + if v, ok := snakeAS["provider"]; ok { + if n, ok := v.(string); ok { + provider = n + } + } - config := operations.V3InstallConnectorRequest{ - Connector: provider, - V3InstallConnectorRequest: &shared.V3InstallConnectorRequest{}, - } + config := operations.V3InstallConnectorRequest{ + V3InstallConnectorRequest: &shared.V3InstallConnectorRequest{}, + } if err := config.V3InstallConnectorRequest.UnmarshalJSON(data); err != nil { return config, err } + if provider == "" && config.V3InstallConnectorRequest.Type != "" { + provider = config.V3InstallConnectorRequest.Type + } + config.Connector = provider
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (3)
internal/resources/payments_connectors.go(1 hunks)internal/resources/payments_connectors_test.go(2 hunks)tests/integration/payments_connectors_test.go(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Tests (E2E)
🔇 Additional comments (3)
internal/resources/payments_connectors_test.go (2)
40-52: LGTM: expectation now validates Connector="Generic".
74-90: LGTM: expectation now validates Connector="Adyen".tests/integration/payments_connectors_test.go (1)
74-87: LGTM: exact CreateConnector payload including Connector is now asserted.
No description provided.