NO-ISSUE: Fix miscellaneous issues in dev.py tooling#681
Conversation
These are issues that were reported by the AI code review tool but were not addressed before merging the commit that added `dev.py`. The changes are: In `dev/setup.py`, use `re.escape()` on the artifact name before interpolating it into the regex pattern that searches the checksums file. Without this, dots in filenames like `golangci-lint-2.12.2- linux-amd64.tar.gz` act as regex wildcards and could match unintended lines. In `dev/setup.py`, add an explicit `return False` at the end of `is_installed` for the code path where `shutil.which` returns `None`. Previously the function fell through to an implicit `None` return, violating its `-> bool` annotation. In `AGENTS.md`, document the security posture of the binary download verification performed by the `setup` command, including the two-stage SHA-256 check, the failure behaviour, and the trust boundary. Assisted-by: Cursor Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
|
@jhernand: This pull request explicitly references no jira issue. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jhernand The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: osac-project/coderabbit/.coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR hardens tool verification logic in the development setup pipeline by escaping regex patterns in checksum parsing to mitigate injection risk, adding explicit return-value handling in version detection, and documenting the two-stage SHA-256 verification process. ChangesTool Verification Improvements
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 10 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (10 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@jhernand: The following tests failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
|
PR needs rebase. 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. |
Summary
dev/setup.pyartifact name lookup so dots infilenames like
golangci-lint-2.12.2-linux-amd64.tar.gzare matched literallyrather than as wildcards.
return Falsetois_installedwhen the tool is not found onPATH, satisfying the-> boolannotation on all code paths.AGENTS.md(two-stageSHA-256 verification, failure behaviour, trust boundary).
Test plan
uv run dev.py setupstill downloads and installs golangci-lint correctly.python -c "import dev.setup"succeeds without errors.Summary by CodeRabbit
Documentation
Bug Fixes