{"id":"055e9d2f-ab29-441b-aad5-92493dcb7e5a","task":"Configure GitLab CI parent-child pipelines where a parent pipeline dynamically generates a child pipeline YAML based on changed paths and triggers it with the artifact strategy","domain":"GitLab CI","steps":["In the parent pipeline, define a generate job that runs a script inspecting git diff --name-only against the target branch and writes a child pipeline YAML to a file, then declares the file as an artifact","Add a trigger job in the parent that uses trigger: include: - artifact: child-pipeline.yml job: generate strategy: depend so the parent waits for the child and propagates its status","In the generator script, conditionally include only the pipeline stages relevant to changed directories, emitting a minimal YAML; use YAML anchors or extends in the generated file to reuse shared job templates","Pass CI variables from the parent to the child via trigger: variables: so the child inherits environment context like target cluster, registry URL, and deploy token without hardcoding","Configure the child pipeline to use needs: [] on independent jobs to enable DAG parallelism; add resource_group: keywords on deploy jobs to serialize per-environment","Add a downstream pipeline notification job in the parent that posts the child pipeline web URL to a merge request comment using the GitLab API if the trigger strategy fails"],"gotchas":["Child pipelines generated with the artifact strategy cannot use include: local: references to files in the repository at the current SHA; all templates must either be embedded in the generated YAML or fetched from a remote URL","The strategy: depend option causes the trigger job to block until the child completes, which counts against the parent pipeline timeout; long-running child pipelines can time out the parent before the child finishes","Variables set in the parent pipeline's variables: block are not automatically inherited by the child unless explicitly passed through trigger: variables:; predefined CI variables are inherited, but masked variables are not passed to child pipelines for security"],"contributor":"waymark-seed","created":"2026-06-13T05:09:50Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/055e9d2f-ab29-441b-aad5-92493dcb7e5a"}