Skip to content

Conversation

@Dav-14
Copy link
Contributor

@Dav-14 Dav-14 commented Oct 13, 2025

No description provided.

@Dav-14 Dav-14 requested a review from a team as a code owner October 13, 2025 10:27
@Dav-14 Dav-14 force-pushed the fix/install_connector_missing_type branch from f3d9f72 to f7f19e6 Compare October 13, 2025 10:28
@coderabbitai
Copy link

coderabbitai bot commented Oct 13, 2025

Walkthrough

Adds 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

Cohort / File(s) Summary
Implementation: Connector population from config
internal/resources/payments_connectors.go
Parse "provider" from config map (snakeAS) and assign to V3InstallConnectorRequest.Connector during CreateConfig. No exported signatures changed.
Unit tests update for Connector field
internal/resources/payments_connectors_test.go
Update expected V3InstallConnectorRequest to include Connector values ("Generic", "Adyen") in assertions. No control-flow changes.
Integration tests: strict request matching
tests/integration/payments_connectors_test.go
Replace gomock.Cond(always-true) with explicit V3InstallConnectorRequest expectation including Connector="Generic" and detailed V3GenericConfig fields; subsequent mocks unchanged.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I hopped through maps of keys and lore,
Found “provider” hidden in the drawer.
Now Connector wears its proper name,
Tests align and play the game.
Thump-thump! Precise requests take flight—
Carrots signed, deployed just right. 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request lacks any description to explain its changes, leaving no contextual information for reviewers and obscuring the intent of the update. Please provide a concise description of the changes introduced by this pull request to clarify its purpose and affected components.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly specifies that the issue with the connector type missing in the payments request is being fixed, accurately summarizing the primary change of populating the Connector field.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/install_connector_missing_type

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

Copy link

@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.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 9e9065b and f7f19e6.

📒 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.Cond matcher 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
Copy link

codecov bot commented Oct 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.94%. Comparing base (b498d75) to head (f7f19e6).
⚠️ Report is 2 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@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.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 9e9065b and f7f19e6.

📒 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.

@Dav-14 Dav-14 enabled auto-merge October 13, 2025 10:46
@Dav-14 Dav-14 added this pull request to the merge queue Oct 13, 2025
Merged via the queue into main with commit 0843be2 Oct 13, 2025
9 checks passed
@Dav-14 Dav-14 deleted the fix/install_connector_missing_type branch October 13, 2025 11:10
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