linera-io/linera-protocol · error · anyhow

No PR jobs found!

Error message

No PR jobs found!

What it means

Raised by PerformanceSummary::init when GitHub's latest_jobs returns zero jobs for the PR branch with event type 'pull_request'. The runtime comparison needs both sides, so init bails. The same tracked-workflow filter is applied, so name mismatches or workflows that never ran on the PR also yield an empty result.

Source

Thrown at linera-summary/src/performance_summary.rs:56

            github.context().base_branch(),
            "push",
            &workflows_handler,
            &workflows,
        ))
        .await?;
        if base_jobs.is_empty() {
            bail!("No base jobs found!");
        }

        let pr_jobs = Box::pin(github.latest_jobs(
            github.context().pr_branch(),
            "pull_request",
            &workflows_handler,
            &workflows,
        ))
        .await?;
        if pr_jobs.is_empty() {
            bail!("No PR jobs found!");
        }

        Ok(Self {
            github,
            ci_runtime_comparison: CiRuntimeComparison::from_jobs(base_jobs, pr_jobs)?,
        })
    }

    fn format_comment_body(&self) -> String {
        let commit_hash = self.github.context().pr_commit_hash();
        let short_commit_hash = &commit_hash[..7];
        let commit_url = format!(
            "https://github.com/{}/{}/commit/{}",
            self.github.context().repository().owner(),
            self.github.context().repository().name(),
            commit_hash
        );

View on GitHub (pinned to 6c226ddcb3)

Solutions

  1. Confirm the PR has at least one completed pull_request-event run of the tracked workflows
  2. Check the workflows are not skipped by 'paths:'/'branches:' filters or fork-PR restrictions
  3. Verify the tool is running in a PR context (event name pull_request) with a valid pr_branch()
  4. Re-run the CI workflows on the PR, then retry the tool
Defensive patterns

Strategy: validation

Validate before calling

// Before init: require a pull_request context and at least one completed PR run.
if std::env::var("GITHUB_EVENT_NAME").ok().as_deref() != Some("pull_request") {
    anyhow::bail!("performance summary must run in a pull_request event");
}

Try / catch

if let Err(e) = PerformanceSummary::init(github, tracked).await {
    if e.to_string().contains("No PR jobs found!") {
        // CI has not produced results yet: warn and exit non-fatally
    }
}

Prevention

When it happens

Trigger: Calling PerformanceSummary::init when latest_jobs(pr_branch, "pull_request", ...) returns an empty Vec: the PR has not yet triggered CI (runs pending or skipped), the PR comes from a fork where pull_request workflows don't run, workflow path/filters skipped the tracked workflows, or the tool runs outside a PR context so pr_branch() is wrong.

Common situations: Running the summary tool immediately after opening a PR before any pull_request-triggered run finishes; PRs from forks with restricted workflow triggers; running the tool on a branch that is not an open PR; workflow 'paths:' filters excluding the changed files.

Related errors


AI-assisted analysis of linera-io/linera-protocol@6c226ddcb3 (2026-08-22). Data as JSON: /api/errors/ff6885cd0e78b5e2. Report an issue: GitHub.