{"record":{"id":"19c07434683c44fe","repo":"rust-lang/rust","slug":"computed-job-list-is-empty","errorCode":null,"errorMessage":"Computed job list is empty","messagePattern":"Computed job list is empty","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/ci/citool/src/jobs.rs","lineNumber":382,"sourceCode":"        })\n        .collect();\n\n    Ok(jobs)\n}\n\npub fn calculate_job_matrix(\n    db: JobDatabase,\n    gh_ctx: GitHubContext,\n    channel: &str,\n) -> anyhow::Result<()> {\n    let run_type = gh_ctx.get_run_type().ok_or_else(|| {\n        anyhow::anyhow!(\"Cannot determine the type of workflow that is being executed\")\n    })?;\n    eprintln!(\"Run type: {run_type:?}\");\n\n    let jobs = calculate_jobs(&run_type, &db, channel)?;\n    if jobs.is_empty() && !matches!(run_type, RunType::MainJob) {\n        return Err(anyhow::anyhow!(\"Computed job list is empty\"));\n    }\n\n    let run_type = match run_type {\n        RunType::PullRequest => \"pr\",\n        RunType::TryJob { .. } => \"try\",\n        RunType::AutoJob => \"auto\",\n        RunType::MainJob => \"main\",\n    };\n\n    eprintln!(\"Output\");\n    eprintln!(\"jobs={jobs:?}\");\n    eprintln!(\"run_type={run_type}\");\n    println!(\"jobs={}\", serde_json::to_string(&jobs)?);\n    println!(\"run_type={run_type}\");\n\n    Ok(())\n}\n","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/src/ci/citool/src/jobs.rs#L364-L400","documentation":"Thrown by calculate_job_matrix after calculate_jobs returns an empty Vec, as long as the run type is not RunType::MainJob. calculate_jobs filters the JobDatabase by run type, channel (only_on_channel), and try-job glob patterns; if every job is filtered out there is nothing to execute. MainJob is exempt because a main-branch push legitimately runs no citool-scheduled jobs.","triggerScenarios":"A try-job whose commit message lists try-job: patterns that match zero auto/optional jobs; a PR/try/auto run restricted to a channel where all candidate jobs carry only_on_channel set to a different channel; jobs.yml edited so a run-type bucket is empty.","commonSituations":"Typo in a try-job: <pattern> line (glob matches nothing); jobs.yml refactored and a job moved out of the pr/try/auto list; running on a beta/stable channel while every job is pinned only_on_channel: nightly.","solutions":["Inspect the 'Run type:' line citool prints just before the error to confirm the run type, then check jobs.yml for that bucket's contents.","For try jobs, verify the try-job: patterns in the commit message against actual job names in jobs.yml (glob_match syntax).","Check each candidate job's only_on_channel field against the channel argument passed to calculate_job_matrix.","If the empty list is expected for your run type, confirm whether the run type should be MainJob (which is allowed to be empty)."],"exampleFix":"// before\n// commit message body:\n// try-job: dist-x86_64-unkown-linux-gnu   (typo: unkown)\n\n// after\n// try-job: dist-x86_64-unknown-linux-gnu","handlingStrategy":"validation","validationCode":"// Before calculate_job_matrix, sanity-check the bucket for the run type is non-empty\n// (unless it is MainJob, which is allowed to be empty).\nlet run_type = gh_ctx.get_run_type();\nif run_type.is_some() && !matches!(run_type, Some(RunType::MainJob)) {\n    let probe = calculate_jobs(&run_type.unwrap(), &db, channel)?;\n    if probe.is_empty() {\n        eprintln!(\"Warning: no jobs match the current run type/channel/patterns\");\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate try-job: glob patterns against jobs.yml before pushing the try commit.","Keep only_on_channel values consistent with the channels you actually run.","When restructuring jobs.yml, verify each run-type bucket still resolves to jobs."],"tags":["ci","citool","job-matrix","configuration"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}