File tree Expand file tree Collapse file tree 1 file changed +21
-13
lines changed Expand file tree Collapse file tree 1 file changed +21
-13
lines changed Original file line number Diff line number Diff line change @@ -44,19 +44,27 @@ export class GitlabCIClient implements GitlabCIApi {
4444 async getPipelineSummary (
4545 projectID ?: string ,
4646 ) : Promise < PipelineSummary | undefined > {
47- const pipelineObjects = await this . callApi < PipelineObject [ ] > (
48- 'projects/' + projectID + '/pipelines' ,
49- { } ,
50- ) ;
51- let projectObj : any = await this . callApi < Object > (
52- 'projects/' + projectID ,
53- { } ,
54- ) ;
55- if ( pipelineObjects ) {
56- pipelineObjects . forEach ( ( element : PipelineObject ) => {
57- element . project_name = projectObj ?. name ;
58- } ) ;
59- }
47+
48+ const [ pipelines , projectObj ] = await Promise . all ( [
49+ this . callApi < PipelineObject [ ] > (
50+ 'projects/' + projectID + '/pipelines' ,
51+ { } ,
52+ ) ,
53+ this . callApi < Object > (
54+ 'projects/' + projectID ,
55+ { } ,
56+ )
57+ ] ) ;
58+
59+ const pipelineObjects : PipelineObject [ ] = await Promise . all ( pipelines . map ( async ( { id } ) => {
60+ const pipeline = await this . callApi < PipelineObject > (
61+ `projects/${ projectID } /pipelines/${ id } ` ,
62+ { } ,
63+ ) as PipelineObject ;
64+ pipeline . project_name = ( projectObj as any ) ?. name ;
65+ return pipeline ;
66+ } ) ) ;
67+
6068 return {
6169 getPipelinesData : pipelineObjects ! ,
6270 } ;
You can’t perform that action at this time.
0 commit comments