Skip to content
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

feat(fctl): add generic connector install #1387

Merged
merged 2 commits into from Apr 5, 2024

Conversation

paul-nicolas
Copy link
Contributor

@paul-nicolas paul-nicolas commented Apr 5, 2024

Fixes ENG-941

Summary by CodeRabbit

  • New Features
    • Introduced a generic connector for payments, enhancing the flexibility and range of payment processing options.
    • Added support for configuring generic accounts with details such as API keys, endpoints, and polling intervals.
  • Documentation
    • Updated SDK documentation to include new entities and configuration options related to the generic connector.
  • Refactor
    • Updated connector types across various functions to include the new generic connector.
  • Chores
    • Updated SDK version and user agent details in the Go SDK.

Copy link
Contributor

coderabbitai bot commented Apr 5, 2024

Walkthrough

The update introduces a new generic connector for payments, enhancing the system's flexibility and interoperability with various payment systems. It incorporates the generic connector into the installation and configuration processes, updates SDK documentation and code to accommodate the new connector, and revises versioning details to reflect these changes. This expansion allows for more customizable payment operations, catering to a broader range of financial transactions.

Changes

Files Summary
components/fctl/.../install/generic.go
components/fctl/.../connectors/internal/connectors.go
releases/sdks/go/pkg/models/shared/connector.go
releases/sdks/go/pkg/models/shared/connectorconfig.go
releases/sdks/go/pkg/models/shared/genericconfig.go
Introduced a new generic connector for payments, including necessary structs, constants, and methods for installation and configuration.
components/fctl/.../install/root.go Added NewGenericCommand() to the installation command hierarchy.
releases/sdks/go/.speakeasy/gen.lock Updated with new version details and configuration checksums, including genericconfig.go and genericconfig.md.
releases/sdks/go/docs/pkg/models/shared/... Documented the new ConnectorGeneric and GenericConfig entities, detailing their structure and usage.
releases/sdks/go/docs/sdks/payments/README.md
releases/sdks/go/formance.go
Updated SDK documentation and versioning to reflect the addition of the generic connector and related changes.

"In the realm of code, where the bits do roam,
A new connector springs, in its digital home.
🌟 With a hop and a skip, it weaves through the net,
Binding services tight, so needs are met.
From generic.go, it begins its tale,
A rabbit's craft, leaving no detail stale.
🐰 To the future, we hop, with tech so grand,
In the vast, open field of the digital land."

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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.

Actionable comments posted: 7

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between f76dbea and 910eb08.
Files ignored due to path filters (2)
  • components/payments/openapi.yaml is excluded by !**/*.yaml
  • releases/sdks/go/gen.yaml is excluded by !**/*.yaml
Files selected for processing (12)
  • components/fctl/cmd/payments/connectors/install/generic.go (1 hunks)
  • components/fctl/cmd/payments/connectors/install/root.go (1 hunks)
  • components/fctl/cmd/payments/connectors/internal/connectors.go (2 hunks)
  • releases/sdks/go/.speakeasy/gen.lock (3 hunks)
  • releases/sdks/go/docs/pkg/models/shared/connector.md (1 hunks)
  • releases/sdks/go/docs/pkg/models/shared/connectorconfig.md (1 hunks)
  • releases/sdks/go/docs/pkg/models/shared/genericconfig.md (1 hunks)
  • releases/sdks/go/docs/sdks/payments/README.md (10 hunks)
  • releases/sdks/go/formance.go (1 hunks)
  • releases/sdks/go/pkg/models/shared/connector.go (2 hunks)
  • releases/sdks/go/pkg/models/shared/connectorconfig.go (5 hunks)
  • releases/sdks/go/pkg/models/shared/genericconfig.go (1 hunks)
Files skipped from review due to trivial changes (2)
  • components/fctl/cmd/payments/connectors/install/root.go
  • components/fctl/cmd/payments/connectors/internal/connectors.go
Additional comments not posted (18)
releases/sdks/go/docs/pkg/models/shared/connector.md (1)

18-18: LGTM! The addition of ConnectorGeneric aligns with the PR's objectives.

releases/sdks/go/pkg/models/shared/genericconfig.go (1)

9-55: LGTM! The GenericConfig struct and its methods are correctly implemented and align with the PR's objectives.

releases/sdks/go/pkg/models/shared/connector.go (2)

23-23: LGTM! The addition of ConnectorGeneric constant is correctly implemented.


56-56: LGTM! The update to the UnmarshalJSON method correctly handles the new ConnectorGeneric case.

releases/sdks/go/docs/pkg/models/shared/connectorconfig.md (1)

66-71: LGTM! The documentation for GenericConfig is clear and correctly formatted.

releases/sdks/go/docs/pkg/models/shared/genericconfig.md (1)

1-11: LGTM! The documentation for GenericConfig fields is clear and correctly formatted.

components/fctl/cmd/payments/connectors/install/generic.go (1)

1-100: LGTM! The implementation for installing a generic connector is well-structured and follows best practices.

releases/sdks/go/pkg/models/shared/connectorconfig.go (3)

23-23: LGTM! The addition of ConnectorConfigTypeGenericConfig is correctly implemented.


132-139: LGTM! The method for creating GenericConfig within ConnectorConfig is correctly implemented.


157-162: LGTM! The update to the UnmarshalJSON method correctly handles the new GenericConfig case.

releases/sdks/go/formance.go (2)

167-167: LGTM! The update to the SDKVersion field is correctly implemented.


169-169: LGTM! The update to the UserAgent field is correctly implemented.

releases/sdks/go/.speakeasy/gen.lock (3)

8-8: The update to releaseVersion is appropriate for indicating a new release or update.


9-9: The update to configChecksum reflects changes in the configuration, ensuring integrity and consistency.


493-493: The addition of genericconfig.go and genericconfig.md files is essential for the new generic connector's functionality and documentation.

Also applies to: 1202-1202

releases/sdks/go/docs/sdks/payments/README.md (3)

706-706: Ensure that the connector type shared.ConnectorAdyen aligns with the intended functionality and requirements of the GetConnectorTask operation.

+        // Ensure ConnectorAdyen is the correct choice for the specific task requirements
         Connector: shared.ConnectorAdyen,

760-760: Verify that shared.ConnectorBankingCircle is the appropriate connector for the GetConnectorTaskV1 operation, considering the operation's specific needs.

+        // Confirm ConnectorBankingCircle meets the operation's needs
         Connector: shared.ConnectorBankingCircle,

1685-1685: Ensure the use of shared.ConnectorGeneric in the ReadConnectorConfig operation is justified and aligns with the operation's requirements.

+        // Using ConnectorGeneric, ensure it's suitable for reading the config as intended
         Connector: shared.ConnectorGeneric,

@@ -136,7 +136,7 @@ func main() {
Destination: "acct_1Gqj58KZcSIg2N2q",
Source: v2.String("acct_1Gqj58KZcSIg2N2q"),
},
Connector: shared.ConnectorCurrencyCloud,
Connector: shared.ConnectorBankingCircle,
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding a comment explaining why shared.ConnectorBankingCircle is used here, especially if the choice of connector impacts the behavior or requirements of the transfer.

+        // Using ConnectorBankingCircle for specific banking circle benefits
         Connector: shared.ConnectorBankingCircle,

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
Connector: shared.ConnectorBankingCircle,
// Using ConnectorBankingCircle for specific banking circle benefits
Connector: shared.ConnectorBankingCircle,

@@ -1033,7 +1033,7 @@ func main() {
PollingPeriod: v2.String("60s"),
},
),
Connector: shared.ConnectorAtlar,
Connector: shared.ConnectorAdyen,
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a comment to clarify the choice of shared.ConnectorAdyen for the InstallConnector operation, especially if there are specific reasons for selecting this connector.

+        // Chosen ConnectorAdyen for its specific features suitable for this installation
         Connector: shared.ConnectorAdyen,

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
Connector: shared.ConnectorAdyen,
// Chosen ConnectorAdyen for its specific features suitable for this installation
Connector: shared.ConnectorAdyen,

@@ -1242,7 +1242,7 @@ func main() {

ctx := context.Background()
res, err := s.Payments.ListConnectorTasks(ctx, operations.ListConnectorTasksRequest{
Connector: shared.ConnectorWise,
Connector: shared.ConnectorModulr,
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider explaining the selection of shared.ConnectorModulr for the ListConnectorTasks operation in a comment, particularly if the connector's features impact the operation.

+        // Selected ConnectorModulr due to its compatibility with the tasks being listed
         Connector: shared.ConnectorModulr,

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
Connector: shared.ConnectorModulr,
// Selected ConnectorModulr due to its compatibility with the tasks being listed
Connector: shared.ConnectorModulr,

@@ -1849,7 +1849,7 @@ func main() {

ctx := context.Background()
res, err := s.Payments.ResetConnector(ctx, operations.ResetConnectorRequest{
Connector: shared.ConnectorMoneycorp,
Connector: shared.ConnectorAtlar,
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a comment to justify the use of shared.ConnectorAtlar for the ResetConnector operation, especially if the connector choice is crucial for the operation's success.

+        // Resetting ConnectorAtlar, confirm it's the intended connector for reset
         Connector: shared.ConnectorAtlar,

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
Connector: shared.ConnectorAtlar,
// Resetting ConnectorAtlar, confirm it's the intended connector for reset
Connector: shared.ConnectorAtlar,

@@ -1905,7 +1905,7 @@ func main() {

ctx := context.Background()
res, err := s.Payments.ResetConnectorV1(ctx, operations.ResetConnectorV1Request{
Connector: shared.ConnectorAdyen,
Connector: shared.ConnectorGeneric,
Copy link
Contributor

Choose a reason for hiding this comment

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

Clarify why shared.ConnectorGeneric is chosen for the ResetConnectorV1 operation with a comment, particularly if the connector's features are essential for the operation.

+        // Resetting ConnectorGeneric, ensure its features are necessary for the operation
         Connector: shared.ConnectorGeneric,

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
Connector: shared.ConnectorGeneric,
// Resetting ConnectorGeneric, ensure its features are necessary for the operation
Connector: shared.ConnectorGeneric,

@@ -2137,7 +2137,7 @@ func main() {

ctx := context.Background()
res, err := s.Payments.UninstallConnector(ctx, operations.UninstallConnectorRequest{
Connector: shared.ConnectorWise,
Connector: shared.ConnectorModulr,
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider explaining the rationale behind using shared.ConnectorModulr for the UninstallConnector operation in a comment, especially if specific connector features are required.

+        // Uninstalling ConnectorModulr, verify it's the correct connector for uninstallation
         Connector: shared.ConnectorModulr,

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
Connector: shared.ConnectorModulr,
// Uninstalling ConnectorModulr, verify it's the correct connector for uninstallation
Connector: shared.ConnectorModulr,

@@ -2191,7 +2191,7 @@ func main() {

ctx := context.Background()
res, err := s.Payments.UninstallConnectorV1(ctx, operations.UninstallConnectorV1Request{
Connector: shared.ConnectorAdyen,
Connector: shared.ConnectorGeneric,
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a comment to justify the selection of shared.ConnectorGeneric for the UninstallConnectorV1 operation, particularly if the connector's characteristics are crucial.

+        // Uninstalling ConnectorGeneric, confirm its suitability for this operation
         Connector: shared.ConnectorGeneric,

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
Connector: shared.ConnectorGeneric,
// Uninstalling ConnectorGeneric, confirm its suitability for this operation
Connector: shared.ConnectorGeneric,

@paul-nicolas paul-nicolas added this pull request to the merge queue Apr 5, 2024
Merged via the queue into main with commit 7d1ce4e Apr 5, 2024
10 checks passed
@paul-nicolas paul-nicolas deleted the feat/payments-generic-fctl branch April 5, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants