Add header include configuration classes for CI
What does this MR do and why?
This code refactors the GitLab CI configuration system to reduce code duplication and improve organization. The changes extract common validation logic for "include" configurations into two reusable modules (BaseInclude and BaseIncludes) that can be shared across different parts of the system.
Previously, the same validation rules were written multiple times in different files. Now, these shared modules contain the common validation logic - like checking that local file paths aren't blank and that project includes specify which file to fetch. The existing Include and Includes classes were updated to use these shared modules instead of duplicating the validation code.
The changes also add new Header::Include and Header::Includes classes that handle include configurations specifically for CI pipeline headers, reusing the same validation logic through the shared modules.
Comprehensive test files were added to ensure the new header classes work correctly, testing various scenarios like valid configurations, empty values, unknown keywords, and different data types.
The overall result is cleaner, more maintainable code where validation rules are defined once and reused wherever needed, making it easier to update validation logic in the future.
Part of breaking down larger include functionality implementation.
This is the first MR of the lot.
References
The final big picture MR with working version of the spec:include feature - !197684 (closed)
Issue: #415636 (closed)
Screenshots or screen recordings
NA
How to set up and validate locally
- You should be able to use the
spec:include:localkeyword in the yaml, but it would not work in the final execution of pipeline yet.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #415636 (closed)