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

[DX-1786] Minor restructure to Go plugin workflow section #5865

Merged
merged 3 commits into from
Jan 7, 2025

Conversation

andyo-tyk
Copy link
Contributor

@andyo-tyk andyo-tyk commented Jan 6, 2025

Preview Link

https://deploy-preview-5865--tyk-docs.netlify.app/docs/nightly/product-stack/tyk-gateway/advanced-configurations/plugins/golang/go-development-flow/

Description

Removed an accidental duplication at the top of the file. Minor restructure to the page to encourage use of Plugin Compiler and provide some sort of introduction rather than diving straight in. No content added.


PR Type

Documentation


Description

  • Restructured the Go plugin development documentation for clarity.

  • Introduced a new section on the Tyk Plugin Compiler.

  • Removed redundant and duplicated content for better readability.

  • Updated the document's date metadata to reflect changes.


Changes walkthrough 📝

Relevant files
Documentation
go-development-flow.md
Enhanced Go plugin development documentation structure     

tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/golang/go-development-flow.md

  • Removed duplicated content and redundant sections.
  • Added a new section introducing the Tyk Plugin Compiler.
  • Updated metadata and improved document structure.
  • Clarified plugin compilation requirements and recommendations.
  • +12/-29 

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

    Copy link
    Contributor

    github-actions bot commented Jan 6, 2025

    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

    Documentation Clarity

    Ensure that the restructuring and new sections added, such as the Tyk Plugin Compiler, are clear and provide sufficient guidance for users. Validate that the links and references are accurate and functional.

    ### Tyk Plugin Compiler
    
    We provide the [Tyk Plugin Compiler](https://tyk.io/docs/product-stack/tyk-gateway/advanced-configurations/plugins/golang/go-plugin-compiler/) docker image, which we *strongly recommend* is used to build plugins compatible with the official Gateway releases. That tool provides the cross compilation toolchain, Go version used to build the release, ensures that compatible flags are used when compiling plugins (such as `-trimpath`, `CC`, `CGO_ENABLED`, `GOOS`, `GOARCH`) and also works around known Go issues such as:
    
    - https://github.com/golang/go/issues/19004
    - https://www.reddit.com/r/golang/comments/qxghjv/plugin_already_loaded_when_a_plugin_is_loaded/
    
    
    ## Setting up your environment
    
    It's important to understand the need for plugins to be compiled using exactly the same environment and build flags as the Gateway. To simplify this and minimise the risk of compatibility problems, we recommend the use of [Go workspaces](https://go.dev/blog/get-familiar-with-workspaces), to provide a consistent environment.
    
    To develop plugins without using the Tyk Plugin Compiler, you'll need:
    Consistency in Build Instructions

    Verify that the instructions for compiling plugins, including the use of the Tyk Plugin Compiler and Go workspaces, are consistent and do not conflict with other parts of the documentation.

    We provide the [Tyk Plugin Compiler](https://tyk.io/docs/product-stack/tyk-gateway/advanced-configurations/plugins/golang/go-plugin-compiler/) docker image, which we *strongly recommend* is used to build plugins compatible with the official Gateway releases. That tool provides the cross compilation toolchain, Go version used to build the release, ensures that compatible flags are used when compiling plugins (such as `-trimpath`, `CC`, `CGO_ENABLED`, `GOOS`, `GOARCH`) and also works around known Go issues such as:
    
    - https://github.com/golang/go/issues/19004
    - https://www.reddit.com/r/golang/comments/qxghjv/plugin_already_loaded_when_a_plugin_is_loaded/
    
    
    ## Setting up your environment
    
    It's important to understand the need for plugins to be compiled using exactly the same environment and build flags as the Gateway. To simplify this and minimise the risk of compatibility problems, we recommend the use of [Go workspaces](https://go.dev/blog/get-familiar-with-workspaces), to provide a consistent environment.
    
    To develop plugins without using the Tyk Plugin Compiler, you'll need:
    
    - Go (matching the version used in the Gateway, which you can determine using `go.mod`).
    - Git to check out Tyk Gateway source code.

    Copy link
    Contributor

    github-actions bot commented Jan 6, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    General
    Emphasize the critical importance of using the Tyk Plugin Compiler to prevent compatibility problems

    Clarify that the Tyk Plugin Compiler is strongly recommended to avoid compatibility
    issues, as the current phrasing might not emphasize the importance sufficiently.

    tyk-docs/content/product-stack/tyk-gateway/advanced-configurations/plugins/golang/go-development-flow.md [28]

    -We provide the [Tyk Plugin Compiler](https://tyk.io/docs/product-stack/tyk-gateway/advanced-configurations/plugins/golang/go-plugin-compiler/) docker image, which we *strongly recommend* is used to build plugins compatible with the official Gateway releases.
    +We provide the [Tyk Plugin Compiler](https://tyk.io/docs/product-stack/tyk-gateway/advanced-configurations/plugins/golang/go-plugin-compiler/) docker image, which is essential for building plugins compatible with the official Gateway releases to avoid compatibility issues.
    Suggestion importance[1-10]: 7

    Why: The suggestion improves the clarity and emphasis on the importance of using the Tyk Plugin Compiler, which is critical for avoiding compatibility issues. However, the original phrasing already conveys a strong recommendation, so the impact of this change is moderate.

    7

    @andyo-tyk andyo-tyk changed the title Minor restructure [DX-1786] Minor restructure to Go plugin workflow section Jan 6, 2025
    Copy link

    netlify bot commented Jan 6, 2025

    PS. Pls add /docs/nightly to the end of url

    Name Link
    🔨 Latest commit 951d5ef
    🔍 Latest deploy log https://app.netlify.com/sites/tyk-docs/deploys/677d21fbaf8ba80007f9463d
    😎 Deploy Preview https://deploy-preview-5865--tyk-docs.netlify.app
    📱 Preview on mobile
    Toggle QR Code...

    QR Code

    Use your smartphone camera to open QR code link.

    To edit notification comments on pull requests, go to your Netlify site configuration.

    @sharadregoti sharadregoti merged commit 847a9c2 into master Jan 7, 2025
    9 checks passed
    @sharadregoti sharadregoti deleted the custom-plugin-workflow-edit branch January 7, 2025 12:57
    @sharadregoti
    Copy link
    Contributor

    /release to release-5.7

    Copy link

    tykbot bot commented Jan 7, 2025

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

    Copy link

    tykbot bot commented Jan 7, 2025

    @sharadregoti Succesfully merged PR

    buger added a commit that referenced this pull request Jan 7, 2025
    …flow section (#5865)
    
    [DX-1786] Minor restructure to Go plugin workflow section (#5865)
    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