From 9e9bf204e71341c91112da1ffef3c1adae84401d Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 27 Aug 2026 17:27:21 +0000 Subject: [PATCH] feat(heart): name a required workflow that has no file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit config/repos.yaml declares required_workflows per group and ci_status.rollup() scores a repo over exactly those. A required workflow with no runs is not scored as a failure — it just never satisfies all_green, so the repo sits at {"conclusion": "", "status": "in_progress"} forever: able to go red, never able to go green, and never CI-clean to the readiness gate. On the dashboard that is indistinguishable from a run in flight, which is why the state survives unnoticed until a human spots the asymmetry. heart/checks/required_workflow_drift.py makes it nameable. The runs payload ci_status already fetches cannot separate the two causes of "no runs" — no workflow file, versus a file that has never run on main. Only the workflow list can, so that is the one call added: GET /repos/{owner}/{repo}/actions/workflows, one per repo in a group that gates (17 today), in parallel, the same cheap metadata read ci_status.sh already makes twice per repo. Matching is on each workflow's `name` field, never its filename: `name` is what ci_status matches runs against, so a filename-based check could pass while the roll-up still starves. Classified YELLOW and as a configuration finding rather than red CI — the repo's code is fine, its gate is not wired up, and red would misattribute the fault. Mirrors manifest_drift's shape (own sidecar, readiness caution, available:false when it cannot run). Degradation is honest: no gh (the web/mobile session) skips the check, and a per-repo fetch error becomes a stale "unverified" reason rather than an implied pass — otherwise a missing gate could hide behind a 403. Names no instance fact, so it needs no tenant-firewall allowlist entry; verified with repos_sync.py --only "tenant firewall (organ code)", including a canary that confirms the gate does scan the new files. 15 new tests; full suite 656 passed. Refs PyAutoMind draft/feature/pyautoheart/required_workflow_file_drift.md Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01KmWbYJw4cJJnt4eK6NoZjL --- heart/checks/required_workflow_drift.py | 227 ++++++++++++++++++++++ heart/readiness.py | 34 ++++ heart/state.py | 1 + heart/tick.sh | 6 + tests/test_readiness.py | 51 +++++ tests/test_required_workflow_drift.py | 247 ++++++++++++++++++++++++ 6 files changed, 566 insertions(+) create mode 100644 heart/checks/required_workflow_drift.py create mode 100644 tests/test_required_workflow_drift.py diff --git a/heart/checks/required_workflow_drift.py b/heart/checks/required_workflow_drift.py new file mode 100644 index 00000000..c621d2f2 --- /dev/null +++ b/heart/checks/required_workflow_drift.py @@ -0,0 +1,227 @@ +"""heart/checks/required_workflow_drift.py — required workflows with no file. + +``config/repos.yaml`` declares ``required_workflows`` per group, and +``heart/checks/ci_status.py``'s ``rollup()`` scores a repo over exactly those +workflows. A required workflow that has **no runs at all** is not scored as a +failure — it simply never satisfies ``all_green``, so the repo sits at +``{"conclusion": "", "status": "in_progress"}`` forever: able to go red, never +able to go green, and never CI-clean to the readiness gate. + +On the dashboard that is indistinguishable from *a run is in flight*, which is +why it survives: one workspace repo sat in it from whenever it joined its group +until 2026-08-24, when a human noticed the asymmetry (a *red* required workflow +still reported failure correctly, so the repo could go red but never green). +This module makes that state nameable. + +**What it can and cannot see.** The runs payload ``ci_status`` already fetches +cannot distinguish the two causes of "no runs" — a workflow file that does not +exist, and a workflow file that exists but has never run on ``main``. Only the +workflow *list* (``GET /repos/{owner}/{repo}/actions/workflows``) can, so that +is the one extra call this check makes: one per repo in a group that has +``required_workflows``, in parallel, the same cheap metadata read (and the same +shape) as the two ``ci_status.sh`` already makes per repo. + +Matching is on each workflow's ``name`` field, never its filename. ``name`` is +what ``ci_status`` matches runs against, so a filename-based check could pass +while the roll-up still starves. + +Classification: a missing file is **YELLOW**, and a *configuration* finding +rather than red CI — the repo's code is fine, its gate is not wired up; colouring +it red misattributes the fault. Same monitoring-not-gating stance as +``manifest_drift``, whose shape this mirrors. + +Degradation is honest, never a hollow green: no ``gh`` (the web/mobile session) +or a failed fetch reports ``available: false`` / a per-repo ``error``, the same +distinction ``ci_status.sh`` draws between "no runs" and "the query broke". + +The result lands at ``$HEART_STATE_DIR/required_workflow_drift.json``. +""" + +from __future__ import annotations + +import os +import shutil +import subprocess +import sys +from concurrent.futures import ThreadPoolExecutor +from pathlib import Path +from typing import Any + +HEART_HOME = Path(__file__).resolve().parents[2] +CONFIG_PATH = HEART_HOME / "config" / "repos.yaml" +HEART_STATE_DIR = Path( + os.environ.get("HEART_STATE_DIR") or Path.home() / ".pyauto-heart" +) + +# Seconds any single workflow-list fetch may take. The repos are scanned in +# parallel, so the worst case this adds to a tick is one timeout rather than one +# per repo — but it is capped anyway so a stalled network can never eat the +# <30s tick budget. Same reasoning as ci_status.sh's ls-remote bound. +FETCH_TIMEOUT_S = int(os.environ.get("HEART_WORKFLOW_LIST_TIMEOUT", "10")) + +# Parallel fetches. Matches the order of the repo count (17 today across the +# four groups that gate), so in practice every repo is in flight at once. +MAX_WORKERS = 8 + + +def polled_repos(config_path: Path | str = CONFIG_PATH) -> list[dict[str, str]]: + """Return ``{owner, name, group}`` for every repo in ``repos:``. + + Groups are returned as declared; the caller decides which of them gate. + """ + import yaml + + cfg = yaml.safe_load(Path(config_path).read_text()) or {} + out: list[dict[str, str]] = [] + for group, entries in (cfg.get("repos") or {}).items(): + for repo in entries or []: + if isinstance(repo, dict) and repo.get("name") and repo.get("owner"): + out.append( + { + "owner": str(repo["owner"]), + "name": str(repo["name"]), + "group": str(group), + } + ) + return out + + +def gating_repos(config_path: Path | str = CONFIG_PATH) -> list[dict[str, Any]]: + """Polled repos whose group declares ``required_workflows``, with that list. + + A group with no required workflows is *advisory* — ``rollup()`` reports its + newest run rather than gating on a set — so there is nothing here to be + missing, and nothing to fetch for it. + """ + sys.path.insert(0, str(HEART_HOME)) + from heart.checks.ci_status import load_required_workflows + + required = load_required_workflows(config_path) + rows = [] + for repo in polled_repos(config_path): + want = required.get(repo["group"]) + if want: + rows.append({**repo, "required": list(want)}) + return rows + + +def fetch_workflow_names(owner_name: str) -> tuple[list[str] | None, str]: + """Return this repo's workflow ``name`` fields, or ``(None, error)``. + + ``per_page=100`` rather than ``--paginate``: no PyAuto repo is near 100 + workflow files, and an unpaginated single call keeps this one cheap metadata + read per repo — the cost argument the whole check rests on. + """ + proc = subprocess.run( + [ + "gh", + "api", + f"repos/{owner_name}/actions/workflows?per_page=100", + "--jq", + ".workflows[].name", + ], + capture_output=True, + text=True, + timeout=FETCH_TIMEOUT_S, + ) + if proc.returncode != 0: + # Collapse gh's stderr to one line so it fits the sidecar and the log. + err = " ".join((proc.stderr or "").split())[:200] + return None, err or f"gh api exited {proc.returncode}" + return [line for line in proc.stdout.splitlines() if line.strip()], "" + + +def check_one(repo: dict[str, Any]) -> dict[str, Any]: + """Resolve one repo's required-vs-present workflow names.""" + owner_name = f"{repo['owner']}/{repo['name']}" + try: + names, error = fetch_workflow_names(owner_name) + except subprocess.TimeoutExpired: + names, error = None, f"timed out after {FETCH_TIMEOUT_S}s" + except OSError as exc: # gh vanished between the probe and the call + names, error = None, str(exc)[:200] + + row: dict[str, Any] = { + "name": repo["name"], + "group": repo["group"], + "required": list(repo["required"]), + "error": error, + } + if names is None: + row["present"] = [] + row["missing"] = [] + return row + present = sorted(set(names)) + row["present"] = present + row["missing"] = [wf for wf in repo["required"] if wf not in set(names)] + return row + + +def run(config_path: Path | str = CONFIG_PATH) -> dict[str, Any]: + """Check every gating repo, write the sidecar, return the result.""" + if shutil.which("gh") is None: + result: dict[str, Any] = { + "available": False, + "reason": "gh not installed (web/mobile session)", + "repos": [], + "missing_count": 0, + } + else: + repos = gating_repos(config_path) + with ThreadPoolExecutor(max_workers=MAX_WORKERS) as pool: + rows = list(pool.map(check_one, repos)) + rows.sort(key=lambda r: (r["group"], r["name"])) + result = { + "available": True, + "checked": len(rows), + "repos": rows, + "missing_count": sum(len(r["missing"]) for r in rows), + "error_count": sum(1 for r in rows if r["error"]), + } + + sys.path.insert(0, str(HEART_HOME)) + from heart import state + + state.atomic_write_json( + HEART_STATE_DIR / "required_workflow_drift.json", result + ) + return result + + +def main(argv: list[str]) -> int: + result = run() + sys.path.insert(0, str(HEART_HOME)) + from heart.heart_color import ( + c_info, + c_meta, + c_ok, + c_warn, + glyph_ok, + glyph_warn, + ) + + label = c_info("required_workflow_drift") + if not result["available"]: + print(f"{glyph_warn()} {label} {c_meta('skipped: ' + str(result.get('reason', '')))}") + return 0 + + missing = result["missing_count"] + checked = result["checked"] + errors = result["error_count"] + suffix = c_meta(f"({checked} gating repos" + (f", {errors} unreadable)" if errors else ")")) + if missing: + worst = [ + f"{r['name']}: {', '.join(r['missing'])}" + for r in result["repos"] + if r["missing"] + ] + print(f"{glyph_warn()} {label} {c_warn(f'{missing} required workflow(s) with no file')} {suffix}") + for line in worst: + print(f" {c_meta(line)}") + else: + print(f"{glyph_ok()} {label} {c_ok('every required workflow has a file')} {suffix}") + return 0 + + +if __name__ == "__main__": + sys.exit(main(sys.argv)) diff --git a/heart/readiness.py b/heart/readiness.py index 6a2abded..25fe9fc3 100644 --- a/heart/readiness.py +++ b/heart/readiness.py @@ -133,6 +133,8 @@ "skew_pypi_bad": (25, 50), "skew_pypi_floor_yanked": (8, 24), "skew_pypi_unknown": (10, 30), + "required_workflow_drift": (20, 40), + "required_workflow_unknown": (10, 30), "install_not_ready": (40, 40), "install_non_release": (10, 10), "install_stale": (10, 10), @@ -461,6 +463,38 @@ def scope_local(msg: str, key: str) -> None: ) hit("manifest_drift") + # --- required-workflow drift (YELLOW — a gate that is not wired up) --- + # + # A required workflow with no file never satisfies ci_status.rollup()'s + # all_green, so the repo reads `in_progress` forever — indistinguishable + # from a run in flight, which is why this state survives unnoticed. It is a + # *configuration* finding, not red CI: the repo's code is fine, its gate is + # missing, and colouring it red would misattribute the fault. + wf_drift = snapshot.get("required_workflow_drift") + if isinstance(wf_drift, dict) and wf_drift.get("available"): + for row in wf_drift.get("repos") or []: + if not isinstance(row, dict): + continue + for wf in row.get("missing") or []: + yellow.append( + f"{row.get('name')}: required workflow '{wf}' has no workflow " + f"file — CI can never roll up green" + ) + hit("required_workflow_drift") + # A repo whose workflow list could not be read is an unknown, never an + # implied pass: without it a missing gate would hide behind the error. + unreadable = [ + str(row.get("name")) + for row in wf_drift.get("repos") or [] + if isinstance(row, dict) and row.get("error") + ] + if unreadable: + add_stale( + "required workflows unverified (workflow list unreadable): " + + ", ".join(sorted(unreadable)), + "required_workflow_unknown", + ) + # --- install verification (deep check: RED on fail, YELLOW if stale/unrun) --- # # The sidecar arrives either from a local `verify_install --report-json` run diff --git a/heart/state.py b/heart/state.py index 7ace1e35..eeaa9759 100644 --- a/heart/state.py +++ b/heart/state.py @@ -84,6 +84,7 @@ def aggregate() -> dict[str, Any]: "version_skew": _read_json_or_default(HEART_STATE_DIR / "version_skew.json", {}), "version_skew_pypi": _read_json_or_default(HEART_STATE_DIR / "version_skew_pypi.json", {}), "manifest_drift": _read_json_or_default(HEART_STATE_DIR / "manifest_drift.json", {}), + "required_workflow_drift": _read_json_or_default(HEART_STATE_DIR / "required_workflow_drift.json", {}), "verify_install": _read_json_or_default(HEART_STATE_DIR / "verify_install.json", {}), "url_check": _read_json_or_default(HEART_STATE_DIR / "url_check.json", {}), "validation_report": _read_json_or_default(HEART_STATE_DIR / "validation_report.json", {}), diff --git a/heart/tick.sh b/heart/tick.sh index 5ff2a03c..5730a8e5 100755 --- a/heart/tick.sh +++ b/heart/tick.sh @@ -48,6 +48,12 @@ PYTHONPATH="$HEART_HOME" python3 -m heart.checks.release_run || heart_log WARN " # Python: workspace-vs-library version skew (cheap file reads; no heavy imports). PYTHONPATH="$HEART_HOME" python3 -m heart.checks.version_skew || heart_log WARN "$(c_warn 'version_skew failed')" +# Python: required-workflow drift — a required workflow with no file never +# satisfies ci_status's all_green, so the repo reads `in_progress` forever. +# One extra cheap `gh api` metadata read per gating repo, fetched in parallel; +# skips itself entirely when `gh` is absent (web/mobile session). +PYTHONPATH="$HEART_HOME" python3 -m heart.checks.required_workflow_drift || heart_log WARN "$(c_warn 'required_workflow_drift failed')" + # Python: body-map identity drift — PyAutoMind/repos.yaml vs Heart/Build/labels # repo lists and every checkout's origin (delegates to repos_sync.py --check). if [[ -f "$PYAUTO_ROOT/PyAutoMind/scripts/repos_sync.py" ]]; then diff --git a/tests/test_readiness.py b/tests/test_readiness.py index 38bcb03d..fe1353b9 100644 --- a/tests/test_readiness.py +++ b/tests/test_readiness.py @@ -786,6 +786,57 @@ def test_manifest_drift_unavailable_stays_green(): assert v["verdict"] == "green" +def _wf_drift(**overrides): + row = { + "name": "autolens_workspace", + "group": "workspaces", + "required": ["Smoke Tests", "Navigator Check"], + "present": ["Smoke Tests"], + "missing": ["Navigator Check"], + "error": "", + } + row.update(overrides) + return {"available": True, "checked": 1, "repos": [row], + "missing_count": len(row["missing"]), + "error_count": 1 if row["error"] else 0} + + +def test_missing_required_workflow_is_yellow_not_red(): + """A gate that is not wired up is a configuration finding, not red CI.""" + v = compute(make_snapshot(required_workflow_drift=_wf_drift())) + assert v["verdict"] == "yellow" + assert v["red_reasons"] == [] + assert any( + "autolens_workspace" in r and "Navigator Check" in r + for r in v["yellow_reasons"] + ) + + +def test_required_workflows_all_present_stays_green(): + v = compute(make_snapshot(required_workflow_drift=_wf_drift( + present=["Smoke Tests", "Navigator Check"], missing=[]))) + assert v["verdict"] == "green" + + +def test_required_workflow_drift_unavailable_stays_green(): + """No `gh` (the web/mobile session) is a skip, not a finding.""" + v = compute(make_snapshot(required_workflow_drift={ + "available": False, "reason": "gh not installed", "repos": [], + "missing_count": 0})) + assert v["verdict"] == "green" + + +def test_unreadable_workflow_list_is_stale_not_an_implied_pass(): + """Without this, a missing gate would hide behind a failed fetch.""" + v = compute(make_snapshot(required_workflow_drift=_wf_drift( + present=[], missing=[], error="HTTP 403"))) + assert v["verdict"] == "stale" + assert any("required workflows unverified" in r for r in v["stale_reasons"]) + assert any( + d["key"] == "required_workflow_unknown" for d in v["stale_details"] + ) + + # --------------------------------------------------------------------------- # release-ci profile (the scheduled-nightly gate — design §5 in # PyAutoHands/docs/nightly_release_design.md). The driver assembles a snapshot diff --git a/tests/test_required_workflow_drift.py b/tests/test_required_workflow_drift.py new file mode 100644 index 00000000..de91b933 --- /dev/null +++ b/tests/test_required_workflow_drift.py @@ -0,0 +1,247 @@ +"""tests/test_required_workflow_drift.py — required workflows with no file. + +The defect under test is silent by construction: ``ci_status.rollup()`` scores a +repo over its group's required workflows, and one with no runs is never scored +as a failure — it just never satisfies ``all_green``. These tests pin the two +things that make the finding useful: it is derived from the workflow *list* +(the only source that separates "no file" from "file exists, never ran"), and it +never reports a hollow green when the list cannot be read. +""" + +from __future__ import annotations + +import json +import subprocess + +import pytest + +from heart.checks import required_workflow_drift as rwd + + +CONFIG = """\ +repos: + libraries: + - name: LibraryOne + owner: ExampleOrg + workspaces: + - name: alpha_workspace + owner: ExampleOrg + - name: beta_workspace + owner: ExampleOrg + organism: + - name: SomeOrgan + owner: ExampleOrg + +required_workflows: + libraries: ["Tests"] + workspaces: ["Smoke Tests", "Navigator Check"] +""" + + +@pytest.fixture() +def config(tmp_path): + path = tmp_path / "repos.yaml" + path.write_text(CONFIG) + return path + + +def test_polled_repos_reads_every_group(config): + repos = rwd.polled_repos(config) + assert {r["name"] for r in repos} == { + "LibraryOne", + "alpha_workspace", + "beta_workspace", + "SomeOrgan", + } + assert {r["group"] for r in repos} == {"libraries", "workspaces", "organism"} + + +def test_gating_repos_skips_advisory_groups(config): + rows = rwd.gating_repos(config) + # `organism` declares no required_workflows: advisory, nothing to be + # missing, and nothing to spend an API call on. + assert {r["name"] for r in rows} == { + "LibraryOne", + "alpha_workspace", + "beta_workspace", + } + by_name = {r["name"]: r for r in rows} + assert by_name["LibraryOne"]["required"] == ["Tests"] + assert by_name["beta_workspace"]["required"] == ["Smoke Tests", "Navigator Check"] + + +def _fake_fetch(table): + """Build a fetch_workflow_names stub from {owner/name: names | error str}.""" + + def fetch(owner_name): + entry = table[owner_name] + if isinstance(entry, str): + return None, entry + return list(entry), "" + + return fetch + + +def test_missing_required_workflow_is_named(monkeypatch): + monkeypatch.setattr( + rwd, + "fetch_workflow_names", + _fake_fetch({"ExampleOrg/beta_workspace": ["Smoke Tests"]}), + ) + row = rwd.check_one( + { + "owner": "ExampleOrg", + "name": "beta_workspace", + "group": "workspaces", + "required": ["Smoke Tests", "Navigator Check"], + } + ) + assert row["missing"] == ["Navigator Check"] + assert row["present"] == ["Smoke Tests"] + assert row["error"] == "" + + +def test_workflow_present_but_never_run_is_not_missing(monkeypatch): + """The distinction the runs payload cannot make. + + A file that exists but has never run on `main` leaves the roll-up genuinely + pending — that is a run in flight, not a gate that was never wired up, and + this check must not claim otherwise. + """ + monkeypatch.setattr( + rwd, + "fetch_workflow_names", + _fake_fetch( + {"ExampleOrg/beta_workspace": ["Smoke Tests", "Navigator Check"]} + ), + ) + row = rwd.check_one( + { + "owner": "ExampleOrg", + "name": "beta_workspace", + "group": "workspaces", + "required": ["Smoke Tests", "Navigator Check"], + } + ) + assert row["missing"] == [] + + +def test_matching_is_on_name_not_filename(monkeypatch): + """`ci_status` matches runs on the workflow's `name`, so this must too. + + A repo whose file is called `navigator_check.yml` but whose `name:` field + says something else is exactly the case a filename-based check would pass + and the roll-up would still starve on. + """ + monkeypatch.setattr( + rwd, + "fetch_workflow_names", + _fake_fetch({"ExampleOrg/x": ["navigator_check.yml", "Smoke Tests"]}), + ) + row = rwd.check_one( + { + "owner": "ExampleOrg", + "name": "x", + "group": "workspaces", + "required": ["Smoke Tests", "Navigator Check"], + } + ) + assert row["missing"] == ["Navigator Check"] + + +def test_fetch_error_is_an_unknown_never_an_implied_pass(monkeypatch): + monkeypatch.setattr( + rwd, "fetch_workflow_names", _fake_fetch({"ExampleOrg/x": "HTTP 403"}) + ) + row = rwd.check_one( + { + "owner": "ExampleOrg", + "name": "x", + "group": "workspaces", + "required": ["Smoke Tests", "Navigator Check"], + } + ) + assert row["error"] == "HTTP 403" + assert row["missing"] == [] # not "nothing missing" — unknown + assert row["present"] == [] + + +def test_timeout_is_reported_as_an_error(monkeypatch): + def boom(owner_name): + raise subprocess.TimeoutExpired(cmd="gh", timeout=rwd.FETCH_TIMEOUT_S) + + monkeypatch.setattr(rwd, "fetch_workflow_names", boom) + row = rwd.check_one( + {"owner": "o", "name": "n", "group": "workspaces", "required": ["Smoke Tests"]} + ) + assert "timed out" in row["error"] + assert row["missing"] == [] + + +def test_run_without_gh_is_unavailable_not_green(tmp_path, monkeypatch, config): + monkeypatch.setattr(rwd.shutil, "which", lambda _: None) + monkeypatch.setattr(rwd, "HEART_STATE_DIR", tmp_path) + result = rwd.run(config) + assert result["available"] is False + assert "gh" in result["reason"] + on_disk = json.loads((tmp_path / "required_workflow_drift.json").read_text()) + assert on_disk == result + + +def test_run_writes_the_sidecar_and_counts(tmp_path, monkeypatch, config): + monkeypatch.setattr(rwd.shutil, "which", lambda _: "/usr/bin/gh") + monkeypatch.setattr(rwd, "HEART_STATE_DIR", tmp_path) + monkeypatch.setattr( + rwd, + "fetch_workflow_names", + _fake_fetch( + { + "ExampleOrg/LibraryOne": ["Tests"], + "ExampleOrg/alpha_workspace": ["Smoke Tests", "Navigator Check"], + "ExampleOrg/beta_workspace": ["Smoke Tests"], + } + ), + ) + result = rwd.run(config) + assert result["available"] is True + assert result["checked"] == 3 + assert result["missing_count"] == 1 + assert result["error_count"] == 0 + missing = {r["name"]: r["missing"] for r in result["repos"] if r["missing"]} + assert missing == {"beta_workspace": ["Navigator Check"]} + on_disk = json.loads((tmp_path / "required_workflow_drift.json").read_text()) + assert on_disk == result + + +def test_fetch_workflow_names_reads_the_workflow_list(monkeypatch): + """The one call this check adds, and the field it reads from it.""" + seen = {} + + class Proc: + returncode = 0 + stdout = "Smoke Tests\nNavigator Check\n" + stderr = "" + + def fake_run(cmd, **kwargs): + seen["cmd"] = cmd + return Proc() + + monkeypatch.setattr(rwd.subprocess, "run", fake_run) + names, error = rwd.fetch_workflow_names("ExampleOrg/beta_workspace") + assert names == ["Smoke Tests", "Navigator Check"] + assert error == "" + assert "repos/ExampleOrg/beta_workspace/actions/workflows" in seen["cmd"][2] + assert seen["cmd"][-1] == ".workflows[].name" + + +def test_fetch_workflow_names_collapses_gh_stderr(monkeypatch): + class Proc: + returncode = 1 + stdout = "" + stderr = "gh: Not Found (HTTP 404)\nsomething\n else\n" + + monkeypatch.setattr(rwd.subprocess, "run", lambda cmd, **kw: Proc()) + names, error = rwd.fetch_workflow_names("ExampleOrg/nope") + assert names is None + assert "\n" not in error + assert error.startswith("gh: Not Found")