Add a collector for bundled catalog components

What does this MR do and why?

First step of replacing compiled catalog bundles with collected ones: Gitlab::Ci::Catalog::Bundle::Collector gathers a component's entry file and every local: file it includes, as authored. It is not used yet; the next MR swaps it in for Gitlab::Ci::Catalog::Bundle::Compiler.

  • Walks only each file's top-level include: and ignores rules:, so rule-guarded files are collected too
  • Keys files the way File::Local reads them, without a leading slash
  • Rejects non-local: includes, locations only known when the pipeline runs, wildcard locations, spec:include, and rules:exists without project:
  • Rejects missing, empty or invalid files, and more files than ci_max_includes
  • Reports every rejection in one CollectError, naming the file and the include

References

How to set up and validate locally

  1. bundle exec rspec spec/lib/gitlab/ci/catalog/bundle/collector_spec.rb

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

Edited by Avielle Wolfe

Merge request reports

Loading
Loading