← Back to Pull requests

fix(utils): converge datasetControllerOwnerReference with transformer helper #6199

Open
frenemy17 opened this pull request with 200 lines diff across 3 files
View on GitHub
frenemy17 frenemy17 commented on Oct 02, 2026 19:27 UTC
Author

Ⅰ. Describe what this PR does

This PR converges the owner-reference GVK recovery logic between datasetControllerOwnerReference in pkg/utils/dataset_runtime.go and the shared helper GenerateOwnerReferenceFromObject in pkg/utils/transformer/owner_reference.go, as proposed in #6140:
1. datasetControllerOwnerReference now delegates to transformer.GenerateOwnerReferenceFromObject so that scheme-backed GVK recovery is shared across both code paths, while retaining the well-known Dataset values as a last-resort fallback if scheme lookup is unavailable.
2. Added regression test coverage for partial TypeMeta shapes (only Kind set, and only APIVersion set) for Dataset and AlluxioRuntime in pkg/utils/transformer/owner_reference_test.go.
3. Added unit tests for datasetControllerOwnerReference in pkg/utils/dataset_runtime_test.go covering complete, empty, kind-only, apiVersion-only, and custom version TypeMeta.

Ⅱ. Does this pull request fix one issue?


fixes #6140

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.


  • pkg/utils/dataset_runtime_test.go: Added TestDatasetControllerOwnerReference asserting proper recovery and fallback for complete, empty, kind-only, apiVersion-only, and custom version TypeMeta.

  • pkg/utils/transformer/owner_reference_test.go: Added table entries to DescribeTable("when the TypeMeta of the object is incomplete") for Dataset and AlluxioRuntime with partial TypeMeta.
  • Ⅳ. Describe how to verify it


    go test -gcflags="all=-N -l" -count=1 ./pkg/utils/transformer/...
    go test -gcflags="all=-N -l" -count=1 -run "TestDatasetControllerOwnerReference|TestCreateRuntimeForReferenceDatasetIfNotExist" ./pkg/utils/
    

    Ⅴ. Special notes for reviews


    Follow-up to #6138 and #6139 as requested by @cheyang in #6140.

    Diff: 200 lines (+194 / -6) across 3 files Reviewer: cheyang Review duration: 10188m
    All Vouch review confidence checks passed
    Residual risk 0.03 = Change Risk (0.38) × (1 − Review Confidence (0.92)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.38 · 200 lines diff across 3 files
    0.38
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.93 · 5 substantive comment(s)
    0.93
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    92%
    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.317
    Real PR Conversation Timeline
    19 items
    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Oct 03, 2026 08:54 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    Copilot review overview

    🟢 Approval recommended

    The implementation consistently delegates GVK recovery and includes appropriate regression coverage.

    Review effort: Balanced
    Findings: None

    <details>
    <summary><strong>What changed in this PR</strong></summary>

    Consolidates Dataset owner-reference GVK recovery through the shared transformer while preserving Dataset-specific fallbacks.

    Changes:

  • Delegates Dataset owner-reference generation to the shared helper.

  • Adds coverage for incomplete TypeMeta values.

  • Verifies fallback and custom API-version behavior.
  • | File | Description |
    | ---- | ----------- |
    | pkg/​utils/​dataset_runtime.go | Uses shared GVK recovery with Dataset fallbacks. |
    | pkg/​utils/​dataset_runtime_test.go | Tests Dataset owner-reference scenarios. |
    | pkg/​utils/​transformer/​owner_reference_test.go | Tests partial TypeMeta recovery. |
    </details>

    ---

    💡 <a href="/fluid-cloudnative/fluid/new/master?filename=.github/skills/code-review/SKILL.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add a code-review agent skill</a> or configure MCP servers for context-aware, tailored reviews. <a href="https://docs.github.com/copilot/how-tos/use-copilot-agents/request-a-code-review/use-code-review?tool=webui#mcp-servers-and-agent-skills" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn more in the docs.</a>

    codecov[bot] codecov[bot] commented on Oct 03, 2026 09:00 UTC
    Bot

    Codecov Report


    :x: Patch coverage is 42.85714% with 4 lines in your changes missing coverage. Please review.
    :white_check_mark: Project coverage is 65.46%. Comparing base (e0fc4c1) to head (1bad02a).
    :warning: Report is 5 commits behind head on master.

    | Files with missing lines | Patch % | Lines |
    |---|---|---|
    | pkg/utils/dataset\_runtime.go | 42.85% | 4 Missing :warning: |

    <details><summary>Additional details and impacted files</summary>

    @@            Coverage Diff             @@
    ##           master    #6199      +/-   ##
    ==========================================
    + Coverage   65.45%   65.46%   +0.01%     
    ==========================================
      Files         486      486              
      Lines       34307    34312       +5     
    ==========================================
    + Hits        22455    22464       +9     
    + Misses      10091    10089       -2     
    + Partials     1761     1759       -2     
    

    </details>

    :umbrella: View full report in Codecov by Harness.
    :loudspeaker: Have feedback on the report? Share it here.
    <details><summary> :rocket: New features to boost your workflow: </summary>

  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

  • </details>

    frenemy17 frenemy17 commented on Oct 03, 2026 10:39 UTC
    Author

    Hi @cheyang, all checks have passed.Could you please take a look when you get a chance?

    cheyang cheyang commented on code on Oct 07, 2026 23:18 UTC
    Code Review
    pkg/utils/dataset_runtime.go:1
    @@ -43,15 +44,16 @@ func GetRuntimeByCategory(runtimes []datav1alpha1.Runtime, category common.Categ
     }
     
     // datasetControllerOwnerReference builds the controller ownerReference which points to the given dataset.
    -// Kind and APIVersion come from the dataset's TypeMeta, and fall back to the well-known values of the Dataset
    -// CRD when it is empty, which a typed client may hand back depending on how the object was read. The owner
    -// based watch of the dataset controller resolves a dependent through those two fields, so they must be set.
    +// Kind and APIVersion are resolved via the shared transformer helper (backed by the scheme), falling back to the
    +// well-known values of the Dataset CRD as a last resort if unavailable. The owner based watch of the dataset
    +// controller resolves a dependent through those two fields, so they must be set.
     func datasetControllerOwnerReference(dataset *datav1alpha1.Dataset) metav1.OwnerReference {
    -	kind := dataset.GetObjectKind().GroupVersionKind().Kind
    +	ref := transformer.GenerateOwnerReferenceFromObject(dataset)
    +	kind := ref.Kind

    This last-resort fallback (kind = datav1alpha1.Datasetkind, apiVersion = datav1alpha1.GroupVersion.String()) is unreachable for this function's only input type: *datav1alpha1.Dataset is registered in the transformer's scheme via utilruntime.Must at package init, and the shared helper's recovery triggers exactly when Kind or Version is empty, so the delegated result never comes back with empty fields here. Two independent sweeps (11 and 9 TypeMeta shapes) confirm the branch never fires. Issue #6140 item 3 asks for this fallback verbatim, so keep it as defense in depth — but a one-line "unreachable by design" comment would stop a future cleanup from removing it as accidental dead code. Related nit: the doc comment and the PR body's "recovery and fallback" phrasing read as if the fallback were exercised; the "empty TypeMeta" test case actually exercises the scheme-recovery path.

    cheyang cheyang commented on code on Oct 07, 2026 23:18 UTC
    Code Review
    pkg/utils/dataset_runtime_test.go:1
    @@ -193,3 +193,97 @@ func TestCreateRuntimeForReferenceDatasetIfNotExist(t *testing.T) {
     		t.Errorf("expected no ownerReference set on the terminating thinRuntime, but got %v", terminatingRuntime.GetOwnerReferences())
     	}
     }
    +
    +func TestDatasetControllerOwnerReference(t *testing.T) {

    No committed test asserts that CreateRuntimeForReferenceDatasetIfNotExist actually persists a well-formed ownerReference (Kind/APIVersion/Controller) on the created or adopted ThinRuntime — the pre-existing test checks only error/termination behavior, and the new tests invoke the unexported wrapper directly. That persisted reference is the property this helper exists for (owner-based watch resolution). A small fake-client assertion on the created ThinRuntime's OwnerReferences would close the gap; note the fake client does not validate ownerReference well-formedness, so compare the exact field values rather than relying on a round-trip.

    cheyang cheyang commented on code on Oct 07, 2026 23:18 UTC
    Code Review
    pkg/utils/dataset_runtime.go:1
    @@ -43,15 +44,16 @@ func GetRuntimeByCategory(runtimes []datav1alpha1.Runtime, category common.Categ
     }
     
     // datasetControllerOwnerReference builds the controller ownerReference which points to the given dataset.
    -// Kind and APIVersion come from the dataset's TypeMeta, and fall back to the well-known values of the Dataset
    -// CRD when it is empty, which a typed client may hand back depending on how the object was read. The owner
    -// based watch of the dataset controller resolves a dependent through those two fields, so they must be set.
    +// Kind and APIVersion are resolved via the shared transformer helper (backed by the scheme), falling back to the
    +// well-known values of the Dataset CRD as a last resort if unavailable. The owner based watch of the dataset
    +// controller resolves a dependent through those two fields, so they must be set.
     func datasetControllerOwnerReference(dataset *datav1alpha1.Dataset) metav1.OwnerReference {

    The convergence's core invariant — the delegated implementation is observably identical to the old one for every TypeMeta shape a real client can produce — is implied by the 5-case table, not asserted. A differential test with the legacy implementation as oracle would guard future refactors of either side; it must pin the one deliberate divergence rather than assert blind equality: a malformed apiVersion ("data.fluid.io/", group set / version empty) is now normalized to the registered data.fluid.io/v1alpha1 instead of being copied through verbatim — an improvement, since the old output failed API-server validation ("version must not be empty"). A permanent byte-copy oracle invites rot, so assert "identical on all reachable shapes, plus pinned normalization on the malformed shape".

    cheyang cheyang commented on Oct 07, 2026 23:18 UTC
    Reviewer

    Both reviewers independently confirmed the premise from #6140 — on master, datasetControllerOwnerReference still carries its own GVK recovery and never goes through the transformer — and both verified the convergence is behavior-preserving (legacy-oracle differential sweeps across 11+ TypeMeta shapes, an envtest through the real production path with a real API server, and mutation runs proving the tests bite). The only divergence found is an improvement: malformed apiVersion strings like "data.fluid.io/" now normalize to the registered version instead of being copied through verbatim. Two small items worth a follow-up: the last-resort Dataset fallback at dataset_runtime.go:52 is unreachable for this caller (Dataset is always in the scheme), so a one-line "unreachable by design" comment would keep a future cleanup from removing it; and nothing in the committed tests asserts the ownerReference actually persisted on the ThinRuntime created for a reference dataset — a small fake-client assertion comparing exact Kind/APIVersion/Controller values would close that gap. No blockers or majors from either side; the reviewers agreed on every finding. Copilot (advisory) reviewed this head and raised no findings.

    fluid-e2e-bot[bot] fluid-e2e-bot[bot] commented on Oct 08, 2026 10:15 UTC
    Bot

    [APPROVALNOTIFIER] This PR is NOT APPROVED

    This pull-request has been approved by:
    Once this PR has been reviewed and has the lgtm label, please assign trafalgarzzz for approval by writing /assign @trafalgarzzz in a comment. For more information see:The Kubernetes Code Review Process.

    The full list of commands accepted by this bot can be found here.

    <details open>
    Needs approval from an approver in each of these files:

  • OWNERS
  • Approvers can indicate their approval by writing /approve in a comment
    Approvers can cancel approval by writing /approve cancel in a comment
    </details>
    <!-- META={"approvers":["trafalgarzzz"]} -->

    frenemy17 frenemy17 commented on Oct 08, 2026 10:24 UTC
    Author

    Good call on both. Just pushed an update:

  • Added the "unreachable by design" comment at dataset_runtime.go:52 noting Dataset is already in the scheme and keeping it as a defensive fallback.

  • Added assertions in TestCreateRuntimeForReferenceDatasetIfNotExist to make sure OwnerReferences (Kind, APIVersion, UID, Controller: true) actually persist on both created and adopted ThinRuntimes.
  • Let me know if this looks good to you!

    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Oct 08, 2026 22:01 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🟢 Approval recommended

    The implementation consistently reuses the shared recovery logic and includes comprehensive regression coverage.

    0 open findings

    🧠 Review effort: Balanced

    cheyang cheyang commented on code on Oct 08, 2026 22:30 UTC
    Code Review
    pkg/utils/dataset_runtime.go:1
    @@ -43,16 +44,21 @@ func GetRuntimeByCategory(runtimes []datav1alpha1.Runtime, category common.Categ
     }
     
     // datasetControllerOwnerReference builds the controller ownerReference which points to the given dataset.
    -// Kind and APIVersion come from the dataset's TypeMeta, and fall back to the well-known values of the Dataset
    -// CRD when it is empty, which a typed client may hand back depending on how the object was read. The owner
    -// based watch of the dataset controller resolves a dependent through those two fields, so they must be set.
    +// Kind and APIVersion are resolved via the shared transformer helper (backed by the scheme), falling back to the
    +// well-known values of the Dataset CRD as a last resort if unavailable. The owner based watch of the dataset
    +// controller resolves a dependent through those two fields, so they must be set.
     func datasetControllerOwnerReference(dataset *datav1alpha1.Dataset) metav1.OwnerReference {
    -	kind := dataset.GetObjectKind().GroupVersionKind().Kind
    +	ref := transformer.GenerateOwnerReferenceFromObject(dataset)

    This delegation now routes the Dataset owner path through GenerateOwnerReferenceFromObject (pkg/utils/transformer/owner_reference.go:54), which only overwrites (Group, Version) as a pair and only when gvk.Version is empty, so a partial TypeMeta with a version but no group (e.g. APIVersion: "v1alpha1") mints an ownerReference {Kind: "Dataset", APIVersion: "v1alpha1"} — the group is never taken from the scheme, the exact class #6140 proposal 1 targeted. This PR adds regression entries for kind-only / apiVersion-only shapes, but the group-less shape is neither handled nor covered. Both reviewers reproduced the malformed output on the PR head. Rated minor rather than blocking because it is pre-existing on base (the legacy per-field fallback produced the identical output, confirmed by canary tests on both verification branches) and the shape is only constructible from malformed in-memory input — typed clients hand back empty TypeMeta and the API server rejects objects whose own apiVersion doesn't resolve. Suggested follow-up: gate on Kind/Group/Version each being empty and fill all three independently from the scheme lookup (verified compatible with the full existing suite).

    cheyang cheyang commented on code on Oct 08, 2026 22:30 UTC
    Code Review
    pkg/utils/dataset_runtime_test.go:1
    @@ -193,3 +235,97 @@ func TestCreateRuntimeForReferenceDatasetIfNotExist(t *testing.T) {
     		t.Errorf("expected no ownerReference set on the terminating thinRuntime, but got %v", terminatingRuntime.GetOwnerReferences())
     	}
     }
    +
    +func TestDatasetControllerOwnerReference(t *testing.T) {
    +	testCases := map[string]struct {
    +		dataset            *datav1alpha1.Dataset
    +		expectedKind       string
    +		expectedAPIVersion string
    +	}{
    +		"dataset with complete TypeMeta": {
    +			dataset: &datav1alpha1.Dataset{
    +				TypeMeta: v1.TypeMeta{
    +					Kind:       "Dataset",
    +					APIVersion: "data.fluid.io/v1alpha1",
    +				},
    +				ObjectMeta: v1.ObjectMeta{
    +					Name: "complete-dataset",
    +					UID:  "uid-complete",
    +				},
    +			},
    +			expectedKind:       "Dataset",
    +			expectedAPIVersion: "data.fluid.io/v1alpha1",
    +		},
    +		"dataset with empty TypeMeta": {
    +			dataset: &datav1alpha1.Dataset{
    +				ObjectMeta: v1.ObjectMeta{
    +					Name: "empty-typemeta-dataset",
    +					UID:  "uid-empty",
    +				},
    +			},
    +			expectedKind:       "Dataset",
    +			expectedAPIVersion: "data.fluid.io/v1alpha1",
    +		},
    +		"dataset with only Kind in TypeMeta": {
    +			dataset: &datav1alpha1.Dataset{
    +				TypeMeta: v1.TypeMeta{
    +					Kind: "Dataset",
    +				},
    +				ObjectMeta: v1.ObjectMeta{
    +					Name: "kind-only-dataset",
    +					UID:  "uid-kind",
    +				},
    +			},
    +			expectedKind:       "Dataset",
    +			expectedAPIVersion: "data.fluid.io/v1alpha1",
    +		},
    +		"dataset with only APIVersion in TypeMeta": {
    +			dataset: &datav1alpha1.Dataset{
    +				TypeMeta: v1.TypeMeta{
    +					APIVersion: "data.fluid.io/v1alpha1",
    +				},
    +				ObjectMeta: v1.ObjectMeta{
    +					Name: "apiversion-only-dataset",
    +					UID:  "uid-apiversion",
    +				},
    +			},
    +			expectedKind:       "Dataset",
    +			expectedAPIVersion: "data.fluid.io/v1alpha1",
    +		},
    +		"dataset with custom APIVersion in TypeMeta": {
    +			dataset: &datav1alpha1.Dataset{
    +				TypeMeta: v1.TypeMeta{
    +					Kind:       "Dataset",
    +					APIVersion: "data.fluid.io/v1beta1",
    +				},
    +				ObjectMeta: v1.ObjectMeta{
    +					Name: "custom-apiversion-dataset",
    +					UID:  "uid-custom",
    +				},
    +			},
    +			expectedKind:       "Dataset",
    +			expectedAPIVersion: "data.fluid.io/v1beta1",
    +		},
    +	}
    +
    +	for name, tc := range testCases {
    +		t.Run(name, func(t *testing.T) {
    +			ownerRef := datasetControllerOwnerReference(tc.dataset)
    +			if ownerRef.Kind != tc.expectedKind {
    +				t.Errorf("expected Kind %s, got %s", tc.expectedKind, ownerRef.Kind)
    +			}
    +			if ownerRef.APIVersion != tc.expectedAPIVersion {
    +				t.Errorf("expected APIVersion %s, got %s", tc.expectedAPIVersion, ownerRef.APIVersion)
    +			}

    The new "dataset with custom APIVersion" test cements pass-through of data.fluid.io/v1beta1 rather than normalization to the scheme's version. That matches the transformer's fill-only-missing-fields contract and is the conservative behavior — an object really can be of that version — but #6140's proposal 1 phrasing ("keeping the scheme lookup as the source of truth for both fields") could be read as wanting normalization. Could you confirm pass-through is the decision, so the test documents intent rather than an accident? Both reviewers independently confirmed the legacy implementation also passed a set apiVersion through verbatim, so this is a clarification, not a defect.

    cheyang cheyang commented on code on Oct 08, 2026 22:30 UTC
    Code Review
    pkg/utils/dataset_runtime_test.go:1
    @@ -193,3 +235,97 @@ func TestCreateRuntimeForReferenceDatasetIfNotExist(t *testing.T) {
     		t.Errorf("expected no ownerReference set on the terminating thinRuntime, but got %v", terminatingRuntime.GetOwnerReferences())
     	}
     }
    +
    +func TestDatasetControllerOwnerReference(t *testing.T) {

    The committed tests pass unchanged when dataset_runtime.go is reverted to the pre-PR implementation (verified independently by both reviewers by running the PR's tests against the base implementation), so a future refactor that quietly drops the delegation and re-introduces a divergent local copy would not trip any committed test. This was already requested in a previous review round as a differential test with the legacy implementation as oracle. One is built and proven on the verification branch (pkg/utils/dataset_runtime_ownerref_verify_test.go: 11 reachable TypeMeta shapes asserted identical, 3 malformed shapes pinned to the normalized output, mutation-checked — removing the recovery fails 8/11 equivalence subtests); it is additive and can be uplifted as-is.

    cheyang cheyang commented on code on Oct 08, 2026 22:30 UTC
    Code Review
    pkg/utils/transformer/owner_reference_test.go:1
    @@ -239,14 +239,46 @@ var _ = Describe("GenerateOwnerReferenceFromObject", func() {
     			},
     			"DataLoad",
     		),
    +
    +		Entry("should recover the apiVersion of a dataset when only the kind is set",
    +			&datav1alpha1.Dataset{
    +				TypeMeta:   metav1.TypeMeta{Kind: "Dataset"},
    +				ObjectMeta: metav1.ObjectMeta{Name: "kind-only-dataset", Namespace: "default", UID: "uid-6"},

    The new table entries cover only-kind-set and only-apiVersion-set (with the full group/version string). The remaining partial shape — an apiVersion carrying a version but no group (APIVersion: "v1alpha1"), where the current recovery leaves the group empty and the reference malformed (see the finding above) — has no entry. Once the group gating is fixed, add entries for it; the verification branch already contains the failing contract test to copy.

    cheyang cheyang commented on code on Oct 08, 2026 22:30 UTC
    Code Review
    pkg/utils/dataset_runtime_test.go:1
    @@ -193,3 +235,97 @@ func TestCreateRuntimeForReferenceDatasetIfNotExist(t *testing.T) {
     		t.Errorf("expected no ownerReference set on the terminating thinRuntime, but got %v", terminatingRuntime.GetOwnerReferences())
     	}
     }
    +
    +func TestDatasetControllerOwnerReference(t *testing.T) {
    +	testCases := map[string]struct {
    +		dataset            *datav1alpha1.Dataset
    +		expectedKind       string
    +		expectedAPIVersion string
    +	}{
    +		"dataset with complete TypeMeta": {
    +			dataset: &datav1alpha1.Dataset{
    +				TypeMeta: v1.TypeMeta{
    +					Kind:       "Dataset",
    +					APIVersion: "data.fluid.io/v1alpha1",
    +				},
    +				ObjectMeta: v1.ObjectMeta{
    +					Name: "complete-dataset",
    +					UID:  "uid-complete",
    +				},
    +			},
    +			expectedKind:       "Dataset",
    +			expectedAPIVersion: "data.fluid.io/v1alpha1",
    +		},
    +		"dataset with empty TypeMeta": {
    +			dataset: &datav1alpha1.Dataset{
    +				ObjectMeta: v1.ObjectMeta{
    +					Name: "empty-typemeta-dataset",
    +					UID:  "uid-empty",
    +				},
    +			},
    +			expectedKind:       "Dataset",
    +			expectedAPIVersion: "data.fluid.io/v1alpha1",
    +		},
    +		"dataset with only Kind in TypeMeta": {
    +			dataset: &datav1alpha1.Dataset{
    +				TypeMeta: v1.TypeMeta{
    +					Kind: "Dataset",
    +				},
    +				ObjectMeta: v1.ObjectMeta{
    +					Name: "kind-only-dataset",
    +					UID:  "uid-kind",
    +				},
    +			},
    +			expectedKind:       "Dataset",
    +			expectedAPIVersion: "data.fluid.io/v1alpha1",
    +		},
    +		"dataset with only APIVersion in TypeMeta": {
    +			dataset: &datav1alpha1.Dataset{
    +				TypeMeta: v1.TypeMeta{
    +					APIVersion: "data.fluid.io/v1alpha1",
    +				},
    +				ObjectMeta: v1.ObjectMeta{
    +					Name: "apiversion-only-dataset",
    +					UID:  "uid-apiversion",
    +				},
    +			},
    +			expectedKind:       "Dataset",
    +			expectedAPIVersion: "data.fluid.io/v1alpha1",
    +		},
    +		"dataset with custom APIVersion in TypeMeta": {

    The five-case table only covers shapes where pre-PR and post-PR behavior are identical. The one shape whose behavior intentionally changed — a malformed apiVersion with a group but no version (data.fluid.io/), previously copied verbatim into an ownerReference a real API server rejects, now normalized to data.fluid.io/v1alpha1 — has no committed coverage. One more table entry pinning expectedAPIVersion: "data.fluid.io/v1alpha1" for that input would document the deliberate improvement.

    cheyang cheyang commented on Oct 08, 2026 22:31 UTC
    Reviewer

    Both reviewers independently confirmed the premise and the core safety of this change: issue #6140's per-field recovery and failure logging already landed on master via #6139, and this PR delivers exactly the remainder — delegating datasetControllerOwnerReference to the shared transformer helper plus partial-TypeMeta regression coverage — with the delegation proven behavior-preserving against a verbatim copy of the old implementation (contract tests, an 11-shape differential with a mutation check, and envtest end-to-end against a real API server on both verification branches). What remains is follow-up material, not blockers: the transformer still never recovers the Group when the Version is set, so a group-less apiVersion ("v1alpha1") mints a malformed ownerReference — pre-existing on base, not a regression from this PR, with a compatible one-line fix sketched on the verification branch; the committed tests pin the behavior contract but not the convergence itself (they pass against the old implementation too — an upliftable differential test is built and proven to bite); and the one intentional improvement (malformed data.fluid.io/ now normalized) plus the intent behind stale-version pass-through deserve a pin and a confirmation respectively. On the debated points there was full agreement — every finding was confirmed by both sides, nothing rebutted. Copilot (advisory) raised no findings on this head.

    frenemy17 frenemy17 commented on Oct 09, 2026 07:00 UTC
    Author

    Thanks for the thorough verification run!

    To answer your question: yes, passing through custom versions like v1beta1 is intentional to stick with the fill-only-missing-fields contract.

    Just pushed an update:

  • Added a test case in TestDatasetControllerOwnerReference for the data.fluid.io/ shape to pin the normalization to data.fluid.io/v1alpha1.
  • Happy to open a follow-up PR for the group-recovery improvement whenever you're ready.

    Reviewers
    Assignees
    frenemy17 frenemy17
    Labels
    risk: low confidence: 92.2% 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: 37.6% (MEDIUM) · Higher = larger blast radius
    37.6%
    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: 92.2% · Lower = rushed or shallow review
    92.2%
    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: 2.9% · Safe to merge
    2.9%