← Back to Pull requests

fix(templatize): resolve region short settings without a shell (ARO-28265) #8333

Closed
unknown closed this pull request without merging on Dec 01, 2026 15:12 UTC
View on GitHub
unknown unknown commented on Nov 30, 2026 18:34 UTC
Author

Jira: ARO-28265

What

tooling/templatize/settings.yaml declares the region short override and suffix as data instead of shell text:

regionShortOverride:
  variable: BUILD_ID
  prefix: j
  offset: -7
regionShortSuffix:
  variable: USER
  prefix: p
  length: 4

settings.RegionShortSource slices an environment variable and prepends an optional literal prefix. offset counts from the start of the value and is negative from the end, length keeps that many bytes and truncates past the end, and a missing variable or an offset outside the value contributes an empty slice. A negative length, or a source with neither a variable nor a prefix, is an error. settings.Resolve no longer takes a context, because nothing outside the process runs.

Why

The settings file is configuration, not code. Passing its text through bash -c "echo ..." executes shell syntax with the invoking user's privileges and full environment, cloud credentials included on CI runners (ARO-28265, CWE-78). A declared slice defines the value by type, so no shell implementation is approximated.

Testing

  • go build ./... and go vet ./pkg/settings/ in tooling/templatize, plus go build ./util/config/ in test/, which resolves the same settings for E2E resource names.

  • go test ./pkg/settings/: table-driven coverage for first and last bytes, a prefix with and without a variable, offsets and lengths outside the value, an unset variable, and the rejected inputs. A second test resolves every environment in the shipped settings.yaml.

  • make -C config render and make -C config detect-change: rendered configs and helm fixtures are unchanged.

  • make verify-yamlfmt.
  • Special notes for your reviewer

    Resolved values are identical for every environment in the shipped file: pers keeps the first four bytes of USER, perf prefixes p, and ci00 to ci02 use j plus the last seven bytes of BUILD_ID.

    PR Checklist

  • PR is scoped to a single task (no mixed concerns)

  • Title follows Conventional Commits format

  • Summary explains the "Why" behind the change

  • Linked to relevant ticket/issue

  • Self-reviewed the diff

  • Commit history is clean (rebased/squashed)

  • Tricky code blocks are commented

  • CI/CD checks are passing (ignore Tide)

  • All comment threads resolved before merge
  • Diff: 313 lines (+234 / -79) across 3 files Reviewer: redhat-chai-bot Review duration: 1237m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 313 lines diff across 3 files
    0.40
    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.344
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #8333"
    general weight: 0.35
    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: 40.3% (MEDIUM) · Higher = larger blast radius
    40.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: 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: 15.9% · Safe to merge
    15.9%
    Repository