(pullRequest: AzurePullRequest, labels: string[])
| 738 | } |
| 739 | |
| 740 | async updatePullRequestLabels(pullRequest: AzurePullRequest, labels: string[]) { |
| 741 | const cmsLabels = pullRequest.labels.filter(l => isCMSLabel(l.name, this.cmsLabelPrefix)); |
| 742 | await Promise.all( |
| 743 | cmsLabels.map(l => { |
| 744 | return this.requestText({ |
| 745 | method: 'DELETE', |
| 746 | url: `${this.endpointUrl}/pullrequests/${encodeURIComponent( |
| 747 | pullRequest.pullRequestId, |
| 748 | )}/labels/${encodeURIComponent(l.id)}`, |
| 749 | }); |
| 750 | }), |
| 751 | ); |
| 752 | |
| 753 | await Promise.all( |
| 754 | labels.map(l => { |
| 755 | return this.requestText({ |
| 756 | method: 'POST', |
| 757 | url: `${this.endpointUrl}/pullrequests/${encodeURIComponent( |
| 758 | pullRequest.pullRequestId, |
| 759 | )}/labels`, |
| 760 | body: JSON.stringify({ name: l }), |
| 761 | }); |
| 762 | }), |
| 763 | ); |
| 764 | } |
| 765 | |
| 766 | async completePullRequest(pullRequest: AzurePullRequest) { |
| 767 | const pullRequestCompletion = { |
no test coverage detected