← Back to Pull requests

lint: unify golangci-lint config and clear common/image/storage backlog #1383

Open
unknown opened this pull request with 168 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 20, 2026 19:33 UTC
Author

Today each of common, image, and storage carried its own golangci-lint config. This PR replaces that with a single root .golangci.yml (with relative-path-mode: gitroot) and points Make/CI at it. With one policy in place, the rest of the PR clears the backlog that showed up under it: wrapping errors with %w, checking type assertions, renaming locals that shadowed predeclared names, and a handful of smaller cleanups (HTTP status constants, misspell, etc.). Where we cannot rename things without breaking public or ABI-facing names, we carve them out narrowly. For example ST1005 under image/, the copy package paths, storage ST1003, and intentional value/pointer Marshal receivers.

Behavior


This is meant to be a lint cleanup, not a feature change. There are no public API signature changes.
A few places do change runtime details in small ways:
  • The image storage destination now passes the caller's context through layer commit / DiffID helpers instead of context.Background().

  • Dual-error paths use errors.Join, so both errors stay in the chain for errors.Is / unwrap.

  • Type assertions that used to panic on an impossible type now fail more gently (return an error or false).
  • Normal Linux/Unix happy paths should behave the same.

    Fixes: https://github.com/podman-container-tools/container-libs/issues/1358

    Diff: 168 lines (+126 / -42) across 2 files Reviewer: mtrmac Review duration: 14325m
    All Vouch review confidence checks passed
    Residual risk 0.31 = Change Risk (0.58) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.58 · 168 lines diff across 2 files
    0.58
    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.307
    Sensitive Paths sensitive_paths
    0.058
    Real PR Conversation Timeline
    1 comments
    "Review active on #1383"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed sensitive_module
    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: 58.3% (MEDIUM) · Higher = larger blast radius
    58.3%
    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: 31.1% · Safe to merge
    31.1%