Collect catalog bundles instead of compiling them

What does this MR do and why?

Replaces compiled (flattened) catalog bundles with collected ones: each component's files are stored as authored. Nothing calls these services yet; wiring into publishing comes in a follow-up MR.

  • Gitlab::Ci::Catalog::Bundle::Format dumps bundle format version 1 as JSON, keeping the collected YAML as opaque strings so files round-trip byte for byte
  • Ci::Catalog::Resources::Bundle::CollectService replaces CompileService, returning one bundle per component or every rejection prefixed with its component name
  • Ci::Catalog::BundledResources::CollectAndStoreService (renamed from CompileAndStoreService) stores the bundles, rejects non-public projects because any project on a Cell can read a bundle, and does nothing for an already collected version
  • CollectAndStoreService#prepare and #persist are public, so publishing can upload before its transaction and write the rows inside it
  • Bundle::ObjectKey names objects <component>.json, uploaded as application/json
  • Removes Bundle::Compiler, CompileService and their specs, since collection supersedes them

References

How to set up and validate locally

  1. bundle exec rspec spec/lib/gitlab/ci/catalog/bundle/format_spec.rb spec/services/ci/catalog/resources/bundle/collect_service_spec.rb spec/services/ci/catalog/bundled_resources/collect_and_store_service_spec.rb spec/lib/gitlab/ci/catalog/bundle/object_key_spec.rb spec/uploaders/ci/catalog/bundled_resources/component_uploader_spec.rb

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

Merge request reports

Loading
Loading