Skip to content

chore(recipe): remove back-compat shims introduced by #1107 #1114

Description

@mchmarny

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:37recipe.LoadFromFile
  • pkg/config/resolve.go:618 and :633recipe.DefaultRegistry() and ResolveCriteria wrapper itself
  • pkg/validator/catalog/catalog.go:74recipe.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

  • All shims listed above deleted from production code.
  • All in-tree callers updated to the per-provider variant.
  • No //nolint:staticcheck // back-compat fallback for pre-WithDataProvider callers (#983 Stage 2) directives remain in the tree.
  • Test asserting no in-tree caller imports the removed symbols (e.g., a go test -run TestNoShimImports walking the module).
  • Release notes call out the breaking change for external Go importers; docs/integrator/public-api.md updated to remove the deprecated symbols.
  • make qualify clean.

Out of scope

Related

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions