← Back to Pull requests

Log Dispatcher operation failures and finished jobs from their own component #25491

Closed
unknown closed this pull request without merging on Oct 05, 2026 12:26 UTC
View on GitHub
unknown unknown commented on Oct 02, 2026 11:13 UTC
Author

What does this PR do?

Makes Dispatcher failures and finished jobs findable in logs by the component, operation and target they belong to.

Operation failures. Every failed operation now logs one record from the component that owns it, carrying dispatcher.operation and the error. It is logged at error level when the failure escapes the processor, and at warning level when the processor recovers and continues (refresh_jobs keeping the jobs it already fetched, degraded collect_artifacts, a PR comment that was not published). MetricsHelper.log_failed_operation keeps the operation field and the level choice in one place. The orchestrator's own dispatcher record is unchanged and stays as the bus-level entry.

Finished jobs. The test-runner reports what it reads from GitHub, and the test-gatherer reports only what it infers:

  • The runner reports each planned job's finish once per GitHub job ID, at its first completed observation in any job listing, including the final listing after the artifact download. It logs Job <name> completed: <status> in <n>s and emits job.duration. Moving job.duration here means it no longer depends on result gathering succeeding.

  • The gatherer's Job <name> has no confirmed final state: reported as <status> warning, for jobs whose finish was never observed, now carries the job's fields and the inferred status.
  • job_fields(job, workflow_job=None) describes the job from the plan and, when given, from GitHub's workflow job:

    | Attribute | Value |
    | --- | --- |
    | dispatcher.batch.job.target, environment, platform, ... | From the plan, as before |
    | dispatcher.batch.job.status | Internal status |
    | dispatcher.batch.job.conclusion | GitHub conclusion |
    | dispatcher.batch.job.id / .url | GitHub job |
    | dispatcher.batch.job.duration_seconds | Execution time, numeric |
    | dispatcher.batch.job.queue_duration_seconds | Time waiting for a runner, numeric |

    Only dispatcher.batch.job.status is a metric tag among the new fields, so job.duration keeps its tags. Its dispatcher.component tag is now test-runner.

    Motivation

    Operation failure metrics are tagged with the failing component, but the matching log came from the orchestrator under dispatcher.component:dispatcher, or from the GitHub client, so filtering logs by component and operation found nothing. Job completion logs had only the job name and status, so @dispatcher.batch.job.target:postgres matched no logs and there was no way to find a slow job through logs. Jobs first seen finished in the final listing were not logged at all.

    Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)

  • Add qa/required if this PR needs QA validation, or qa/skip-qa if it does not. Exactly one of the two is required.

  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged
  • Diff: 379 lines (+284 / -95) across 4 files Reviewer: HadhemiDD Review duration: 4393m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 379 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.355
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #25491"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.9% (MEDIUM) · Higher = larger blast radius
    42.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.0% · Safe to merge
    17.0%