Summary
Remove the back-compat shims pkg/recipe and pkg/validator/catalog retained from #1107 so the deprecated package-global path is gone. All in-tree callers were migrated by #1108; external Go importers will need to update their call sites.
Motivation
#1107 introduced per-DataProvider isolation for the recipe loader, catalog loader, criteria registry, and config resolution — but kept the legacy entry points as thin wrappers calling recipe.GetDataProvider() so #1108 could land without forcing every caller to migrate in lockstep.
Now that #1108 has shipped and all in-tree callers (pkg/cli, pkg/api) consume the per-provider path through pkg/client/v1.Client, the shims serve no in-tree purpose. Keeping them invites new code to reach for the global path and leaks the deprecated SetDataProvider / GetDataProvider symbols into the pkg/recipe Public (evolving) surface indefinitely.
This is the deferred Stage 2 of #983.
Shims to remove (or hard-deprecate then remove)
| Symbol |
Location |
Replacement |
recipe.SetDataProvider(dp) |
pkg/recipe/provider.go |
recipe.NewBuilder(recipe.WithDataProvider(dp)) |
recipe.GetDataProvider() |
pkg/recipe/provider.go |
hold a DataProvider reference; pass it explicitly |
recipe.DefaultRegistry() |
pkg/recipe/criteria_registry.go |
recipe.GetCriteriaRegistryFor(dp) |
recipe.ParseCriteriaServiceType / …Accelerator / …Intent / …OS / …Platform |
pkg/recipe/criteria.go |
(*CriteriaRegistry).ParseService(s) and siblings |
recipe.LoadFromFile(ctx, path, kubeconfig, version) |
pkg/recipe/loader.go |
recipe.LoadFromFileWithProvider(ctx, path, kubeconfig, version, dp) |
catalog.Load(version, commit) |
pkg/validator/catalog/catalog.go |
catalog.LoadWithDataProvider(dp, version, commit) |
(*RecipeSpec).ResolveCriteria() |
pkg/config/resolve.go |
(*RecipeSpec).ResolveCriteriaWithRegistry(reg) |
recipe.BuildCriteria(opts...) + recipe.WithService / …Accelerator / …Intent / …OS / …Platform / …Nodes |
pkg/recipe/criteria.go |
recipe.BuildCriteriaWithRegistry(reg, opts...) + recipe.WithServiceRegistry(s) and siblings |
Each call site removal will surface its own // back-compat fallback for pre-WithDataProvider callers (#983 Stage 2) //nolint:staticcheck comment for deletion.
In-tree callers still on shims (last check 2026-05-29)
pkg/evidence/attestation/recipe_digest.go:37 — recipe.LoadFromFile
pkg/config/resolve.go:618 and :633 — recipe.DefaultRegistry() and ResolveCriteria wrapper itself
pkg/validator/catalog/catalog.go:74 — recipe.GetDataProvider() fallback inside LoadWithDataProvider
- (audit needed) any
pkg/cli/* or pkg/api/* callers that haven't been re-routed
A complete migration audit is the first concrete deliverable.
Acceptance
Out of scope
Related
Summary
Remove the back-compat shims
pkg/recipeandpkg/validator/catalogretained from #1107 so the deprecated package-global path is gone. All in-tree callers were migrated by #1108; external Go importers will need to update their call sites.Motivation
#1107 introduced per-
DataProviderisolation for the recipe loader, catalog loader, criteria registry, and config resolution — but kept the legacy entry points as thin wrappers callingrecipe.GetDataProvider()so #1108 could land without forcing every caller to migrate in lockstep.Now that #1108 has shipped and all in-tree callers (
pkg/cli,pkg/api) consume the per-provider path throughpkg/client/v1.Client, the shims serve no in-tree purpose. Keeping them invites new code to reach for the global path and leaks the deprecatedSetDataProvider/GetDataProvidersymbols into thepkg/recipePublic (evolving) surface indefinitely.This is the deferred Stage 2 of #983.
Shims to remove (or hard-deprecate then remove)
recipe.SetDataProvider(dp)pkg/recipe/provider.gorecipe.NewBuilder(recipe.WithDataProvider(dp))recipe.GetDataProvider()pkg/recipe/provider.goDataProviderreference; pass it explicitlyrecipe.DefaultRegistry()pkg/recipe/criteria_registry.gorecipe.GetCriteriaRegistryFor(dp)recipe.ParseCriteriaServiceType/…Accelerator/…Intent/…OS/…Platformpkg/recipe/criteria.go(*CriteriaRegistry).ParseService(s)and siblingsrecipe.LoadFromFile(ctx, path, kubeconfig, version)pkg/recipe/loader.gorecipe.LoadFromFileWithProvider(ctx, path, kubeconfig, version, dp)catalog.Load(version, commit)pkg/validator/catalog/catalog.gocatalog.LoadWithDataProvider(dp, version, commit)(*RecipeSpec).ResolveCriteria()pkg/config/resolve.go(*RecipeSpec).ResolveCriteriaWithRegistry(reg)recipe.BuildCriteria(opts...)+recipe.WithService/…Accelerator/…Intent/…OS/…Platform/…Nodespkg/recipe/criteria.gorecipe.BuildCriteriaWithRegistry(reg, opts...)+recipe.WithServiceRegistry(s)and siblingsEach call site removal will surface its own
// back-compat fallback for pre-WithDataProvider callers (#983 Stage 2)//nolint:staticcheckcomment for deletion.In-tree callers still on shims (last check 2026-05-29)
pkg/evidence/attestation/recipe_digest.go:37—recipe.LoadFromFilepkg/config/resolve.go:618and:633—recipe.DefaultRegistry()andResolveCriteriawrapper itselfpkg/validator/catalog/catalog.go:74—recipe.GetDataProvider()fallback insideLoadWithDataProviderpkg/cli/*orpkg/api/*callers that haven't been re-routedA complete migration audit is the first concrete deliverable.
Acceptance
//nolint:staticcheck // back-compat fallback for pre-WithDataProvider callers (#983 Stage 2)directives remain in the tree.go test -run TestNoShimImportswalking the module).docs/integrator/public-api.mdupdated to remove the deprecated symbols.make qualifyclean.Out of scope
Recipe,AllowLists,Criteria,CriteriaRegistry) — tracked separately.DataProviderinterface (cancellable I/O) — tracked as feat(recipe): add context.Context to DataProvider interface for cancellable I/O #1109.Related
SetDataProviderStage 1 deprecation marker