Port automation scripts from JavaScript to Go#3691
Port automation scripts from JavaScript to Go#3691Ankitsinghsisodya wants to merge 4 commits intoknative:mainfrom
Conversation
- Introduced new Makefile targets: `update-quarkus-platform`, `update-springboot-platform`, and `update-ca-bundle` to automate the process of updating respective platform versions in templates. - Updated GitHub Actions workflows for `update-ca-bundle`, `update-quarkus-platform`, and `update-springboot-platform` to utilize Go scripts instead of Node.js for executing updates. - Added new Go scripts for handling the update logic for CA bundle, Quarkus platform, and Spring Boot platform, including PR creation and version checks. - Implemented shared GitHub client functionality for PR management and version retrieval. This change enhances the automation of platform updates and streamlines the CI/CD process for dependency management.
…ment - Updated Makefile targets to streamline the execution of platform updates for Quarkus, Spring Boot, and CA bundle. - Replaced Node.js scripts with Go scripts for better performance and maintainability in GitHub Actions workflows. - Enhanced the update logic for CA bundle, Quarkus platform, and Spring Boot platform, including automated PR creation and version checks. - Removed outdated JavaScript files related to platform updates, consolidating functionality within Go. These changes improve the automation process for dependency management and enhance the CI/CD workflow.
- Pass GITHUB_TOKEN to the Spring Boot update step so GitHub API calls are authenticated (unauthenticated rate limit is 60 req/hr, shared across all Actions runners, causing intermittent 403s on the 4-hour cron) - Add a git-diff check after each Go tool + make generate step; skip smoke tests and the create-pull-request action when no files changed, restoring the early-exit behaviour the original JS scripts had
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Ankitsinghsisodya The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @Ankitsinghsisodya. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
There was a problem hiding this comment.
Pull request overview
This PR ports the repository’s scheduled hack/ automation from Node.js scripts to Go commands, removing the Node runtime/dependency from CI while preserving the update workflows for embedded templates.
Changes:
- Removed the three Node.js automation scripts under
hack/(CA bundle, Quarkus platform, Spring Boot platform). - Added equivalent Go commands under
hack/cmd/plus a small shared package for HTTP + command execution. - Updated the GitHub Actions workflows (and added Makefile targets) to invoke the new Go commands and create PRs via
peter-evans/create-pull-request@v7, gated on actual file changes.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| Makefile | Adds local targets to run the new Go-based update commands. |
| hack/update-springboot-platform.js | Removes the old Node.js Spring Boot platform updater. |
| hack/update-quarkus-platform.js | Removes the old Node.js Quarkus platform updater. |
| hack/update-ca-bundle.js | Removes the old Node.js CA bundle updater. |
| hack/cmd/update-springboot-platform/main.go | Go implementation to update Spring Boot + compatible Spring Cloud versions in template POMs. |
| hack/cmd/update-quarkus-platform/main.go | Go implementation to update Quarkus platform version in template POMs. |
| hack/cmd/update-ca-bundle/main.go | Go implementation to run the CA bundle update Make target. |
| hack/cmd/shared/github.go | Introduces shared HTTP client + command runner used by the new tools. |
| .github/workflows/update-springboot-platform.yaml | Switches workflow from Node to Go, adds diff-gating, smoke tests, and PR creation via create-pull-request. |
| .github/workflows/update-quarkus-platform.yaml | Same migration for Quarkus platform workflow. |
| .github/workflows/update-ca-bundle.yaml | Same migration for CA bundle workflow, with diff-gated PR creation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3691 +/- ##
==========================================
- Coverage 56.90% 56.82% -0.09%
==========================================
Files 181 181
Lines 20933 20933
==========================================
- Hits 11912 11895 -17
- Misses 7811 7832 +21
+ Partials 1210 1206 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
PTAL @gauron99 |
- Switch all `go run .../main.go` invocations to `go run ./pkg` in Makefile and the three CI workflows so additional files added to a command package are automatically included - Rename hack/cmd/shared/github.go → shared.go; the file contains a generic HTTP client and command runner, not GitHub-specific helpers
|
@matejvasek @gauron99 can you re-run the failed ci. I think it is flaky and not related to the changes I have done. |
Changes
hack/update-ca-bundle.js,hack/update-quarkus-platform.js, andhack/update-springboot-platform.js, eliminating the Node.js runtime dependency from CIhack/cmd/for each removed script:update-ca-bundle,update-quarkus-platform,update-springboot-platformhack/cmd/sharedpackage with a shared HTTP client and command runner used across the new programsupdate-ca-bundle.yaml,update-quarkus-platform.yaml, andupdate-springboot-platform.yamlworkflows to use the new Go programs viago run, delegate PR creation topeter-evans/create-pull-request@v7, and gate smoke tests and PR creation on actual file changesupdate-quarkus-platform,update-springboot-platform, andupdate-ca-bundleMakefile targets for local invocation/kind cleanup
Fixes #2815
Release Note
Docs