← Back to Pull requests

feat: Add optional namespace support for secretKeyRef in Analysis argument #4648

Closed
unknown closed this pull request without merging on Oct 30, 2026 15:16 UTC
View on GitHub
unknown unknown commented on Mar 14, 2026 22:10 UTC
Author

Description


This PR adds support for referencing secrets from explicitly allowed namespaces when resolving secretKeyRef in Analysis arguments.
so currently, secrets referenced by ClusterAnalysisTemplate must be copied into every namespace where the template is used. This PR allows referencing a shared secret stored in an admin-controlled namespace instead. This PR also takes care of backward compatibility.

changes


  • CRDs have been generated

  • Added an optional namespace field to SecretKeyRe

  • Implemented cross-namespace secret resolution in resolveArgs()

  • Added controller flags:

  • - --enable-cross-namespace-secret-refs
    - --allowed-secret-ref-namespaces

  • Added validation to ensure cross-namespace secret access is: disabled by default (backward compatibilty)

  • restricted to explicitly allowed namespace only
  • fixes: #4611

    Checklist:

    [ ] Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
    [x] The title of the PR is (a) conventional with a list of types and scopes found here, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
    [x] I've signed my commits with DCO
    [x] My builds are green. Try syncing with master if they are not.
    [ ] I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
    [x] I have run all tests locally (including the flaky ones) and they pass on my workstation
    [x] I have used LLM/AI/Agent tools for this PR but I am responsible for all code of this PR
    [x] I understand what the code does and WHY/HOW it works in several scenarios
    [x] I know if my code is just adding new functionality or changing old functionality for existing users
    [ ] My organization is added to USERS.md.

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    New Features
    Analysis runs can opt to read referenced secrets from a configured shared namespace; references continue to use the AnalysisRun’s namespace by default.
    Shared-secret access is restricted by default to secrets with the required label. Administrators can configure the namespace and choose whether to allow all secrets there.
    Bug Fixes
    Errors for missing secrets now identify the secret and namespace.
    Documentation
    Added guidance on shared-secret configuration, access requirements, and security considerations.
    Updated the documented defaults for maxUnavailable and maxSurge to 1.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 387 lines (+290 / -97) across 4 files Reviewer: Mujib-Ahasan Review duration: 330785m
    All Vouch review confidence checks passed
    Residual risk 0.28 = Change Risk (0.66) × (1 − Review Confidence (0.58)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.66 · 387 lines diff across 4 files
    0.66
    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%
    57%
    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.357
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.066
    Real PR Conversation Timeline
    1 comments
    "Review active on #4648"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 58.0% 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: 66.2% (HIGH) · Higher = larger blast radius
    66.2%
    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: 58.0% · Lower = rushed or shallow review
    58.0%
    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: 27.8% · Safe to merge
    27.8%