Skip to content

[SYSE-358 master] April template application#6248

Merged
ermirizio merged 1 commit into
masterfrom
releng/master
Apr 25, 2024
Merged

[SYSE-358 master] April template application#6248
ermirizio merged 1 commit into
masterfrom
releng/master

Conversation

@ermirizio

@ermirizio ermirizio commented Apr 24, 2024

Copy link
Copy Markdown
Collaborator

User description

Skip signing when building a snapshot to allow dependabot PRs to build.
Use larger runners for build and test.


Type

enhancement, bug_fix


Description

  • Updated GitHub Actions workflow to use modified runner machines for better resource allocation.
  • Implemented skipping of signing for snapshot releases to facilitate dependabot PRs.
  • Introduced new environment variables METADATA_REPORT_PATH and XUNIT_REPORT_PATH to store reports.
  • Enhanced test execution steps to generate junitxml reports and metadata for better CI insights.
  • Optimized Docker image size by cleaning up additional directories in Dockerfile.std.

Changes walkthrough

Relevant files
Enhancement
release.yml
Enhance GitHub Actions Workflow and Improve CI Robustness

.github/workflows/release.yml

  • Modified runner machines to 'ubuntu-latest-m' and 'ubuntu-latest-m-2'
    for different jobs.
  • Added skipping of signing during snapshot releases.
  • Introduced new environment variables and paths for reports.
  • Enhanced the test execution script to include junitxml reporting and
    metadata generation.
  • Updated docker compose commands and logging.
  • +68/-17 
    Dockerfile.std
    Optimize Docker Image by Cleaning Additional Directories 

    ci/Dockerfile.std

  • Added cleanup of additional directories to reduce Docker image size.
  • +1/-0     

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

    @ermirizio
    ermirizio requested a review from a team as a code owner April 24, 2024 19:56
    @ermirizio
    ermirizio enabled auto-merge (squash) April 24, 2024 19:56
    @github-actions

    Copy link
    Copy Markdown
    Contributor

    API Changes

    no api changes detected

    @github-actions

    Copy link
    Copy Markdown
    Contributor

    PR Description updated to latest commit (f22abae)

    @github-actions

    Copy link
    Copy Markdown
    Contributor

    PR Review

    ⏱️ Estimated effort to review [1-5]

    4, due to the complexity and breadth of the changes across multiple configuration files and Dockerfile adjustments. The PR involves modifications to the GitHub Actions workflow, environment variables, and Docker image optimizations, which require careful review to ensure they meet the intended enhancements and do not introduce regressions or security issues.

    🧪 Relevant tests

    No

    🔍 Possible issues

    Possible Bug: The conditional logic for skipping signing in the goreleaser command might not correctly handle all edge cases. Specifically, the use of bash conditional expressions directly in the YAML might lead to unexpected behavior if not properly tested.

    Performance Concern: The removal of the GO111MODULE=on environment variable could potentially alter the behavior of Go modules, depending on the default settings of the runner's Go environment. This needs verification to ensure it does not affect the build process.

    🔒 Security concerns

    No

    Code feedback:
    relevant file.github/workflows/release.yml
    suggestion      

    Consider verifying the conditional logic used in the goreleaser command to ensure it behaves as expected across all scenarios. Testing edge cases or simplifying the expression might prevent potential build issues. [important]

    relevant linegoreleaser release --clean -f ${{ matrix.goreleaser }} ${{ !startsWith(github.ref, 'refs/tags/') && ' --snapshot --skip-sign' || '' }}' | tee /tmp/build.sh

    relevant file.github/workflows/release.yml
    suggestion      

    Reevaluate the removal of the GO111MODULE=on setting to ensure it does not negatively impact the Go modules behavior during the build, especially if the runners have different default settings. Restoring this setting might avoid potential issues with module handling. [important]

    relevant line- -e GO111MODULE=on \

    relevant fileci/Dockerfile.std
    suggestion      

    Ensure that the removal of directories and files in the Docker image does not remove necessary dependencies or break any functionality, especially during runtime. Consider adding a test to verify that the runtime environment is fully operational after these deletions. [important]

    relevant line&& rm -rf /usr/include/* /var/cache/apt/archives /var/lib/{apt,dpkg,cache,log} \

    relevant file.github/workflows/release.yml
    suggestion      

    Implement error handling for the new environment variables METADATA_REPORT_PATH and XUNIT_REPORT_PATH to ensure they are set correctly and the paths are accessible. This can prevent runtime errors during the execution of tests and metadata generation. [medium]

    relevant lineMETADATA_REPORT_PATH: /tmp/metadata.toml


    ✨ 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

    Copy link
    Copy Markdown
    Contributor

    PR Code Suggestions

    CategorySuggestions                                                                                                                                                       
    Bug
    Correct the runner version to use the stable latest version of Ubuntu.

    Replace 'ubuntu-latest-m' with 'ubuntu-latest' to ensure the runner uses the latest stable
    version of Ubuntu.

    .github/workflows/release.yml [27]

    -runs-on: ubuntu-latest-m
    +runs-on: ubuntu-latest
     
    Remove syntax error by deleting an unnecessary quote.

    Remove the extra single quote at the end of the command to prevent syntax errors.

    .github/workflows/release.yml [86]

    -goreleaser release --clean -f ${{ matrix.goreleaser }} ${{ !startsWith(github.ref, 'refs/tags/') && ' --snapshot --skip-sign' || '' }}' | tee /tmp/build.sh
    +goreleaser release --clean -f ${{ matrix.goreleaser }} ${{ !startsWith(github.ref, 'refs/tags/') && ' --snapshot --skip-sign' || '' }} | tee /tmp/build.sh
     
    Correct the conditional logic for applying the snapshot flag in the goreleaser command.

    Ensure the conditional logic for the snapshot flag in the goreleaser command is correctly
    formatted to avoid runtime errors.

    .github/workflows/release.yml [86]

    -goreleaser release --clean -f ${{ matrix.goreleaser }} ${{ !startsWith(github.ref, 'refs/tags/') && ' --snapshot --skip-sign' || '' }}' | tee /tmp/build.sh
    +goreleaser release --clean -f ${{ matrix.goreleaser }} ${{ startsWith(github.ref, 'refs/tags/') || ' --snapshot --skip-sign' }} | tee /tmp/build.sh
     
    Best practice
    Prevent potential issues by not removing essential system directories during cleanup.

    Ensure that the cleanup command does not remove essential directories that might be needed
    by other applications or during the Docker build process.

    ci/Dockerfile.std [19]

    -&& rm -rf /usr/include/* /var/cache/apt/archives /var/lib/{apt,dpkg,cache,log} \
    +&& rm -rf /var/cache/apt/archives /var/lib/{cache,log} \
     

    ✨ 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.

    @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

    @ermirizio
    ermirizio merged commit 8ff2add into master Apr 25, 2024
    @ermirizio
    ermirizio deleted the releng/master branch April 25, 2024 02:10
    titpetric pushed a commit that referenced this pull request May 8, 2024
    ## **User description**
    Skip signing when building a snapshot to allow dependabot PRs to build.
    Use larger runners for build and test.
    
    
    ___
    
    ## **Type**
    enhancement, bug_fix
    
    
    ___
    
    ## **Description**
    - Updated GitHub Actions workflow to use modified runner machines for
    better resource allocation.
    - Implemented skipping of signing for snapshot releases to facilitate
    dependabot PRs.
    - Introduced new environment variables `METADATA_REPORT_PATH` and
    `XUNIT_REPORT_PATH` to store reports.
    - Enhanced test execution steps to generate junitxml reports and
    metadata for better CI insights.
    - Optimized Docker image size by cleaning up additional directories in
    `Dockerfile.std`.
    
    
    ___
    
    
    
    ## **Changes walkthrough**
    <table><thead><tr><th></th><th align="left">Relevant
    files</th></tr></thead><tbody><tr><td><strong>Enhancement
    </strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>release.yml</strong><dd><code>Enhance GitHub Actions
    Workflow and Improve CI Robustness</code></dd></summary>
    <hr>
    
    .github/workflows/release.yml
    <li>Modified runner machines to 'ubuntu-latest-m' and
    'ubuntu-latest-m-2' <br>for different jobs.<br> <li> Added skipping of
    signing during snapshot releases.<br> <li> Introduced new environment
    variables and paths for reports.<br> <li> Enhanced the test execution
    script to include junitxml reporting and <br>metadata generation.<br>
    <li> Updated docker compose commands and logging.<br>
    
    
    </details>
        
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6248/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34">+68/-17</a>&nbsp;
    </td>
    </tr>                    
    
    <tr>
      <td>
        <details>
    <summary><strong>Dockerfile.std</strong><dd><code>Optimize Docker Image
    by Cleaning Additional Directories</code>&nbsp; </dd></summary>
    <hr>
    
    ci/Dockerfile.std
    <li>Added cleanup of additional directories to reduce Docker image
    size.<br>
    
    
    </details>
        
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6248/files#diff-a3b3e9cabd877d0bd0fc8f20a9fdca7f44d102547a5fdfcd398ea01637e5dfae">+1/-0</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: Gromit <policy@gromit>
    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