fix(#223): add platform detection to gitleaks install in post-scripts - #225
Conversation
waynesun09
left a comment
There was a problem hiding this comment.
Review squad (round 3) — all CI green, no surviving findings.
Review coverage:
- claude-researcher: completed — NO findings at MEDIUM or above. All 4 SHA256 checksums independently verified against official gitleaks 8.30.1 release checksums. Platform mappings confirmed for all GitHub runner types. All code-comment claims verified true.
- claude-coder, grok-review-agent: failed (API rate limits) — not counted.
Prior rounds fixed:
- Round 1: replaced
declare -A(bash 4+) with case-basedgitleaks_sha256()function; replacedmapfilewith while-read loops; hardened install chain from&&to explicitif ! ... || ! ...with mktemp + cleanup; rewrote test suite to extract production functions instead of hand-copying - Round 2: fixed shellcheck CI (SC2317, SC2123 directives); fixed bash 3.2
$()lexer issues with balanced case patterns and apostrophe-free comments
CI status: commit-lint, DCO, detect, script-test, test — all pass.
Test coverage: 87/87 pass under bash 3.2.57 and bash 5.x; post-fix-test.sh clean.
8cdacc5 to
3470e14
Compare
|
CI note: Once #38 merges into |
…tion Move gitleaks_sha256(), resolve_platform(), verify_checksum(), and a new install_gitleaks() wrapper into scripts/lib/gitleaks-install.lib.sh. Both post-code.src.sh and post-fix.src.sh source the shared lib instead of duplicating the functions or hardcoding linux_x64. Changes: - Add scripts/lib/gitleaks-install.lib.sh with platform-aware download, SHA-256 verification (sha256sum or shasum), and fail-fast install using mktemp instead of fixed /tmp paths - Replace hardcoded linux_x64 + &&-chain gitleaks install in both post-code.src.sh and post-fix.src.sh with install_gitleaks() call - Replace bash 4+ mapfile usage with while-read loops for bash 3.2 compatibility - Add scripts/gitleaks-install-test.sh with platform detection, checksum lookup, verify_checksum, version drift, and function drift tests - Add bundled-script-has-gitleaks-install checks to post-code-test.sh and post-fix-test.sh - Register gitleaks-install-test.sh in Makefile script-test target - Regenerate bundled scripts via make script-build Platforms supported: linux_x64, linux_arm64, darwin_x64, darwin_arm64. All checksums verified against official gitleaks 8.30.1 release. Assisted-by: Claude (implementation) Signed-off-by: Wayne Sun <gsun@redhat.com>
3470e14 to
a41af5c
Compare
|
🤖 Finished Retro · ✅ Success · Started 1:41 PM UTC · Completed 1:57 PM UTC |
Retro: PR #225 — Platform detection for gitleaks installTimeline
AssessmentWhat went well: The code agent delivered a structurally sound implementation in ~10 minutes — shared library extraction, platform detection, test suite, bundled-script verification. The final merged code is high quality (bash 3.2 compatible, 4-platform support, 87/87 tests passing). The very detailed issue specification enabled fast initial delivery. What needed rework: The code agent used Review dispatch gap: Both fullsend dispatch runs (29520837344 on PR creation, 29539172777 on PR review) completed successfully but skipped all dispatch steps after stage determination. No automated review agent ran on this PR. The human compensated by running ad-hoc review squads, but this added ~4.5 hours of human effort. Existing issue evidence
Proposals filed
|
Summary
Adds platform detection and shared gitleaks install library for post-scripts.
Changes
scripts/lib/gitleaks-install.lib.sh— consolidatesgitleaks_sha256(),resolve_platform(),verify_checksum(), andinstall_gitleaks()into a single source, eliminating duplication acrosspost-code.src.shandpost-fix.src.shuname, replacing the hardcodedlinux_x64binary URLif ! ... || ! ...chain withmktempinstead of&&chain with fixed/tmp/gitleaks.tar.gzsha256sum(Linux) andshasum(macOS)declare -A), while-read loops (notmapfile), for macOS system bash supportscripts/gitleaks-install-test.sh— 26 tests covering platform detection (8 OS/arch combos), checksum lookup, verify_checksum, version drift guard, and function drift guardpost-code-test.shandpost-fix-test.shassertinstall_gitleaksis present in bundled outputPlatforms supported
Dependencies
Depends on #38 (script bundling infrastructure). PR diff will shrink once #38 merges into main.
Closes #223