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

Merging to release-5.7: [TT-13607] Only import components/io and components/kafka (#6720) #6721

Closed buger closed 1 week ago

buger commented 1 week ago

User description

TT-13607 Only import components/io and components/kafka (#6720)

User description

Attempt to fix TT-13607

We should not need to import all components. I also ran go mod tidy to reduce the dependency graph.

Initial memory usage::

I tested the changes locally with Kafka & labs-streams sample. It works as usual.

TT-13607: https://tyktech.atlassian.net/browse/TT-13607?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ


PR Type

enhancement, dependencies


Description


Changes walkthrough ๐Ÿ“

Relevant files
Enhancement
stream.go
Optimize component imports to reduce memory usage               

ee/middleware/streams/stream.go
  • Removed import of all components.
  • Added specific imports for components/io and components/kafka.
  • +2/-1     
    Dependencies
    go.sum
    Clean up and update Go module dependencies                             

    go.sum
  • Removed multiple unused module dependencies.
  • Updated dependency checksums.
  • +1/-1094

    ๐Ÿ’ก PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information


    PR Type

    Enhancement, Dependencies


    Description


    Changes walkthrough ๐Ÿ“

    Relevant files
    Enhancement
    stream.go
    Optimize component imports to reduce memory usage               

    ee/middleware/streams/stream.go
  • Removed import of all components.
  • Added specific imports for components/io, components/kafka, and
    components/nats.
  • +3/-1     
    Dependencies
    go.mod
    Clean up and update Go module dependencies                             

    go.mod
  • Removed numerous unused module dependencies.
  • Updated some existing dependencies.
  • +3/-208 
    Additional files (token-limit)
    go.sum
    ...                                                                                                           

    go.sum ...
    +10/-1078

    ๐Ÿ’ก PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    github-actions[bot] commented 1 week ago

    API Changes

    no api changes detected
    github-actions[bot] commented 1 week ago

    PR Reviewer Guide ๐Ÿ”

    Here are some key observations to aid the review process:

    **๐ŸŽซ Ticket compliance analysis โœ…** **[6720](https://github.com/TykTechnologies/tyk/issues/6720) - Fully compliant** Fully compliant requirements: - Optimize the import statements in `stream.go` to include only necessary components (`io` and `kafka`), reducing memory usage on cold start. - Clean up the `go.sum` file by removing unused dependencies, which helps in reducing the dependency graph. Not compliant requirements: - None
    โฑ๏ธ Estimated effort to review: 2 ๐Ÿ”ต๐Ÿ”ตโšชโšชโšช
    ๐Ÿงช No relevant tests
    ๐Ÿ”’ No security concerns identified
    โšก Recommended focus areas for review

    Incorrect Import
    The import statement for `components/nats` is added, which contradicts the ticket's requirement to only include `io` and `kafka`.
    github-actions[bot] commented 1 week ago

    PR Code Suggestions โœจ

    No code suggestions found for the PR.

    sonarcloud[bot] commented 1 week ago

    Quality Gate Failed Quality Gate failed

    Failed conditions
    0.0% Coverage on New Code (required โ‰ฅ 80%)

    See analysis details on SonarQube Cloud