Skip to content

fix(#223): add platform detection to gitleaks install in post-scripts - #225

Merged
waynesun09 merged 1 commit into
mainfrom
agent/223-platform-detection-gitleaks
Jul 19, 2026
Merged

fix(#223): add platform detection to gitleaks install in post-scripts#225
waynesun09 merged 1 commit into
mainfrom
agent/223-platform-detection-gitleaks

Conversation

@fullsend-ai-coder

@fullsend-ai-coder fullsend-ai-coder Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds platform detection and shared gitleaks install library for post-scripts.

Changes

  • New shared lib scripts/lib/gitleaks-install.lib.sh — consolidates gitleaks_sha256(), resolve_platform(), verify_checksum(), and install_gitleaks() into a single source, eliminating duplication across post-code.src.sh and post-fix.src.sh
  • Platform-aware gitleaks download — detects OS (Linux/Darwin) and architecture (x64/arm64) via uname, replacing the hardcoded linux_x64 binary URL
  • Fail-fast install — uses explicit if ! ... || ! ... chain with mktemp instead of && chain with fixed /tmp/gitleaks.tar.gz
  • SHA-256 verification — supports both sha256sum (Linux) and shasum (macOS)
  • Bash 3.2 compatibility — uses case statements (not declare -A), while-read loops (not mapfile), for macOS system bash support
  • New test file scripts/gitleaks-install-test.sh — 26 tests covering platform detection (8 OS/arch combos), checksum lookup, verify_checksum, version drift guard, and function drift guard
  • Bundled script verificationpost-code-test.sh and post-fix-test.sh assert install_gitleaks is present in bundled output

Platforms supported

Platform Checksum verified
linux_x64 Yes (official 8.30.1 release)
linux_arm64 Yes
darwin_x64 Yes
darwin_arm64 Yes

Dependencies

Depends on #38 (script bundling infrastructure). PR diff will shrink once #38 merges into main.


Closes #223

@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner July 16, 2026 17:41

@waynesun09 waynesun09 left a comment

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.

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-based gitleaks_sha256() function; replaced mapfile with while-read loops; hardened install chain from && to explicit if ! ... || ! ... 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.

@waynesun09
waynesun09 force-pushed the agent/223-platform-detection-gitleaks branch from 8cdacc5 to 3470e14 Compare July 16, 2026 22:43
@waynesun09

Copy link
Copy Markdown
Member

CI note: script-test fails because this PR depends on #38 (script bundling infrastructure). Our branch includes #38's commits, but CI merges against main which doesn't have the bundler yet — make check-bundle fails on the merge commit.

Once #38 merges into main, this PR's CI will pass. The check-bundle and script-test failures are expected until then.

…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>
@waynesun09
waynesun09 force-pushed the agent/223-platform-detection-gitleaks branch from 3470e14 to a41af5c Compare July 19, 2026 13:30
@waynesun09
waynesun09 added this pull request to the merge queue Jul 19, 2026
Merged via the queue into main with commit fc7b83e Jul 19, 2026
10 checks passed
@waynesun09
waynesun09 deleted the agent/223-platform-detection-gitleaks branch July 19, 2026 13:39
@fullsend-ai-retro

fullsend-ai-retro Bot commented Jul 19, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 1:41 PM UTC · Completed 1:57 PM UTC
Commit: a41af5c · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #225 — Platform detection for gitleaks install

Timeline

  1. Jul 16 17:27Issue #223 created by waynesun09. Extremely detailed: exact SHA-256 checksums for 4 platforms, implementation approach (declare -A associative arrays), test requirements, and cross-references to upstream scan-secrets code.
  2. Jul 16 17:28–17:31Triage agent runs (~4 min). Produces summary faithfully repeating the declare -A recommendation without flagging bash 3.2 incompatibility.
  3. Jul 16 17:32–17:42Code agent runs (~10 min). Creates PR fix(#223): add platform detection to gitleaks install in post-scripts #225 with initial implementation using declare -A and mapfile as the issue suggested.
  4. Jul 16 17:42 — PR created. Fullsend dispatch runs on pull_request_target but skips all steps after stage determination — no automated review agent is triggered.
  5. Jul 16 17:42–22:19 (~4.5 hours) — Human (waynesun09) manages 3 rounds of ad-hoc review squads:
    • Round 1: Replaced declare -A (bash 4+) with case-based function; replaced mapfile with while-read loops; hardened install chain; rewrote test suite
    • Round 2: Fixed shellcheck CI (SC2317, SC2123); fixed bash 3.2 $() lexer issues
    • Round 3: All clean, no findings (2/3 review agents failed due to API rate limits)
  6. Jul 16 22:19 — PR approved by waynesun09.
  7. Jul 19 13:31 — Rebased onto main after dependency PR feat(harness): report categorized post-script failures on issue/PR #38 merged.
  8. Jul 19 13:39 — Merged via merge queue.

Assessment

What 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 declare -A and mapfile (bash 4+ features) because the issue explicitly recommended them. However, the issue's stated goal was macOS support, which requires bash 3.2 compatibility. The code agent didn't catch this contradiction, leading to 2 rounds of human-driven fixes.

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

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.

fix: add platform detection to gitleaks install in post-code.sh and post-fix.sh

1 participant