Job Trigger Limitations: Enable Conditional Pipeline Inputs and Cross-Project Template Support
Problem to solve
We maintain a manifest repository that tracks versions of all release components (images, puppet-modules, RPMs, etc.). When a project updates any component, it triggers a pipeline in the manifest repo to record the changes. However, the required inputs vary depending on the component type being updated, which creates the problems outlined below with GitLab's current pipeline triggering and input handling capabilities.
- Inputs cannot be conditionally required - A single pipeline must accept ALL inputs regardless of use case (image manifest, puppet-module, or RPM), forcing all fields to be optional when some should be required
 - Cannot trigger specific pipeline files - Triggering jobs can only invoke the default pipeline, not specific pipeline YAML files. Branch-based workarounds are fragile and error-prone
 - Inputs cannot be evaluated in rules sections - Cannot use conditional logic like rules: if: $inputs.job_type == "image" to selectively include jobs or steps based on input values
 - Cross-project pipeline references not supported - Cannot have Project A trigger a pipeline in Project B that uses templates/jobs from Project C, forcing code duplication
 - No upstream context passed to triggered jobs - Critical values like COMMIT_REF, PROJECT_NAME, and PROJECT_PATH from triggering pipelines are not automatically available in downstream jobs
 - Variables are the only workaround - Currently forced to use variables with manual validation instead of proper input structures
 
Proposal
- Add conditional input requirements - Enable required: when: syntax to make inputs conditionally required based on rules
 - Allow triggering specific pipeline files - Enable triggers to specify target pipeline files (similar to existing local include trigger capability)
 - Support input evaluation in rules - Allow checking input values within rules: sections to conditionally execute jobs/includes
 - Enable cross-project template references - Allow Project A → Project B pipelines to reference files from Project C for shared templates
 - Auto-pass upstream context variables - Provide UPSTREAM_COMMIT_REF, UPSTREAM_PROJECT_NAME, etc. as built-in variables in triggered pipelines (could be arrays for multi-level chains)