fix(github): strip OpenGrep platform suffixes#10166
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors platform token detection by centralizing OS and architecture tokens into a new platform_tokens module, replacing duplicate definitions and adding corresponding tests. Feedback suggests optimizing the binary name cleaning loop to avoid unnecessary heap allocations and using strip_prefix instead of manual slicing to prevent potential UTF-8 boundary panics.
Greptile SummaryThis PR extracts platform/version token classification into a new shared
Confidence Score: 5/5Safe to merge — the refactoring is a clean extraction with no regressions and the new tokens fix the targeted OpenGrep binary naming issue. All tokens from the original is_platform_or_version_token match block are accounted for in the new module; the three new OS tokens (osx, manylinux, musllinux) are additive and narrowly scoped; early-exit contains() guards are purely a performance optimisation that cannot produce false strips because the actual removal still uses exact rfind patterns. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix(github): strip OpenGrep platform suf..." | Re-trigger Greptile |
ebf8723 to
62617b5
Compare
Summary
osx,manylinux, andmusllinuxthrough the shared install helperNotes
.certmetadata handling in fix(github): handle x86 release assets as x64 fallback #10103.Tests
cargo fmt --allgit diff --checkcargo test test_clean_binary_name(passed before the final token-scope split; rerun hit an unrelated compile error in untouchedsrc/backend/aqua.rs)cargo test test_platform_or_version_tokens_include_linux_variants(passed before the final token-scope split)cargo test test_preferred_name_handles_tar_and_split_platform_tokens(passed before the final token-scope split)