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