Skip to content

fix: relax run tool - #151

Closed
naveena456 wants to merge 6 commits into
eclipse-score:mainfrom
bgsw-contrib:feature/relax-run-tool
Closed

naveena456 wants to merge 6 commits into
eclipse-score:mainfrom
bgsw-contrib:feature/relax-run-tool

Conversation

@naveena456

@naveena456 naveena456 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Enhanced the script to avoid unnecessary Bazel execution when a matching local tool is available.

  • Detect and validate the locally installed tool version.
  • Use the local tool directly when the version matches exactly.
  • Added --strict to always use the Bazel-based tool.
  • Fall back to Bazel if the local tool is unavailable or the version does not match.

Closes #148

@naveena456 naveena456 changed the title Feature/relax run tool relax run tool Sep 11, 2026
@naveena456 naveena456 changed the title relax run tool fix: relax run tool Sep 11, 2026
@naveena456 naveena456 mentioned this pull request Sep 11, 2026
Comment thread tools/run-tool Outdated
Comment thread tools/run-tool
Comment thread tools/run-tool
@lurtz

lurtz commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

@naveena456 Without passing CI checks, I cannot merge this PR

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Consumer installations cannot access the version catalog, and the new test fails to exercise host behavior inside containerized CI.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds local pinned-tool reuse to avoid unnecessary Bazel execution.

Changes:

  • Detects matching local tool versions with Bazel fallback.
  • Adds --strict mode.
  • Adds tests, documentation, and CI coverage.
File summaries
File Description
tools/run-tool Implements version-aware selection and strict mode.
tools/tests/run_tool_test.sh Tests selection and fallback paths.
tools/README.md Documents the new behavior.
tools/BUILD.bazel Registers the test target.
.github/workflows/ci.yaml Runs the new test in CI.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 5
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/BUILD.bazel Outdated
Comment thread tools/run-tool Outdated
Comment thread tools/run-tool Outdated
Comment thread tools/tests/run_tool_test.sh
Comment thread tools/run-tool
@naveena456
naveena456 requested a review from lurtz September 17, 2026 13:59
@naveena456 naveena456 self-assigned this Sep 17, 2026
Comment thread tools/run-tool
Comment on lines +91 to +102
actionlint) printf '%s\n' "1.7.7" ;;
apm) printf '%s\n' "0.27.0" ;;
bazelisk) printf '%s\n' "1.27.0" ;;
buildifier) printf '%s\n' "8.2.1" ;;
opencode) printf '%s\n' "1.18.15" ;;
pre-commit) printf '%s\n' "4.5.1" ;;
ruff) printf '%s\n' "0.11.13" ;;
shellcheck) printf '%s\n' "0.10.0" ;;
starpls) printf '%s\n' "0.1.22" ;;
uv) printf '%s\n' "0.10.4" ;;
uvx) printf '%s\n' "0.10.4" ;;
yamlfmt) printf '%s\n' "0.17.0" ;;

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.

IMHO this is a road block. This means the script cannot be copied and used across many devcontainer updates, but instead it will need constant maintenance at user repos.

bazel knows what version to use, but we explicitly want to avoid calling it. Would it be possible to generate mini lockfile from bazel which only contains the versions of these tools? Preferably in a format we can already parse.

Then bazel needs to be called once to create the mini lockfile. The tool versions are sourced from this lockfile which should be way faster. run-tool could then track the the modification time of both the mini lockfile and MODULE.bazel.lock. If MODULE.bazel.lock has a newer time, the mini lockfile needs to be regenerated.

If you think this is too complicated, I am also open to ignore the tool version and just call the tool, when it is present on the host. I am not very thrilled by how much complexity was added already with this PR and previous ones to abstract tool execution via bazel and host.

@AlexanderLanin What do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

solution makes sense I guess, for the problem as stated. However I did not anticipate that we would end up with tool version lists in every user repo. No good ideas at the moment. Maybe ignoring versions is the next best thing. Lets sleep on it.

@naveena456

Copy link
Copy Markdown
Contributor Author

This PR is no longer applicable due to a scope change during the review process. Some implementation complexity was identified during the review and has already been addressed in #154 , which supersedes this PR.

@naveena456

Copy link
Copy Markdown
Contributor Author

stale

@naveena456 naveena456 closed this Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

relax run-tool

4 participants