feat(issue-70): additional pr comments

This commit is contained in:
Andrea Lamparelli 2023-07-27 12:31:04 +02:00
parent 10a46551ee
commit bed7e29ddc
20 changed files with 424 additions and 16 deletions

View file

@ -117,6 +117,19 @@ export default class GitHubClient implements GitClient {
);
}
if (backport.comments.length > 0) {
backport.comments.forEach(c => {
promises.push(
this.octokit.issues.createComment({
owner: backport.owner,
repo: backport.repo,
issue_number: (data as PullRequest).number,
body: c,
}).catch(error => this.logger.error(`Error posting comment: ${error}`))
);
});
}
await Promise.all(promises);
return data.html_url;

View file

@ -96,6 +96,18 @@ export default class GitLabClient implements GitClient {
);
}
// comments
if (backport.comments.length > 0) {
this.logger.info("Posting comments: " + backport.comments);
backport.comments.forEach(c => {
promises.push(
this.client.post(`/projects/${projectId}/merge_requests/${mr.iid}/notes`, {
body: c,
}).catch(error => this.logger.warn("Failure trying to post comment. " + error))
);
});
}
// reviewers
const reviewerIds = await Promise.all(backport.reviewers.map(async r => {
this.logger.debug("Retrieving user: " + r);