Loading
Resolve official components through the bundle path in pipeline creation
What does this MR do and why?
Part of #628309 (closed).
Pipeline creation still resolves every include: component: through the source project, even when the cell already has a bundle for that component version. This MR connects the bundle to pipeline creation, behind the ci_resolve_components_from_bundle feature flag (default off).
InstancePath#fetch_content!checks for a bundled version before it looks up the project or the SHA. On a match, it returns the entry file from the bundle, andFetchServicereturns the bundle in place ofprojectandsha. This is the payload that !262212 (merged) already reads.~latestand partial semver (1,1.2) references resolve against bundled versions. The source path and the bundle path share one version matcher (version_match), so both accept the same formats.Ci::Catalog::BundledResources::Version.latestnow takesmajorandminor, the same asCi::Catalog::Resources::Version.latest. Both exclude prereleases.- When no bundled version matches, resolution falls back to the source project, as today.
- The bundle lookup is cached per request with
SafeRequestStore, so a component included twice in one pipeline is read once. - Bundles exist only for GitLab-maintained components, so other components always use the source path.
How to set up and validate locally
bin/rspec spec/lib/gitlab/ci/components/instance_path_spec.rb \
spec/services/ci/components/fetch_service_spec.rb \
spec/services/ci/create_pipeline_service/bundled_components_spec.rb \
spec/models/ci/catalog/bundled_resources/version_spec.rbbundled_components_spec.rb creates the same pipeline twice, from the source project and from a stored bundle, and checks that both have the same jobs, options and variables. It also checks that the bundle path never resolves the source SHA. That example fails without this change.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist.
Closes #628309 (closed)