TykTechnologies / tyk

Tyk Open Source API Gateway written in Go, supporting REST, GraphQL, TCP and gRPC protocols
Other
9.75k stars 1.09k forks source link

[TT-12879] Replace Benthos with Bento #6545

Closed buraksezer closed 2 months ago

buraksezer commented 2 months ago

User description

Previous PR https://github.com/TykTechnologies/tyk/pull/6512


PR Type

enhancement, dependencies


Description


Changes walkthrough ๐Ÿ“

Relevant files
Enhancement
manager.go
Replace Benthos with Bento in streaming manager                   

internal/streaming/manager.go
  • Replaced Benthos import paths with Bento.
  • Updated import paths to use warpstreamlabs/bento.
  • +2/-2     
    portal_output.go
    Replace Benthos with Bento in portal output                           

    internal/portal/portal_output.go
  • Replaced Benthos import paths with Bento.
  • Updated import paths to use warpstreamlabs/bento.
  • +2/-2     
    portal_output_test.go
    Update import path in portal output test                                 

    internal/portal/portal_output_test.go - Replaced Benthos import path with Bento in test file.
    +1/-1     
    Dependencies
    go.mod
    Update dependencies to replace Benthos with Bento               

    go.mod
  • Removed Benthos dependency.
  • Added Bento dependency.
  • Updated various indirect dependencies.
  • +17/-12 
    Additional files (token-limit)
    go.sum
    ...                                                                                                           

    go.sum ...
    +243/-31

    ๐Ÿ’ก PR-Agent usage: Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    github-actions[bot] commented 2 months ago

    PR Reviewer Guide ๐Ÿ”

    โฑ๏ธ Estimated effort to review: 3 ๐Ÿ”ต๐Ÿ”ต๐Ÿ”ตโšชโšช
    ๐Ÿงช No relevant tests
    ๐Ÿ”’ No security concerns identified
    โšก Key issues to review

    Dependency Import
    Ensure that the new dependency 'github.com/warpstreamlabs/bento' is fully compatible and tested as it replaces 'github.com/TykTechnologies/benthos'. Dependency Management
    Review the updated dependencies in the 'go.mod' file for compatibility and stability issues, especially the new addition of 'github.com/warpstreamlabs/bento'.
    github-actions[bot] commented 2 months ago

    PR Code Suggestions โœจ

    CategorySuggestion                                                                                                                                    Score
    Best practice
    Replace or remove the blank import to improve code clarity and maintainability ___ **Replace the blank import _ "github.com/warpstreamlabs/bento/public/components/pure"
    with a named import if the package is used, or remove it if not necessary. Blank
    imports should only be used when invoking init functions or when absolutely
    necessary for side-effects.** [internal/portal/portal_output.go [11]](https://github.com/TykTechnologies/tyk/pull/6545/files#diff-5225b7c3a3d3677eed2edb98be754e5cc70a124b0af26485511a0528f535048bR11-R11) ```diff -_ "github.com/warpstreamlabs/bento/public/components/pure" +"github.com/warpstreamlabs/bento/public/components/pure" ```
    Suggestion importance[1-10]: 8 Why: The suggestion correctly identifies a best practice issue with blank imports, which can improve code clarity and maintainability if addressed.
    8
    Replace or remove the blank import to enhance code readability and maintainability ___ **Similar to the previous suggestion, consider replacing the blank import _
    "github.com/warpstreamlabs/bento/public/components/all" with a named import or
    remove it if it's not necessary. This will enhance the readability and
    maintainability of the code.** [internal/streaming/manager.go [14]](https://github.com/TykTechnologies/tyk/pull/6545/files#diff-8cda02479026085d17a6c5559a15bf59638174d16fb5f3ad65bebcecb25ad8d8R14-R14) ```diff -_ "github.com/warpstreamlabs/bento/public/components/all" +"github.com/warpstreamlabs/bento/public/components/all" ```
    Suggestion importance[1-10]: 8 Why: This suggestion also addresses a best practice issue with blank imports, enhancing code readability and maintainability.
    8
    Possible issue
    Verify the compatibility of the new dependency to prevent potential conflicts ___ **Ensure that the newly added dependency github.com/warpstreamlabs/bento v1.2.0 is
    compatible with the existing system and does not introduce any version conflicts
    with other dependencies. It's crucial to verify this to avoid runtime issues.** [go.mod [99]](https://github.com/TykTechnologies/tyk/pull/6545/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6R99-R99) ```diff -github.com/warpstreamlabs/bento v1.2.0 +github.com/warpstreamlabs/bento v1.2.0 // verified compatibility ```
    Suggestion importance[1-10]: 7 Why: Verifying dependency compatibility is important to prevent potential runtime issues, although it's more of a precautionary measure than a direct code improvement.
    7
    Maintainability
    Review and potentially remove unnecessary indirect dependencies to simplify the dependency tree ___ **Review the necessity of adding multiple indirect dependencies such as
    github.com/coreos/go-semver v0.3.0 and github.com/couchbase/gocb/v2 v2.9.1. If these
    are not directly used by your project, consider removing them to keep the dependency
    tree clean and manageable.** [go.mod [215-217]](https://github.com/TykTechnologies/tyk/pull/6545/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6R215-R217) ```diff -github.com/coreos/go-semver v0.3.0 // indirect -github.com/couchbase/gocb/v2 v2.9.1 // indirect +# Dependencies reviewed and unnecessary ones removed ```
    Suggestion importance[1-10]: 6 Why: While reviewing indirect dependencies can improve maintainability, it is a minor issue and may not have an immediate impact on the code's functionality.
    6