Skip to content

[TT-11735] Exclude testdata from sonarcloud#6182

Merged
titpetric merged 3 commits into
masterfrom
ci/exclude-testdata-from-sonarcloud
Mar 26, 2024
Merged

[TT-11735] Exclude testdata from sonarcloud#6182
titpetric merged 3 commits into
masterfrom
ci/exclude-testdata-from-sonarcloud

Conversation

@titpetric

@titpetric titpetric commented Mar 26, 2024

Copy link
Copy Markdown
Contributor

Type

enhancement

https://tyktech.atlassian.net/browse/TT-11735


Description

  • This PR enhances the CI configuration by excluding all testdata directories from SonarCloud analysis. This change ensures that test data files do not interfere with the analysis results, making them more accurate and relevant.

Changes walkthrough

Relevant files
Configuration changes
ci-tests.yml
Exclude Test Data from SonarCloud Analysis                             

.github/workflows/ci-tests.yml

  • Added exclusion for **/testdata/** in SonarCloud analysis to avoid
    scanning test data.
  • +1/-1     

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

    @titpetric
    titpetric requested a review from a team as a code owner March 26, 2024 08:48
    @github-actions

    Copy link
    Copy Markdown
    Contributor

    PR Description updated to latest commit (0209dd7)

    @github-actions

    Copy link
    Copy Markdown
    Contributor

    API Changes

    no api changes detected

    @github-actions

    Copy link
    Copy Markdown
    Contributor

    PR Review

    ⏱️ Estimated effort to review [1-5]

    1, because the PR involves a straightforward change in the CI configuration file to exclude certain directories from SonarCloud analysis. The change is simple and does not involve complex logic or modifications to the application code itself.

    🧪 Relevant tests

    No

    🔍 Possible issues

    No

    🔒 Security concerns

    No

    Code feedback:
    relevant file.github/workflows/ci-tests.yml
    suggestion      

    Consider adding a comment explaining why **/testdata/** is excluded from SonarCloud analysis. This helps maintain clarity for future maintainers on the rationale behind excluding these directories. For instance, you could add a comment like: "# Excluding testdata directories to prevent test files from skewing analysis results" [important]

    relevant line-Dsonar.exclusions=**/testdata/**,coprocess/**/*,ci/**,smoke-tests/**,apidef/oas/schema/schema.gen.go


    ✨ Review tool usage guide:

    Overview:
    The review tool scans the PR code changes, and generates a PR review which includes several types of feedbacks, such as possible PR issues, security threats and relevant test in the PR. More feedbacks can be added by configuring the tool.

    The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.

    • When commenting, to edit configurations related to the review tool (pr_reviewer section), use the following template:
    /review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...
    
    [pr_reviewer]
    some_config1=...
    some_config2=...
    

    See the review usage page for a comprehensive guide on using this tool.

    @github-actions

    github-actions Bot commented Mar 26, 2024

    Copy link
    Copy Markdown
    Contributor

    PR Code Suggestions

    CategorySuggestions                                                                                                                                                       
    Enhancement
    Narrow down the exclusion pattern for test data directories.

    Consider using a more specific pattern for excluding test data directories. The current
    pattern
    /testdata/ might be too broad and could unintentionally exclude important
    directories or files that are not meant for testing. If possible, specify the exact paths
    or use a more targeted pattern.

    .github/workflows/ci-tests.yml [133]

    --Dsonar.exclusions=**/testdata/**,coprocess/**/*,ci/**,smoke-tests/**,apidef/oas/schema/schema.gen.go
    +-Dsonar.exclusions=<specific-path>/testdata/**,coprocess/**/*,ci/**,smoke-tests/**,apidef/oas/schema/schema.gen.go
     

    ✨ Improve tool usage guide:

    Overview:
    The improve tool scans the PR code changes, and automatically generates suggestions for improving the PR code. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.

    • When commenting, to edit configurations related to the improve tool (pr_code_suggestions section), use the following template:
    /improve --pr_code_suggestions.some_config1=... --pr_code_suggestions.some_config2=...
    
    [pr_code_suggestions]
    some_config1=...
    some_config2=...
    

    See the improve usage page for a comprehensive guide on using this tool.

    @titpetric titpetric changed the title Exclude testdata from sonarcloud [TT-11735] Exclude testdata from sonarcloud Mar 26, 2024
    @sonarqubecloud

    Copy link
    Copy Markdown

    Quality Gate Passed Quality Gate passed

    Issues
    0 New issues
    0 Accepted issues

    Measures
    0 Security Hotspots
    No data about Coverage
    0.0% Duplication on New Code

    See analysis details on SonarCloud

    @titpetric
    titpetric enabled auto-merge (squash) March 26, 2024 09:58
    @titpetric
    titpetric merged commit f6067d9 into master Mar 26, 2024
    @titpetric
    titpetric deleted the ci/exclude-testdata-from-sonarcloud branch March 26, 2024 10:05
    titpetric pushed a commit that referenced this pull request Mar 26, 2024
    ## **Type**
    enhancement
    
    https://tyktech.atlassian.net/browse/TT-11735
    
    ___
    
    ## **Description**
    - This PR enhances the CI configuration by excluding all `testdata`
    directories from SonarCloud analysis. This change ensures that test data
    files do not interfere with the analysis results, making them more
    accurate and relevant.
    
    
    ___
    
    
    
    ## **Changes walkthrough**
    <table><thead><tr><th></th><th align="left">Relevant
    files</th></tr></thead><tbody><tr><td><strong>Configuration
    changes</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>ci-tests.yml</strong><dd><code>Exclude Test Data from
    SonarCloud Analysis</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    </dd></summary>
    <hr>
    
    .github/workflows/ci-tests.yml
    <li>Added exclusion for <code>**/testdata/**</code> in SonarCloud
    analysis to avoid <br>scanning test data.<br>
    
    
    </details>
        
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6182/files#diff-03609cb60b0c6e92fb771eb8787d6722b8c31ca4c03eabc788e147acd8c6fb43">+1/-1</a>&nbsp;
    &nbsp; &nbsp; </td>
    </tr>                    
    </table></td></tr></tr></tbody></table>
    
    ___
    
    > ✨ **PR-Agent usage**:
    >Comment `/help` on the PR to get a list of all available PR-Agent tools
    and their descriptions
    
    ---------
    
    Co-authored-by: Tit Petric <[email protected]>
    titpetric pushed a commit that referenced this pull request Mar 26, 2024
    ## **Type**
    enhancement
    
    https://tyktech.atlassian.net/browse/TT-11735
    
    ___
    
    ## **Description**
    - This PR enhances the CI configuration by excluding all `testdata`
    directories from SonarCloud analysis. This change ensures that test data
    files do not interfere with the analysis results, making them more
    accurate and relevant.
    
    
    ___
    
    
    
    ## **Changes walkthrough**
    <table><thead><tr><th></th><th align="left">Relevant
    files</th></tr></thead><tbody><tr><td><strong>Configuration
    changes</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>ci-tests.yml</strong><dd><code>Exclude Test Data from
    SonarCloud Analysis</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    </dd></summary>
    <hr>
    
    .github/workflows/ci-tests.yml
    <li>Added exclusion for <code>**/testdata/**</code> in SonarCloud
    analysis to avoid <br>scanning test data.<br>
    
    
    </details>
        
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6182/files#diff-03609cb60b0c6e92fb771eb8787d6722b8c31ca4c03eabc788e147acd8c6fb43">+1/-1</a>&nbsp;
    &nbsp; &nbsp; </td>
    </tr>                    
    </table></td></tr></tr></tbody></table>
    
    ___
    
    > ✨ **PR-Agent usage**:
    >Comment `/help` on the PR to get a list of all available PR-Agent tools
    and their descriptions
    
    ---------
    
    Co-authored-by: Tit Petric <[email protected]>
    titpetric pushed a commit that referenced this pull request Mar 26, 2024
    titpetric pushed a commit that referenced this pull request Mar 26, 2024
    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.

    2 participants