Skip to content

feat(tools): add automated tool updater - #12359

Merged
DariuszPorowski merged 11 commits into
mainfrom
fp/whole-takin-lime
Jul 29, 2026
Merged

feat(tools): add automated tool updater#12359
DariuszPorowski merged 11 commits into
mainfrom
fp/whole-takin-lime

Conversation

@DariuszPorowski

Copy link
Copy Markdown
Member

Description

This pull request adds an automated updater for Radius's external CLI tool versions and SHA-256 checksums.

The change:

  • Adds build/tools.yaml as the canonical tool manifest and commits the generated build/tools.generated.mk Make include.
  • Adds the tool-updater Go command with manifest validation, release-source checks, checksum refreshes, and Terraform version synchronization.
  • Adds the scheduled .github/workflows/update-tools.yaml workflow, which opens or updates a PR using the Dependabot-manager GitHub App credentials.
  • Preserves existing make install-<tool> targets and uses a stable bin/tool-updater path to avoid Windows temporary-executable elevation blocks.
  • Documents the manifest schema and supported values in internal/tooling/README.md.

Type of change

  • This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional).

Fixes: #issue_number

Contributor checklist

  • An overview of proposed schema changes is included in a linked GitHub issue.
    • Yes
    • Not applicable
  • A design document is added or updated under eng/design-notes/ in this repository, if new APIs are being introduced.
    • Yes
    • Not applicable
  • The design document has been reviewed and approved by Radius maintainers/approvers.
    • Yes
    • Not applicable
  • A PR for resource-types-contrib is created, if resource types or recipes are affected by the changes in this PR.
    • Yes
    • Not applicable
  • A PR for dashboard is created, if the Radius Dashboard is affected by the changes in this PR.
    • Yes
    • Not applicable
  • A PR for the documentation repository is created, if the changes in this PR affect the documentation or any user facing updates are made.
    • Yes
    • Not applicable

Validation

  • go test ./internal/tooling ./cmd/tool-updater
  • go vet ./internal/tooling ./cmd/tool-updater
  • GitHub Actions actionlint
  • Markdown lint and table formatting

Copilot AI review requested due to automatic review settings July 9, 2026 20:06
@DariuszPorowski
DariuszPorowski requested review from a team as code owners July 9, 2026 20:06
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
actions/actions/checkout 9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 🟢 6.9
Details
CheckScoreReason
Binary-Artifacts🟢 10no binaries found in the repo
Code-Review🟢 10all changesets reviewed
Maintained🟢 1025 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Fuzzing⚠️ 0project is not fuzzed
Pinned-Dependencies⚠️ 3dependency not pinned by hash detected -- score normalized to 3
License🟢 10license file detected
Packaging⚠️ -1packaging workflow not detected
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
SAST🟢 10SAST tool is run on all commits
actions/actions/create-github-app-token bcd2ba49218906704ab6c1aa796996da409d3eb1 🟢 6.1
Details
CheckScoreReason
Maintained🟢 1012 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 2Found 3/14 approved changesets -- score normalized to 2
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Packaging⚠️ -1packaging workflow not detected
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Fuzzing⚠️ 0project is not fuzzed
Pinned-Dependencies🟢 7dependency not pinned by hash detected -- score normalized to 7
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
SAST🟢 6SAST tool is not run on all commits -- score normalized to 6
Branch-Protection🟢 6branch protection is not maximal on development and all release branches
actions/actions/setup-go 924ae3a1cded613372ab5595356fb5720e22ba16 🟢 5.5
Details
CheckScoreReason
Code-Review🟢 10all changesets reviewed
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Maintained🟢 45 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 4
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
SAST🟢 10SAST tool is run on all commits
actions/raven-actions/bot-details ee8966a9ff6e7e42cbfc4a56b4ddb60a9d1b40a6 🟢 4.4
Details
CheckScoreReason
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Binary-Artifacts🟢 10no binaries found in the repo
Code-Review⚠️ 2Found 2/7 approved changesets -- score normalized to 2
Security-Policy🟢 10security policy file detected
Maintained⚠️ 34 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0

Scanned Files

  • .github/workflows/update-tools.yaml

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a repository-wide mechanism to centrally pin, validate, and automatically refresh external CLI tool versions and SHA-256 checksums via a YAML manifest and a new Go-based updater, then wires it into Make and GitHub Actions.

Changes:

  • Adds build/tools.yaml as the canonical tool manifest and commits the generated build/tools.generated.mk include consumed by existing make install-<tool> targets.
  • Introduces cmd/tool-updater plus internal/tooling helpers to validate the manifest, check release sources, and refresh checksums/versions (including syncing Terraform consumer files).
  • Adds a scheduled update-tools GitHub Actions workflow to run make update-tools and open/update a PR using a GitHub App token.

Reviewed changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/recipes/terraform/version.go Updates comments to reflect tools manifest as the source of truth for Terraform pinning.
pkg/recipes/terraform/version_test.go Updates test comments to match the new compatibility-file/updater flow.
Makefile Reorders includes so tool metadata is available before build logic consumes it.
internal/tooling/updater.go Implements version/checksum refresh logic and HTTP retrieval with retry/backoff.
internal/tooling/updater_test.go Adds tests for version bumping, checksum refresh, and shared checksum-file caching.
internal/tooling/README.md Documents updater usage and the tools manifest schema/behavior.
internal/tooling/manifest.go Adds manifest schema, validation, template expansion, and file sync utilities.
internal/tooling/manifest_test.go Adds repository-manifest parsing and helper-function tests.
docs/contributing/contributing-code/contributing-code-shell-and-make/README.md Documents how contributors should manage external CLI pins via make update-tools.
cmd/tool-updater/main.go Adds CLI entrypoint for manifest update and Make include regeneration.
build/tools.yaml Adds the canonical tool manifest with sources, templates, assets, and checksums.
build/tools.mk Switches to consuming generated metadata and adds make update-tools + generator rules.
build/tools.generated.mk Adds committed generated Make metadata for tool versions and platform checksums.
build/scripts/install-yq.sh Updates comments to reflect tool data source as the manifest/generated include.
build/scripts/install-terraform.sh Updates comments to reflect tool data source as the manifest/generated include.
build/scripts/install-stern.sh Updates comments to reflect tool data source as the manifest/generated include.
build/scripts/install-shellcheck.sh Updates comments to reflect tool data source as the manifest/generated include.
build/scripts/install-oras.sh Updates comments to reflect tool data source as the manifest/generated include.
build/scripts/install-kubectl.sh Updates comments to reflect tool data source as the manifest/generated include.
build/scripts/install-kind.sh Updates comments to reflect tool data source as the manifest/generated include.
build/scripts/install-k3d.sh Updates comments to reflect tool data source as the manifest/generated include.
build/scripts/install-jq.sh Updates comments to reflect tool data source as the manifest/generated include.
build/scripts/install-helm.sh Updates comments to reflect tool data source as the manifest/generated include.
build/scripts/install-golangci-lint.sh Updates comments to reflect tool data source as the manifest/generated include.
build/scripts/install-dlv.sh Updates comments to reflect tool data source as the manifest/generated include.
build/scripts/install-dapr.sh Updates comments to reflect tool data source as the manifest/generated include.
build/scripts/install-bicep.sh Updates comments to reflect tool data source as the manifest/generated include.
build/generate.mk Removes unused CONTROLLER_TOOLS_VERSION variable.
build/build.mk Updates Terraform version wiring comments to reflect tool-metadata include loading.
.github/workflows/validate-installers.yaml Updates workflow comments to point at build/tools.yaml as pin source.
.github/workflows/validate-bicep.yaml Updates workflow comments to point at build/tools.yaml as pin source.
.github/workflows/update-tools.yaml Adds scheduled/manual workflow to run updater and open/update a PR via GitHub App token.
.github/workflows/unit-tests.yaml Updates workflow comments to point at build/tools.yaml as pin source.
.github/workflows/lint.yaml Updates workflow comments to point at build/tools.yaml as pin source.
.github/workflows/functional-test-noncloud.yaml Updates workflow comments to point at build/tools.yaml as pin source.
.github/workflows/functional-test-cloud.yaml Updates workflow comments to point at build/tools.yaml as pin source.
.github/workflows/copilot-setup-steps.yml Expands path triggers and updates comments to reference the manifest-based pins.
.github/workflows/build.yaml Updates workflow comments to point at build/tools.yaml as pin source.
.github/actions/create-kind-cluster/action.yaml Updates composite action comment to reference manifest-based pinning.
.devcontainer/post-create.sh Updates devcontainer post-create comments to reference manifest-based pinning.

Comment thread internal/tooling/README.md Outdated
Comment thread internal/tooling/manifest_test.go Outdated
Comment thread internal/tooling/manifest.go
Comment thread internal/tooling/manifest.go
@DariuszPorowski
DariuszPorowski force-pushed the fp/whole-takin-lime branch 3 times, most recently from 51f876b to 7d6e18b Compare July 9, 2026 20:36
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Unit Tests

    2 files  ±0    456 suites  ±0   7m 33s ⏱️ +9s
6 129 tests ±0  6 127 ✅ ±0  2 💤 ±0  0 ❌ ±0 
7 355 runs  ±0  7 353 ✅ ±0  2 💤 ±0  0 ❌ ±0 

Results for commit d371c1f. ± Comparison against base commit 63ab7c8.

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.05%. Comparing base (63ab7c8) to head (d371c1f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12359      +/-   ##
==========================================
- Coverage   54.06%   54.05%   -0.02%     
==========================================
  Files         765      765              
  Lines       50830    50830              
==========================================
- Hits        27480    27474       -6     
- Misses      20761    20764       +3     
- Partials     2589     2592       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DariuszPorowski
DariuszPorowski force-pushed the fp/whole-takin-lime branch 3 times, most recently from fe5d5af to 3896335 Compare July 9, 2026 23:05
@DariuszPorowski
DariuszPorowski enabled auto-merge July 9, 2026 23:17
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Functional Tests - corerp-noncloud

180 tests   178 ✅  1h 21m 42s ⏱️
  3 suites    2 💤
  1 files      0 ❌

Results for commit 0ab6a6d.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Functional Tests - upgrade-noncloud

3 tests   3 ✅  3m 35s ⏱️
1 suites  0 💤
1 files    0 ❌

Results for commit 0ab6a6d.

♻️ This comment has been updated with latest results.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 40 out of 40 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/update-tools.yaml Outdated
@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

Functional Tests - ucp-cloud

4 tests   4 ✅  33s ⏱️
1 suites  0 💤
1 files    0 ❌

Results for commit 90597c2.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

Functional Tests - corerp-cloud

30 tests  ±0   29 ✅ ±0   22m 18s ⏱️ +13s
 2 suites ±0    1 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit c637934. ± Comparison against base commit 08781d7.

♻️ This comment has been updated with latest results.

- Implemented a new updater for managing tool versions and checksums in the manifest.
- Added functionality to retrieve the latest version and checksum from various sources.
- Created tests to ensure the updater correctly refreshes versions and checksums.
- Introduced a new HTTP client for making requests to version sources.
- Updated the Terraform version handling to synchronize with the manifest.
- Added tests to verify the correctness of version and checksum updates.
- Ensured that comments and documentation reflect the new functionality and structure.

Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
…retrieval

Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
…on tests

Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
…s-pr.sh

Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 29, 2026 18:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 44 out of 44 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

internal/tooling/manifest_test.go:29

  • TestLoadRepositoryManifest verifies build/tools.generated.mk matches build/tools.yaml, but it doesn’t assert that the Terraform compatibility file (.terraform-version) stays in sync with the manifest’s terraform tool version. Since other code/docs treat build/tools.yaml as canonical, add a check here to prevent drift between the manifest and .terraform-version.
    .github/workflows/copilot-setup-steps.yml:181
  • The Terraform setup comment still says the version defaults to .terraform-version, but make now sources TERRAFORM_VERSION from the generated tool metadata include (synced from build/tools.yaml). Update the comment to avoid implying that workflows read .terraform-version directly.
      - name: Install Terraform
        # Version defaults to .terraform-version (overridable via TERRAFORM_VERSION)
        # and is compiled into the rad binary; checksums pinned in build/tools.yaml.
        run: make install-terraform

…ksums while preserving formatting

feat(tests): add test for updateManifestYAML to ensure only changed values are rewritten
fix(updater): improve error handling in writeResponse for copy operation
fix(script): implement safer git push with push_branch function

Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 29, 2026 19:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 44 out of 44 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (3)

build/tools.mk:23

  • TOOL_UPDATER_GOOS/TOOL_UPDATER_GOARCH/TOOL_UPDATER_BINARY are defined with immediate (:=) expansion, which runs go env while parsing the Makefile even for unrelated targets (e.g. make help). Use recursive (=) assignment so go env is only executed when the updater variables are actually needed.
    internal/tooling/README.md:93
  • The updater rewrites versions/checksums in-place and currently requires the existing YAML scalar values to be plain (unquoted) scalars (see applyScalarEdits error path). Document this constraint so contributors don’t accidentally quote version/checksum fields and break make update-tools.
    .github/scripts/update-tools-pr.sh:66
  • git commit will fail with exit code 1 when the script is run with no staged changes (e.g. a local rerun). Add a cheap guard after git add -A to exit cleanly when there’s nothing to commit.
git checkout -B "${PR_BRANCH}"
git add -A
git commit --signoff -m "${PR_TITLE}"
gh auth setup-git
push_branch

Comment thread build/tools.yaml
Comment thread .github/scripts/update-tools-pr_test.sh
… to global.terraform.version

Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
…ocking on signing prompt

Signed-off-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 29, 2026 21:13
@radius-functional-tests

radius-functional-tests Bot commented Jul 29, 2026

Copy link
Copy Markdown

Radius functional test overview

🔍 Go to test action run

Click here to see the test run details
Name Value
Repository radius-project/radius
Commit ref d371c1f
Unique ID funca4a2a8b7b9
Image tag pr-funca4a2a8b7b9
  • Dapr: 1.14.4
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-funca4a2a8b7b9
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-funca4a2a8b7b9
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-funca4a2a8b7b9
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funca4a2a8b7b9
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funca4a2a8b7b9
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 45 out of 45 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (3)

internal/tooling/manifest_test.go:50

  • This test mutates the real build/tools.yaml by string-replacing "update: false". That makes the test fragile: if the repository manifest no longer contains that exact substring (or uses a different formatting), the test fails for reasons unrelated to unknown-field handling. Use a small inline YAML fixture with an intentionally misspelled field instead of depending on the repo manifest contents.
    internal/tooling/manifest_test.go:360
  • This test assumes manifest.Tools[0] is a checksum-bearing tool with a non-nil Platforms map. If the repository manifest is reordered (or starts with a checksumSource.type: none tool), this will panic or stop testing the intended behavior. Pick the first checksum-bearing tool explicitly (or use a minimal fixture YAML) so the test remains stable as tools.yaml evolves.
    .github/workflows/copilot-setup-steps.yml:180
  • This comment is now misleading: TERRAFORM_VERSION no longer defaults from .terraform-version at Make parse time (it comes from build/tools.generated.mk, generated from build/tools.yaml). .terraform-version is now a compatibility file kept in sync by the updater. Please update the comment to match the new source of truth.
        # Version defaults to .terraform-version (overridable via TERRAFORM_VERSION)
        # and is compiled into the rad binary; checksums pinned in build/tools.yaml.

@DariuszPorowski
DariuszPorowski added this pull request to the merge queue Jul 29, 2026
Merged via the queue into main with commit 9282081 Jul 29, 2026
82 checks passed
@DariuszPorowski
DariuszPorowski deleted the fp/whole-takin-lime branch July 29, 2026 22:10
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.

Put tool and framework versions in one place

4 participants