Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TT-13769] Extend plugin compiler test with arm64 cross build #6813

Merged
merged 4 commits into from
Dec 28, 2024

Conversation

titpetric
Copy link
Contributor

@titpetric titpetric commented Dec 27, 2024

PR Type

tests


Description

  • Extended the plugin compiler test script to include a cross-compilation step for the arm64 architecture.
  • Added a Docker command with the GOARCH=arm64 environment variable to enable arm64 builds.
  • Ensures compatibility and testing for arm64 architecture in the plugin compiler.

Changes walkthrough 📝

Relevant files
Tests
test.sh
Add arm64 cross-compilation to plugin compiler test script

ci/tests/plugin-compiler/test.sh

  • Added a cross-compilation step for building the plugin for the arm64
    architecture.
  • Introduced the use of the GOARCH=arm64 environment variable in the
    Docker command.
  • +3/-0     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link
    Contributor

    API Changes

    no api changes detected

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Cross Compilation Validation

    Ensure that the added Docker command for arm64 cross-compilation works as intended and does not introduce any compatibility issues with the existing plugin compiler test process.

    # Cross compile to arm64
    docker run --rm -e GOARCH=arm64 -v $PLUGIN_SOURCE_PATH:/plugin-source $PLUGIN_COMPILER_IMAGE plugin.so
    

    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    General
    Reset the GOARCH environment variable after cross-compilation to prevent unintended side effects

    Ensure that the GOARCH environment variable is explicitly unset or reset to its
    default value after the arm64 cross-compilation step to avoid unintended side
    effects in subsequent commands.

    ci/tests/plugin-compiler/test.sh [26]

     docker run --rm -e GOARCH=arm64 -v $PLUGIN_SOURCE_PATH:/plugin-source $PLUGIN_COMPILER_IMAGE plugin.so
    +unset GOARCH
    Suggestion importance[1-10]: 8

    Why: Resetting the GOARCH environment variable after the arm64 cross-compilation step is a good practice to prevent unintended side effects in subsequent commands. This is particularly important in scripts where environment variables can persist and affect later operations. The suggestion is accurate and directly improves the robustness of the script.

    8

    @titpetric titpetric merged commit f2ff583 into release-5.3.9 Dec 28, 2024
    35 of 38 checks passed
    @titpetric titpetric deleted the test/plugin-compiler-arm64 branch December 28, 2024 08:50
    @titpetric
    Copy link
    Contributor Author

    /release to release-5.3

    Copy link

    tykbot bot commented Dec 28, 2024

    Working on it! Note that it can take a few minutes.

    tykbot bot pushed a commit that referenced this pull request Dec 28, 2024
    ### **PR Type**
    tests
    
    
    ___
    
    ### **Description**
    - Extended the plugin compiler test script to include a
    cross-compilation step for the `arm64` architecture.
    - Added a Docker command with the `GOARCH=arm64` environment variable to
    enable arm64 builds.
    - Ensures compatibility and testing for arm64 architecture in the plugin
    compiler.
    
    
    
    ___
    
    
    
    ### **Changes walkthrough** 📝
    <table><thead><tr><th></th><th align="left">Relevant
    files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>test.sh</strong><dd><code>Add arm64 cross-compilation
    to plugin compiler test script</code></dd></summary>
    <hr>
    
    ci/tests/plugin-compiler/test.sh
    
    <li>Added a cross-compilation step for building the plugin for the
    <code>arm64</code> <br>architecture.<br> <li> Introduced the use of the
    <code>GOARCH=arm64</code> environment variable in the <br>Docker
    command.<br>
    
    
    </details>
    
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6813/files#diff-2a616e71f9e61519f1e7fcd658f73d83a8ae561ef3108da000e7f5d77e38c244">+3/-0</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    </table></td></tr></tr></tbody></table>
    
    ___
    
    > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull
    request to receive relevant information
    
    ---------
    
    Co-authored-by: Tit Petric <[email protected]>
    
    (cherry picked from commit f2ff583)
    Copy link

    tykbot bot commented Dec 28, 2024

    @titpetric Succesfully merged PR

    buger added a commit that referenced this pull request Dec 28, 2024
    …rm64 cross build (#6813)
    
    [TT-13769] Extend plugin compiler test with arm64 cross build (#6813)
    
    ### **PR Type**
    tests
    
    
    ___
    
    ### **Description**
    - Extended the plugin compiler test script to include a
    cross-compilation step for the `arm64` architecture.
    - Added a Docker command with the `GOARCH=arm64` environment variable to
    enable arm64 builds.
    - Ensures compatibility and testing for arm64 architecture in the plugin
    compiler.
    
    
    
    ___
    
    
    
    ### **Changes walkthrough** 📝
    <table><thead><tr><th></th><th align="left">Relevant
    files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>test.sh</strong><dd><code>Add arm64 cross-compilation
    to plugin compiler test script</code></dd></summary>
    <hr>
    
    ci/tests/plugin-compiler/test.sh
    
    <li>Added a cross-compilation step for building the plugin for the
    <code>arm64</code> <br>architecture.<br> <li> Introduced the use of the
    <code>GOARCH=arm64</code> environment variable in the <br>Docker
    command.<br>
    
    
    </details>
    
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6813/files#diff-2a616e71f9e61519f1e7fcd658f73d83a8ae561ef3108da000e7f5d77e38c244">+3/-0</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    </table></td></tr></tr></tbody></table>
    
    ___
    
    > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull
    request to receive relevant information
    
    ---------
    
    Co-authored-by: Tit Petric <[email protected]>
    tykbot bot pushed a commit that referenced this pull request Dec 28, 2024
    …rm64 cross build (#6813)
    
    [TT-13769] Extend plugin compiler test with arm64 cross build (#6813)
    
    ### **PR Type**
    tests
    
    
    ___
    
    ### **Description**
    - Extended the plugin compiler test script to include a
    cross-compilation step for the `arm64` architecture.
    - Added a Docker command with the `GOARCH=arm64` environment variable to
    enable arm64 builds.
    - Ensures compatibility and testing for arm64 architecture in the plugin
    compiler.
    
    
    
    ___
    
    
    
    ### **Changes walkthrough** 📝
    <table><thead><tr><th></th><th align="left">Relevant
    files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><table>
    <tr>
      <td>
        <details>
    <summary><strong>test.sh</strong><dd><code>Add arm64 cross-compilation
    to plugin compiler test script</code></dd></summary>
    <hr>
    
    ci/tests/plugin-compiler/test.sh
    
    <li>Added a cross-compilation step for building the plugin for the
    <code>arm64</code> <br>architecture.<br> <li> Introduced the use of the
    <code>GOARCH=arm64</code> environment variable in the <br>Docker
    command.<br>
    
    
    </details>
    
    
      </td>
    <td><a
    href="https://github.com/TykTechnologies/tyk/pull/6813/files#diff-2a616e71f9e61519f1e7fcd658f73d83a8ae561ef3108da000e7f5d77e38c244">+3/-0</a>&nbsp;
    &nbsp; &nbsp; </td>
    
    </tr>
    </table></td></tr></tr></tbody></table>
    
    ___
    
    > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull
    request to receive relevant information
    
    ---------
    
    Co-authored-by: Tit Petric <[email protected]>
    
    (cherry picked from commit 0486232)
    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.

    3 participants