← Back to Pull requests

fix(frontend): declare the named-contexts capability #231

Open
unknown opened this pull request with 186 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 13, 2026 14:00 UTC
Author

BuildKit refuses a build that passes --build-context before the frontend runs, because the frontend image does not declare the capability:

ERROR: failed to build: current frontend does not support --build-context.

The frontend already forwards named contexts and frontend inputs to the content recipe's dockerfile.v0 solve (dockerfileFrontendOpts and the FrontendInputs copy in cmd/frontend/build.go). The gateway only checks the image's moby.buildkit.frontend.caps label, so this adds the label to the frontend image. It declares inputs and contexts and leaves out subrequests, which the frontend does not answer.

With the label, a client can redirect the images a kit's recipe builds on without editing the recipe. For example, it can send a Docker Hub FROM to a registry mirror with --build-context alpine:3.22=docker-image://mirror.example/library/alpine:3.22.

Verification

  • TestNamedContextsReachCompanion (new, KIT_E2E=1) builds a kit whose companion FROMs a name no registry serves and supplies it through --build-context. It fails without the label with the error above and passes with it.

  • KIT_E2E=1 go test ./cmd/frontend/... passes in full, and task validate is clean.
  • Release note

    ``release-note
    The kit frontend accepts
    docker buildx build --build-context, so a build can redirect the images a kit's recipe builds on, such as to a registry mirror.
    ``

    🤖 Generated with Claude Code

    Diff: 186 lines (+139 / -47) across 2 files Reviewer: robmry Review duration: 5826m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.36) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 186 lines diff across 2 files
    0.36
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.313
    Real PR Conversation Timeline
    1 comments
    "Review active on #231"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% 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: 35.8% (MEDIUM) · Higher = larger blast radius
    35.8%
    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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 19.1% · Safe to merge
    19.1%