Skip to content

fix(local): require ripgrep for the forbidden-content scans - #1103

Draft
Walternater wants to merge 1 commit into
Tencent:mainfrom
Walternater:fix/validate-requires-ripgrep
Draft

Walternater wants to merge 1 commit into
Tencent:mainfrom
Walternater:fix/validate-requires-ripgrep

Conversation

@Walternater

Copy link
Copy Markdown

What changed

The validate and release-local workflows never installed ripgrep, and local/scripts/validate.sh reads a missing rg (exit 127) as "no match" inside if rg .... All three forbidden-content scans skipped silently while the job printed Validation passed. — the CI run quoted in #1044 shows rg: command not found three times followed by success.

Closes #1044:

  • validate.sh now fails loudly (exit 1) when rg is not on PATH, instead of silently skipping the scans.
  • The validate job installs ripgrep; release-local gets it inside the existing "Install validation dependencies" step (that job calls the same script, so without the install the new loud failure would break releases).

Scope

  • Classic and Portable developer validation (validate.yml → scripts/validate.sh)
  • Release validation path (release-local.yml runs the same script)

Verification

  • Negative control: PATH without rg → ripgrep (rg) is required; the forbidden-content scans cannot run., exit 1 (previously silent success).
  • Positive control: full bash local/scripts/validate.sh on macOS with ripgrep 14.1.1 → all six steps pass.
  • bash -n on the script; both workflow files parse as YAML.
  • Not run locally: smoke-install.sh / e2e.sh / test-observability.sh — unchanged scripts; this PR's CI runs them on both cells.

Merge order: after #909

apt publishes rg 15.1.0 for resolute (what ubuntu-latest resolves to) and 14.1.0 for noble (ubuntu-24.04) per Launchpad published sources. With ripgrep actually present, the 15.x glob handling self-matches scripts/validate.sh in scan 1 — the known bug #909 fixes (noble's 14.1 is unaffected; verified locally on 14.1.1). Until #909 merges, this PR's validate (3.12) cell will show that known self-match failure, which is the sequencing dependency stated in #1044. Keeping this as a draft so it can be flipped to ready once #909 lands.

🤖 Generated with Claude Code

The validate and release-local workflows never installed ripgrep, and
validate.sh reads a missing rg (exit 127) as "no match" inside if-rg,
so every forbidden-content scan skipped silently while the job printed
"Validation passed." (issue Tencent#1044).

- validate.sh now fails loudly when rg is not on PATH.
- Both workflows install ripgrep before running validate.sh.

Merge after Tencent#909: apt ships rg 15.1.0 on resolute (ubuntu-latest) and
14.1.0 on noble; with rg present, 15.x glob handling self-matches
scripts/validate.sh in scan 1 (the known bug Tencent#909 fixes, noble
unaffected). Until Tencent#909 merges, validate (3.12) shows that known
failure on this branch.

Co-Authored-By: Claude Code <noreply@anthropic.com>
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.

[Bug]: ci(local): validate 的 forbidden-content 检查从未运行 —— CI 缺 ripgrep,三道扫描被静默跳过

1 participant