Skip to content

Commit ebbe211

Browse files
committed
fix: httpie failing due to missing binary
1 parent 18fd029 commit ebbe211

File tree

2 files changed

+57
-18
lines changed

2 files changed

+57
-18
lines changed

.github/workflows/validate-skills.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Check Out Repository
12-
uses: actions/checkout@v4
12+
uses: actions/checkout@v6
1313

1414
- name: Set Up pnpm
15-
uses: pnpm/action-setup@v4
15+
uses: pnpm/action-setup@v6
1616
with:
1717
run_install: false
1818

1919
- name: Set Up Python
20-
uses: actions/setup-python@v5
20+
uses: actions/setup-python@v6
2121
with:
2222
python-version: "3.11"
2323

2424
- name: Set Up Node
25-
uses: actions/setup-node@v4
25+
uses: actions/setup-node@v6
2626
with:
2727
node-version: "20"
2828
cache: "pnpm"
@@ -31,11 +31,11 @@ jobs:
3131
- name: Install Node Dependencies
3232
run: pnpm install --frozen-lockfile
3333

34-
- name: Install ripgrep
35-
# Required by skills/ripgrep/scripts/probe_ripgrep.py, which shells
36-
# out to `rg --version` during validation. ubuntu-latest does not
37-
# ship ripgrep preinstalled.
38-
run: sudo apt-get update && sudo apt-get install -y ripgrep
34+
- name: Install Validation Tools
35+
# Required by skill probe suites that shell out to external CLIs:
36+
# - skills/ripgrep/scripts/probe_ripgrep.py -> `rg --version`
37+
# - skills/httpie/scripts/probe_httpie.py -> `http`, `https`, `httpie`
38+
run: sudo apt-get update && sudo apt-get install -y ripgrep httpie
3939

4040
- name: Validate Skills
4141
shell: bash

skills/httpie/scripts/probe_httpie.py

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,24 @@ def run_command(
2929
if env:
3030
merged_env.update(env)
3131

32-
proc = subprocess.run(
33-
args,
34-
env=merged_env,
35-
capture_output=True,
36-
text=True,
37-
encoding="utf-8",
38-
errors="replace",
39-
check=False,
40-
)
32+
try:
33+
proc = subprocess.run(
34+
args,
35+
env=merged_env,
36+
capture_output=True,
37+
text=True,
38+
encoding="utf-8",
39+
errors="replace",
40+
check=False,
41+
)
42+
except OSError as exc:
43+
return {
44+
"args": args,
45+
"returncode": 127,
46+
"stdout": "",
47+
"stderr": str(exc),
48+
"ok": False,
49+
}
4150
return {
4251
"args": args,
4352
"returncode": proc.returncode,
@@ -81,6 +90,36 @@ def run_suite(*, keep_temp: bool = False) -> dict[str, object]:
8190
payload_path.write_text('{"name":"JP","active":true}\n', encoding="utf-8")
8291

8392
try:
93+
required_commands = ["http", "https", "httpie"]
94+
missing_commands = [command for command in required_commands if shutil.which(command) is None]
95+
if missing_commands:
96+
detail = (
97+
"Missing required HTTPie CLI commands on PATH: "
98+
+ ", ".join(missing_commands)
99+
+ ". Install HTTPie before running the probe suite."
100+
)
101+
checks.append(
102+
{
103+
"name": "dependencies",
104+
"passed": False,
105+
"command": [],
106+
"returncode": 127,
107+
"detail": detail,
108+
"stdout": "",
109+
"stderr": detail,
110+
}
111+
)
112+
return {
113+
"passed": False,
114+
"summary": {
115+
"checks_total": 1,
116+
"checks_passed": 0,
117+
"checks_skipped": 0,
118+
},
119+
"checks": checks,
120+
"tempdir": str(temp_root) if keep_temp else None,
121+
}
122+
84123
version = run_command(["http", "--version"], env=env)
85124
checks.append(
86125
check(

0 commit comments

Comments
 (0)