Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TT-13723] Update to Go 1.23 (#6812)
### **User description** <details open> <summary><a href="https://tyktech.atlassian.net/browse/TT-13723" title="TT-13723" target="_blank">TT-13723</a></summary> <br /> <table> <tr> <th>Summary</th> <td>Update to Go 1.23</td> </tr> <tr> <th>Type</th> <td> <img alt="Story" src="https://tyktech.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10315?size=medium" /> Story </td> </tr> <tr> <th>Status</th> <td>In Dev</td> </tr> <tr> <th>Points</th> <td>N/A</td> </tr> <tr> <th>Labels</th> <td>-</td> </tr> </table> </details> <!-- do not remove this marker as it will break jira-lint's functionality. added_by_jira_lint --> --- https://tyktech.atlassian.net/browse/TT-13723 It seems some tests detect goroutine leaks now. The detected goroutines leaked have been listed in the ignores of a debug2.Record; both goroutine leak tests detect goroutines in background reliably. Both are flaky otherwise, this passes a -count=100 run, with and without -race. ___ ### **PR Type** Enhancement, Tests, Configuration changes ___ ### **Description** - Introduced `debug2.Record` to enhance goroutine state tracking and comparison. - Improved goroutine leak detection tests using `debug2.Record`. - Added unit and benchmark tests for `debug2.Record`. - Updated CI workflows to use Go 1.23.x. - Simplified Dockerfile by switching to Go 1.23-bullseye base image and optimizing build steps. - Updated plugin compiler and release workflows to support Go 1.23. - Enhanced Taskfile to dynamically use the Go version from `go.mod`. - Bumped Go version in `go.mod` to 1.23.4. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Tests</strong></td><td><details><summary>2 files</summary><table> <tr> <td> <details> <summary><strong>gateway_test.go</strong><dd><code>Improved goroutine leak detection in tests.</code> </dd></summary> <hr> gateway/gateway_test.go <li>Enhanced goroutine leak tests with <code>debug2.Record</code> for better <br>reliability.<br> <li> Introduced <code>newRecord</code> helper function to manage ignored goroutines.<br> <li> Updated assertions to use <code>debug2.Record</code> for goroutine count <br>validation.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6812/files#diff-d34c7069ce5e81d45082b19eb3e869ee1a086e185dcd6630e75e3ed0d368b546">+37/-15</a> </td> </tr> <tr> <td> <details> <summary><strong>goroutine_test.go</strong><dd><code>Added unit and benchmark tests for `debug2.Record`.</code> </dd></summary> <hr> internal/debug2/goroutine_test.go <li>Added unit tests for <code>debug2.Record</code> to validate goroutine tracking.<br> <li> Included benchmark tests for performance evaluation.<br> <li> Verified goroutine cleanup using <code>Since</code> method.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6812/files#diff-763a0643c49a4bbfa70fbf12088045a74be7fc5f4789d09f14a9298d0b65c226">+103/-0</a> </td> </tr> </table></details></td></tr><tr><td><strong>Enhancement</strong></td><td><details><summary>4 files</summary><table> <tr> <td> <details> <summary><strong>goroutine.go</strong><dd><code>Introduced `debug2.Record` for goroutine state tracking.</code> </dd></summary> <hr> internal/debug2/goroutine.go <li>Added <code>debug2.Record</code> to capture and compare goroutine states.<br> <li> Implemented methods for parsing, counting, and filtering goroutines.<br> <li> Introduced functionality to ignore specific goroutines during <br>comparison.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6812/files#diff-c6edbd39849f1acdcae221ef5e8b6a5886d644ec719064cf051be79f8c9377f8">+124/-0</a> </td> </tr> <tr> <td> <details> <summary><strong>Dockerfile</strong><dd><code>Simplified Dockerfile with Go 1.23 base image.</code> </dd></summary> <hr> Dockerfile <li>Simplified Dockerfile by using Go 1.23-bullseye base image.<br> <li> Removed redundant Python installation steps.<br> <li> Optimized build process with caching for Go modules.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6812/files#diff-dd2c0eb6ea5cfc6c4bd4eac30934e2d5746747af48fef6da689e85b752f39557">+11/-51</a> </td> </tr> <tr> <td> <details> <summary><strong>Taskfile.yml</strong><dd><code>Enhanced Taskfile to support dynamic Go version.</code> </dd></summary> <hr> Taskfile.yml - Added dynamic Go version argument for Docker builds. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6812/files#diff-cd2d359855d0301ce190f1ec3b4c572ea690c83747f6df61c9340720e3d2425e">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>go.mod</strong><dd><code>Bumped Go version in module to 1.23.4.</code> </dd></summary> <hr> go.mod - Updated Go version requirement to 1.23.4. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6812/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6">+1/-1</a> </td> </tr> </table></details></td></tr><tr><td><strong>Configuration changes</strong></td><td><details><summary>4 files</summary><table> <tr> <td> <details> <summary><strong>ci-tests.yml</strong><dd><code>Updated CI workflow to use Go 1.23.x.</code> </dd></summary> <hr> .github/workflows/ci-tests.yml - Updated Go version in CI matrix to 1.23.x. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6812/files#diff-03609cb60b0c6e92fb771eb8787d6722b8c31ca4c03eabc788e147acd8c6fb43">+1/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>plugin-compiler-build.yml</strong><dd><code>Updated plugin compiler workflow for Go 1.23.</code> </dd></summary> <hr> .github/workflows/plugin-compiler-build.yml <li>Updated base image to use Go 1.23-bullseye.<br> <li> Fixed <code>BASE_IMAGE</code> argument in Docker build steps.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6812/files#diff-f3a95a900eb0ac23af6314e9cdea29fa16af0a9bcb61793a83a32ff13d4c4e79">+3/-3</a> </td> </tr> <tr> <td> <details> <summary><strong>release.yml</strong><dd><code>Updated release workflow to support Go 1.23.</code> </dd></summary> <hr> .github/workflows/release.yml <li>Updated Go version in release workflow to 1.23-bullseye.<br> <li> Adjusted Docker build conditions for the new Go version.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6812/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34">+11/-11</a> </td> </tr> <tr> <td> <details> <summary><strong>Dockerfile</strong><dd><code>Updated plugin compiler Dockerfile for Go 1.23.</code> </dd></summary> <hr> ci/images/plugin-compiler/Dockerfile - Updated base image to Go 1.23-bullseye. </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6812/files#diff-0ded1ed63ca128bd2d22721b0bc19dc85e440e4922164f465ac647917321971e">+1/-1</a> </td> </tr> </table></details></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]>
- Loading branch information