Skip to content

[SYSE-353 master] Fix tyk-ci fetch mechanism#6213

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

[SYSE-353 master] Fix tyk-ci fetch mechanism#6213
ermirizio merged 1 commit into
masterfrom
releng/master

Conversation

@ermirizio

@ermirizio ermirizio commented Apr 8, 2024

Copy link
Copy Markdown
Collaborator

User description

Tyk-ci fetch mechanism needs to be fixed in order to fetch the .tgz built file from the tyk-ci release process instead of the entire repository contents


Type

bug_fix


Description

  • Updated GitHub Actions workflow to correctly fetch and extract the ci-env.tgz artifact from the tyk-ci repository.
  • This change fixes the issue where the wrong file was being downloaded due to a hardcoded version number.

Changes walkthrough

Relevant files
Bug fix
release.yml
Update GitHub Actions to Fetch Correct `tyk-ci` Artifact 

.github/workflows/release.yml

  • Updated the command to download the ci-env.tgz file from the tyk-ci
    repository instead of the previously hardcoded version v1.2.3.
  • Ensures that the correct artifact, ci-env.tgz, is fetched and
    extracted.
  • +1/-1     

    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 8, 2024 16:47
    @ermirizio
    ermirizio enabled auto-merge (squash) April 8, 2024 16:47
    @github-actions

    github-actions Bot commented Apr 8, 2024

    Copy link
    Copy Markdown
    Contributor

    PR Description updated to latest commit (8d863c5)

    @github-actions

    github-actions Bot commented Apr 8, 2024

    Copy link
    Copy Markdown
    Contributor

    PR Review

    ⏱️ Estimated effort to review [1-5]

    2, because the PR involves a specific change in the GitHub Actions workflow file to fix the artifact fetching mechanism. The change is straightforward and focuses on a single functionality, making it relatively easy to review. However, understanding the context and ensuring the new command works as expected requires some domain knowledge about GitHub Actions and the gh CLI tool.

    🧪 Relevant tests

    No

    🔍 Possible issues

    Possible Bug: If the tyk-ci repository has multiple releases or artifacts, the command might fetch an unintended version of ci-env.tgz. The lack of version specification could lead to inconsistent builds if not carefully managed.

    🔒 Security concerns

    No

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

    Consider specifying a version or a pattern for the ci-env.tgz artifact to ensure that the correct version is fetched. This can prevent potential issues with fetching an unintended version of the artifact. You can use the -p flag with a pattern that includes version numbers if they are available. For example: -p 'ci-env-*.tgz' [important]

    relevant linegh release download --repo github.com/TykTechnologies/tyk-ci -p 'ci-env.tgz' -O env.tgz


    ✨ 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 Apr 8, 2024

    Copy link
    Copy Markdown
    Contributor

    API Changes

    no api changes detected

    @github-actions

    github-actions Bot commented Apr 8, 2024

    Copy link
    Copy Markdown
    Contributor

    PR Code Suggestions

    CategorySuggestions                                                                                                                                                       
    Enhancement
    Add error handling for the gh release download command.

    Consider adding error handling for the gh release download command to ensure the workflow
    doesn't fail silently if the download fails. This can be achieved by using the || operator
    followed by a command to handle the error, such as echoing an error message and exiting
    with a non-zero status.

    .github/workflows/release.yml [226]

    -gh release download --repo github.com/TykTechnologies/tyk-ci -p 'ci-env.tgz' -O env.tgz
    +gh release download --repo github.com/TykTechnologies/tyk-ci -p 'ci-env.tgz' -O env.tgz || { echo "Error downloading release"; exit 1; }
     

    ✨ 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

    sonarqubecloud Bot commented Apr 8, 2024

    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 3023bd5 into master Apr 8, 2024
    @ermirizio
    ermirizio deleted the releng/master branch April 8, 2024 17:27
    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