feat(driver): validate Loader compatibility with Driver across the boundary#27516
feat(driver): validate Loader compatibility with Driver across the boundary#27516agarwal-navin wants to merge 2 commits into
Conversation
…undary Add bidirectional layer-compatibility validation across the Driver / Loader boundary. Previously the Loader only validated that the Driver was compatible with it. The Driver has no reference to the Loader, so it now publishes the requirements the Loader must meet via a new ILayerCompatSupportRequirements FluidObject (exposed on each driver's document service factory), and the Loader validates itself against them on the Driver's behalf via the new validateLoaderCompatibilityWithDriver function. Also fix the Driver-boundary check reusing loaderCompatDetailsForRuntime by adding a dedicated loaderCompatDetailsForDriver, and add reverse-direction coverage to the unit tests and the end-to-end layer-compat suite. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (635 lines, 27 files), I've queued these reviewers:
How this works
|
🔭 PR Review Fleet ReportNote This report is generated by an experimental AI review fleet and is provided as a beta feature. Findings are a starting point for discussion, not a gate. Use your own judgement. Verdict: 0 Disastrous, 0 Dangerous, 1 Disagreeable Findings
|
Can we write out the implications of the fact that for years, old loaders (before this change) will not be validating this compatibility? Related - would be helpful to explicitly state in the PR description and existing layer compat MD files why we want old loaders to give up if the driver is too much newer. You mention that drivers don't hold a reference to the Loader, so explaining that even so, this matters, would be good. |
Update the Loader ↔ Driver boundary section to reflect that the boundary is now validated in both directions: the Driver publishes the requirements the Loader must meet, and the Loader validates itself against them on the Driver's behalf. Adds the reverse arrow to the diagram, updates the per-layer Validates/Validated By summaries, and adds a note about the edge case where a pre-validation layer paired with a newer layer can still fail in the feature's own failure mode rather than as a layerIncompatibilityError. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output |
| @@ -117,10 +130,48 @@ export function validateDriverCompatibility( | |||
| validateLayerCompatibility( | |||
| "loader", | |||
| "driver", | |||
| loaderCompatDetailsForRuntime, | |||
| loaderCompatDetailsForDriver, | |||
There was a problem hiding this comment.
Any hard thinking we need to do on back compat here? Like, for loaders before this fix, the driver compatibility check is basically going to arbitrarily be right or wrong. We should probably enumerate (for our own sake) the set of loader-driver-runtime version combos that will be false positives or false negatives for this validation.
| validateLayerCompatibility( | ||
| "driver", | ||
| "loader", | ||
| maybeDriverCompatDetails ?? defaultLayerCompatDetails, |
There was a problem hiding this comment.
Side note: This always surprises me seeing "layer 1"'s compat details passed in.
Maybe would be more self-documenting if its signature were something like this:
function validateLayerCompatibility(
layer1: {
layer: FluidLayer;
versionInfo: Pick<ILayerCompatDetails, "pkgVersion" | "generation">;
compatSupportRequirements: ILayerCompatSupportRequirements;
},
layer2: {
layer: FluidLayer;
compatDetails: ILayerCompatDetails | undefined;
strictCompatibilityCheck?: boolean;
},
context: {
disposeFn: (error?: IErrorBase) => void;
mc: MonitoringContext;
},
): void
Description
This adds bidirectional layer-compatibility validation across the Driver / Loader boundary.
Previously the Loader only validated that the Driver was compatible with it (
validateDriverCompatibility). The reverse — that the Loader is compatible with the Driver — was never checked, because the Driver holds no reference to the Loader and so cannot validate it.To close that gap without inverting the layer hierarchy, the Driver now publishes the requirements the Loader must meet via a new
ILayerCompatSupportRequirementsFluidObjectexposed on each driver'sIDocumentServiceFactory. The Loader reads those requirements and validates itself against them on the Driver's behalf, via the newvalidateLoaderCompatibilityWithDriverfunction. Both directions now run from theContainerconstructor.Also included:
loaderCompatDetailsForRuntime; it now uses a dedicatedloaderCompatDetailsForDriver.IProvideLayerCompatSupportRequirementsprovider (rather than embedding requirements inILayerCompatDetails), keeping "what I am" and "what I require of you" distinct.container-loader, and the reverse (driver -> loader) direction added to the end-to-endlayerCompatsuite (runs per driver type across both create and load flows).The new
ILayerCompatSupportRequirementsproperty onLocalDocumentServiceFactoryandOdspDocumentServiceFactoryCoremirrors the existingILayerCompatDetailsproperty (added in #25120). A changeset is included.Reviewer Guidance
The review process is outlined on this wiki page.
🤖 Generated with Claude Code
AB#58900