Skip to content

Remove deprecated pkg/resolution/resolver/ and consolidate into pkg/remoteresolution/resolver/ #9617

@vdemeester

Description

@vdemeester

Summary

The resolution framework has two parallel package trees that serve the same purpose:

  • pkg/resolution/resolver/ — the original framework (2022), now marked deprecated on all exported types
  • pkg/remoteresolution/resolver/ — the upgraded framework (2024), intended replacement

The new package was introduced to change the Resolver interface from accepting []pipelinev1.Param to *v1beta1.ResolutionRequestSpec, giving resolvers access to the full request spec (including URL-based resolution). However, the migration was never completed — the new package heavily imports from and delegates business logic to the old one.

This creates confusion for contributors and out-of-tree resolver authors about which package to use, and adds maintenance burden of keeping two parallel codebases in sync.

Current State

The remoteresolution package depends on the old resolution package for:

  1. Shared types/interfaces: ResolvedResource, ConfigWatcher, TimedResolution, ConfigStore — all defined in the old framework package
  2. Business logic: Each new resolver delegates core work to the old one:
    • remoteresolution/bundle → calls resolution/bundle.ResolveRequest(), ValidateParams()
    • remoteresolution/cluster → calls resolution/cluster.ResolveFromParams(), ValidateParams()
    • remoteresolution/git → imports resolution/git for config, SCM logic
    • remoteresolution/http → imports resolution/http for config, fetch logic
    • remoteresolution/hub → imports resolution/hub for config, API client logic
  3. Constants: All config map names, param names, and annotation keys live in the old package

Scope

  • Old package: ~4,100 lines production code + ~4,800 lines tests across 37 Go files
  • The demoresolver template still uses the old interface
  • The new resolver template imports from both packages

Proposed Approach

This can be done incrementally across multiple PRs:

  1. Move shared types and utilities (ResolvedResource, ConfigWatcher, TimedResolution, ConfigStore, etc.) into pkg/remoteresolution/resolver/framework/
  2. Inline resolver business logic — one PR per resolver (bundle, cluster, git, http, hub) to move the actual implementation from pkg/resolution/resolver/<type>/ into pkg/remoteresolution/resolver/<type>/, eliminating the delegation pattern
  3. Update consumerscmd/resolvers/main.go, doc templates, test resolvers
  4. Delete pkg/resolution/resolver/ and update documentation

Breaking Change for Out-of-Tree Resolvers

This is a breaking change for any external resolver importing pkg/resolution/resolver/. Known consumers:

  • Custom/community resolvers using the old Resolver interface (ValidateParams/Resolve with []Param)
  • The old ResolvedResource interface import path changes

We should announce this deprecation removal in advance and provide a migration guide (the new resolver template in docs/resolver-template/cmd/resolver/ already demonstrates the new interface).

Acceptance Criteria

  • pkg/resolution/resolver/ is fully removed
  • pkg/remoteresolution/resolver/ is self-contained (no imports from old package)
  • All built-in resolvers work correctly
  • Resolver templates use only the new package
  • Documentation updated with new import paths
  • Release notes document the breaking change

/kind cleanup

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions