← Back to Pull requests

feat(egctl): add `x migrate deprecated` command #10677

Open
unknown opened this pull request with 276 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 24, 2026 06:13 UTC
Author

What this PR does / why we need it:

This adds egctl x migrate deprecated, which rewrites manifests to the replacement fields so users can
update them before upgrading.

Why a migrate command rather than a check command. Policies and EnvoyProxy already report
deprecated fields in their status, so a command that only lists them adds little. The hard part
is the rewrite, because several replacements aren't plain renames.

Design

  • Files are the main input. Most installs are Helm or GitOps, so a fix in the cluster would

  • be reverted. -f takes files, directories or stdin, and --mode is print (default),
    in-place or check-only. The tool edits the YAML tree directly, so comments, field order and
    indentation are kept, and documents with nothing to migrate are written back byte for byte.
  • --from-cluster is read-only for now. It prints the migrated objects without server-set

  • fields. Objects managed by Helm, Argo CD or Flux are reported as errors and left unchanged, so
    users fix them in their source.
  • Report-only cases:

  • - Telemetry host/port is migrated only when the host is a Service DNS name. Any other
    host is an error, because egctl never creates Backend resources.
    - The EnvoyGateway configuration is never rewritten (ConfigMap, file or Helm values), since
    it's usually rendered from Helm values.
  • Extensible: migrate is a parent command with a Path interface, so later migrations can

  • be added as egctl x migrate <path>.

    Behavior notes for reviewers:

  • A telemetry host migrated to a Service backendRefs entry makes Envoy use the Service's

  • endpoints instead of resolving its DNS name. This is noted in the report and the docs.
  • cmd/egctl/main.go now exits with the code carried by migrate.ExitError; before, every

  • error exited with 1.

    Follow-up: --from-cluster --mode in-place for test clusters. It's rejected in this PR.
    The planned safeguards are two confirmations (the second asks the user to type the context
    name), a server-side dry-run that catches fields pruned by old CRDs, a backup of the originals,
    and updates with optimistic concurrency.

    Which issue(s) this PR fixes:

    Part of #10211

    Diff: 276 lines (+207 / -69) across 3 files Reviewer: zirain Review duration: 9368m
    All Vouch review confidence checks passed
    Residual risk 0.33 = Change Risk (0.63) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.63 · 276 lines diff across 3 files
    0.63
    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.336
    Sensitive Paths sensitive_paths
    0.063
    Real PR Conversation Timeline
    1 comments
    "Review active on #10677"
    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: 62.7% (MEDIUM) · Higher = larger blast radius
    62.7%
    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: 33.5% · Safe to merge
    33.5%