job 1 ________ child-pipeline ________ job 3 (x)
/ \
job 2 __/ \___ job 4
I'm trying to reach the artifact of job 3
. Here is where I reached so far:
I need the ID of the job 3
according to the GitLab docs. I use Gitbeaker to simplify things in NodeJS but if you are not familiar with it it's fine to answer with curl examples.
First, I got the pipelines of the commit then I retrieved the jobs of those pipelines but those gave me only job 1
and job 2
even though the docs says "In GitLab 13.3 and later, this endpoint returns data for any pipeline including child pipelines. (ref)"
api.Pipelines.all(PROJECT_ID, {
sha: 'commit_sha',
ref: 'master',
}).then(async (commitPipelines) => {
for await (const pipeline of commitPipelines) {
api.Jobs.showPipelineJobs(PROJECT_ID, pipeline.id, {
scope: 'success',
}).then((pipelineJobs) => {
console.log(pipelineJobs);
});
}
});
Then I picked another route to get the commit status of on the child-pipelines
stage assuming I would get the pipeline IDs of the child pipelines and I would reach the jobs of them. But the IDs that I got were not the pipeline IDs.
api.Commits.status(PROJECT_ID, 'commit_sha', {
stage: 'child-pipelines',
ref: 'master',
}).then((state) => {
state.forEach(async (commitStatus) => {
if (commitStatus.status === 'success') {
console.log(commitStatus);
}
});
});
In the end, both of my approaches got stuck at the child pipelines. Maybe, I overlook at this. Any suggestions?