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-13658] added missing logger from provider initialisation (#6729) #6730

Closed buger closed 1 day ago

buger commented 1 day ago

User description

TT-13658 added missing logger from provider initialisation (#6729)

User description

TASK: https://tyktech.atlassian.net/browse/TT-13658

Description

Related Issue

Motivation and Context

How This Has Been Tested

Screenshots (if appropriate)

Types of changes

Checklist


PR Type

Bug fix


Description


Changes walkthrough πŸ“

Relevant files
Bug fix
middleware.go
Add missing logger to Provider initialization                       

ee/middleware/upstreamoauth/middleware.go
  • Added a missing logger to the Provider initialization.
  • Ensures that the Logger is properly set in the upstreamOAuthProvider.
  • +1/-0     

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


    PR Type

    Bug fix


    Description


    Changes walkthrough πŸ“

    Relevant files
    Bug fix
    middleware.go
    Add missing logger to Provider initialization                       

    ee/middleware/upstreamoauth/middleware.go
  • Added a missing logger to the Provider initialization.
  • Ensures that the Logger is properly set in the upstreamOAuthProvider.
  • +1/-0     

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

    github-actions[bot] commented 1 day ago

    API Changes

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

    PR Reviewer Guide πŸ”

    Here are some key observations to aid the review process:

    **🎫 Ticket compliance analysis βœ…** **[6729](https://github.com/TykTechnologies/tyk/issues/6729) - Fully compliant** Fully compliant requirements: - Added a missing logger to the Provider initialization in the upstreamoauth middleware.
    ⏱️ Estimated effort to review: 1 πŸ”΅βšͺβšͺβšͺβšͺ
    πŸ§ͺ No relevant tests
    πŸ”’ No security concerns identified
    ⚑ No major issues detected
    github-actions[bot] commented 1 day ago

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Prevent potential nil pointer dereference by ensuring the Logger is initialized ___ **Ensure that the Logger field is properly initialized in the Provider struct to avoid
    nil pointer dereference when the Logger method might return nil.** [ee/middleware/upstreamoauth/middleware.go [83]](https://github.com/TykTechnologies/tyk/pull/6730/files#diff-1347b256f3728407a2697f1e824391eaa329162e644741d8321f25c7a0630363R83-R83) ```diff -Logger: m.Logger(), +Logger: m.Logger(), // Ensure Logger is not nil ```
    Suggestion importance[1-10]: 7 Why: The suggestion is relevant as it addresses a potential runtime error (nil pointer dereference) which is critical in ensuring the robustness of the application. However, the improved code does not implement a check but only adds a comment, which does not prevent the issue but raises awareness. A runtime check would be more effective.
    7
    sonarcloud[bot] commented 1 day ago

    Quality Gate Failed Quality Gate failed

    Failed conditions
    0.0% Coverage on New Code (required β‰₯ 80%)

    See analysis details on SonarQube Cloud