{"record":{"id":"02f5439fd39c979c","repo":"BoundaryML/baml","slug":"no-completed-ci-workflow-runs-found-on-branch-branch-in-repo","errorCode":null,"errorMessage":"no completed `{CI_WORKFLOW}` runs found on branch `{branch}` in repo `{repo}`","messagePattern":"no completed `(.+?)` runs found on branch `(.+?)` in repo `(.+?)`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/tools_size_gate/src/fetch.rs","lineNumber":93,"sourceCode":"        \"run\",\n        \"list\",\n        \"--repo\",\n        &repo,\n        \"--workflow\",\n        CI_WORKFLOW,\n        \"--branch\",\n        branch,\n        \"--status\",\n        \"completed\",\n        \"--limit\",\n        &SCAN_LIMIT.to_string(),\n        \"--json\",\n        \"databaseId,headSha\",\n    ])?;\n    let runs: Vec<RunListEntry> =\n        serde_json::from_str(&runs_json).context(\"failed to parse `gh run list` output\")?;\n    if runs.is_empty() {\n        bail!(\"no completed `{CI_WORKFLOW}` runs found on branch `{branch}` in repo `{repo}`\");\n    }\n\n    // Pick the newest run that has every required report artifact.\n    let mut chosen: Option<&RunListEntry> = None;\n    for run in &runs {\n        if run_has_all_reports(&repo, run.database_id)? {\n            chosen = Some(run);\n            break;\n        }\n        eprintln!(\n            \"  run {}: missing one or more size-gate reports — skipping\",\n            run.database_id\n        );\n    }\n    let chosen = chosen.with_context(|| {\n        format!(\n            \"none of the last {SCAN_LIMIT} completed `{CI_WORKFLOW}` runs on `{branch}` \\\n             had all required size-gate reports\"","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/tools_size_gate/src/fetch.rs#L75-L111","documentation":"tools_size_gate's fetch_branch_reports queries GitHub via `gh run list` for completed runs of the configured CI workflow on the target branch/repo, and found zero runs. Without at least one run it cannot pick a run carrying the required report artifacts, so it bails.","triggerScenarios":"Calling fetch_branch_reports where the `gh run list --json databaseId,headSha` result is an empty array — no completed CI_WORKFLOW runs exist for the given branch and repo.","commonSituations":"Wrong branch or repo slug passed; CI workflow renamed so CI_WORKFLOW no longer matches; CI never ran (fresh branch, disabled workflows); runs exist but none completed (all in progress/failed).","solutions":["Verify branch and repo names passed to fetch_branch_reports match an existing branch with CI runs","Check the workflow file name matches CI_WORKFLOW on that branch","Trigger the CI workflow manually (workflow_dispatch or push) and wait for a completed run","Confirm `gh` is authenticated and pointed at the right host/organization"],"exampleFix":"// before\nfetch_branch_reports(repo = \"org/wrong-repo\", branch = \"feature-x\")\n// after\nfetch_branch_reports(repo = \"org/correct-repo\", branch = \"main\")","handlingStrategy":"try-catch","validationCode":"let out = Command::new(\"gh\").args([\"run\",\"list\",\"--workflow\",CI_WORKFLOW,\"--branch\",branch,\"--repo\",repo,\"--status\",\"completed\",\"--json\",\"databaseId\"])\n    .output()?;\nif String::from_utf8(out.stdout)?.trim() == \"[]\" {\n    eprintln!(\"no completed {CI_WORKFLOW} runs on {branch} in {repo}; trigger CI first\");\n}","typeGuard":"fn has_completed_runs(runs: &[RunListEntry]) -> bool { !runs.is_empty() }","tryCatchPattern":"match fetch_branch_reports(repo, branch) {\n    Err(e) if e.to_string().contains(\"no completed\") => { trigger_ci_and_wait(repo, branch)?; fetch_branch_reports(repo, branch) }\n    other => other,\n}","preventionTips":["Confirm the branch has merged/triggered the CI workflow before running size gate","Keep the workflow file name in sync with CI_WORKFLOW","Pre-flight `gh run list` to verify runs exist before analysis"],"tags":["ci","github-actions","size-gate","empty-result"],"backgroundTag":"empty-result-set","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}