← Back to Pull requests

refactor: move Wasm and URL plugin types to pkg/apis/plugins/v1 #4860

Open
unknown opened this pull request with 260 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 16, 2026 23:26 UTC
Author

What type of PR is this?

/kind cleanup

What this PR does / Why we need it:

Moves the URLConfiguration, WasmFrom and WasmPolicy types, and their validation, out of autoscaling/v1 into a new plugins.agones.dev/v1 package (pkg/apis/plugins/v1), so they can be shared between the FleetAutoscaler and GameServerAllocation, which is getting Wasm plugin support.

Along with the types:

  • The code that builds a URL and HTTP client from a URLConfiguration moves out of pkg/fleetautoscalers onto the type (BuildURL(), HTTPClient()).

  • ValidateWasmPolicy takes the feature gate to check, so each API can use its own gate (the autoscaler still uses WasmAutoscaler).

  • The Helm CRD schema for these types moves into a shared _plugin.yaml include.
  • There is no behaviour change, and the FleetAutoscaler CRD schema is unchanged.

    Which issue(s) this PR fixes:

    Work on #4151

    Did you use AI tools in preparing this PR?:

    Y

    Special notes for your reviewer:

    Most of the diff is moved or generated code:

  • pkg/client/applyconfiguration/..., zz_generated.deepcopy.go and agones_crd_api_reference.html are regenerated. The API reference now lists the three types under plugins.agones.dev/v1.

  • In install.yaml only a YAML comment and trailing whitespace change, as the schema now comes from the shared include.

  • test/e2e/fleetautoscaler_test.go only changes type references.

  • pkg/apis/plugins/v1 has a +groupName so the API reference generator documents it, but it has no CRDs of its own.
  • build/build-image/gen-crd-code.sh reruns applyconfiguration-gen with pkg/apis/plugins/v1 included, since kube_codegen only picks up packages with +genclient resources. That keeps the FleetAutoscaler apply builders taking apply configurations (now from pkg/client/applyconfiguration/plugins/v1), and plugins/v1 gets a SchemeGroupVersion for the generated code. build/build-image/Dockerfile only bumps its ForceUpdate counter, so the build image tag changes and the image, which holds a copy of the script, is rebuilt.
  • Diff: 260 lines (+195 / -65) across 3 files Reviewer: markmandel Review duration: 945m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.39) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 260 lines diff across 3 files
    0.39
    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%
    42%
    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.333
    Real PR Conversation Timeline
    1 comments
    "Review active on #4860"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% 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: 39.2% (MEDIUM) · Higher = larger blast radius
    39.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: 43.0% · Lower = rushed or shallow review
    43.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: 22.4% · Safe to merge
    22.4%