Skip ripgrep apt install when rg already exists - #51915
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.27.44 | ||
| - name: Install ripgrep | ||
| run: | | ||
| if command -v rg >/dev/null 2>&1; then |
There was a problem hiding this comment.
@copilot refactor into a shell script in actions/setup/sh + add tests
There was a problem hiding this comment.
Addressed in ddbc80e: the generated step now calls actions/setup/sh/install_ripgrep.sh, with shell tests covering both the existing-rg and missing-rg paths wired into make test-scripts.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✅ Test Quality Sentinel completed test quality analysis.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. No ADR enforcement needed: PR does not have the 'implementation' label and has ≤100 new lines of code in business logic directories (53 additions detected).
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Ponytail Reviewer completed successfully! Reviewed PR #51915 for over-engineering (ponytail-review). No findings: the shell script extraction and test file follow existing repo conventions (per-script _test.sh files like install_awf_binary_test.sh), the Go change is a single small function with no speculative abstraction, and the change directly implements the reviewer's own prior request to refactor into a script + tests. Lean already. Ship.
|
|
✅ PR Code Quality Reviewer completed the code quality review. Warning Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs for details. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.individual.githubcopilot.com"See Network Configuration for more information.
|
There was a problem hiding this comment.
Pull request overview
Adds conditional ripgrep provisioning to generated Copilot jobs, avoiding package-manager work when rg already exists.
Changes:
- Adds and tests a shared ripgrep installer.
- Emits the installer before Copilot CLI setup.
- Refreshes generated workflows, golden fixtures, and release metadata.
Show a summary per file
| File | Description |
|---|---|
actions/setup/sh/install_ripgrep.sh |
Adds conditional installation logic. |
actions/setup/sh/install_ripgrep_test.sh |
Tests present and missing rg paths. |
pkg/workflow/copilot_engine_installation.go |
Generates the ripgrep setup step. |
pkg/workflow/copilot_engine_test.go |
Updates installation-step assertions. |
Makefile |
Runs the new shell tests. |
.changeset/patch-copilot-ripgrep-install-probe.md |
Adds the patch release note. |
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/with-imports.golden |
Refreshes generated output. |
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/smoke-copilot.golden |
Refreshes generated output. |
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/playwright-cli-mode.golden |
Refreshes generated output. |
pkg/workflow/testdata/TestWasmGolden_CompileFixtures/basic-copilot.golden |
Refreshes generated output. |
pkg/workflow/testdata/TestWasmGolden_AllEngines/copilot.golden |
Refreshes generated output. |
.github/workflows/*.lock.yml |
Refreshes affected compiled workflows with the setup step. |
Review details
Tip
Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 203/203 changed files
- Comments generated: 1
- Review effort level: Balanced
| echo "ripgrep not found; installing with apt-get..." | ||
| sudo apt-get update -qq | ||
| sudo apt-get install -y -qq ripgrep |
There was a problem hiding this comment.
The install_ripgrep.sh script correctly short-circuits with command -v rg before falling back to apt-get, and all lock files are consistently updated. No blocking issues found.
🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 22.5 AIC · ⌖ 6.19 AIC · ⊞ 5.4K
🧪 Test Quality SentinelPR: #51915 — Skip ripgrep apt install when rg already exists Result: No Test Changes DetectedThis PR contains 203 changed files (1065 additions, 18 deletions), primarily:
The file All pre-fetch signal files were empty:
No violations detected.
Score: N/A — No test functions added or modified. Test Quality Sentinel skipped scoring.
|
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs — the implementation is correct and well-tested. Approving.
Positive Highlights
- ✅ Probe-first pattern (
command -v rg) correctly skips apt on pre-baked runners - ✅ Shell script extracted from inline YAML — cleaner, reusable, and version-controlled
- ✅ Both paths covered by
install_ripgrep_test.sh - ✅ Go unit tests assert the ripgrep step is first and uses the script path
- ✅ Lock files properly recompiled
Minor Observation
install_ripgrep.sh falls back to apt-get (Linux-only). If macOS runner support is ever needed, a uname -s branch would be required — not blocking for current usage.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 75.9 AIC · ⌖ 6.45 AIC · ⊞ 7.1K
Comment /matt to run again
|
🎉 This pull request is included in a new release. Release: |
Copilot-generated jobs were doing package-manager work even on runners that already provide
rg. This keeps minimal-runner compatibility while avoiding unnecessary apt updates and privileged installs on pre-baked images.Install ripgrepstep before Copilot CLI setup.rgfirst and only installripgrepwhen missing.Generated outputs
Release note