Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added more debug log verbosity #76

Merged
merged 4 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ outputs:

runs:
using: 'docker'
image: 'docker://ghcr.io/paritytech/review-bot/action:1.0.0'
image: 'docker://ghcr.io/paritytech/review-bot/action:1.0.1'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "review-bot",
"version": "1.0.0",
"version": "1.0.1",
"description": "Have custom review rules for PRs with auto assignment",
"main": "src/index.ts",
"scripts": {
Expand Down
10 changes: 6 additions & 4 deletions src/github/pullRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,16 @@ export class PullRequestApi {
const approvals = latestReviews.filter((review) => caseInsensitiveEqual(review.state, "approved"));
this.usersThatApprovedThePr = approvals.map((approval) => approval.user.login);
}
this.logger.debug(`PR approvals are ${JSON.stringify(this.usersThatApprovedThePr)}`);

const approvals = this.usersThatApprovedThePr;

if (countAuthor) {
// If this value is true, we add the author to the list of approvals
return [...this.usersThatApprovedThePr, this.pr.user.login];
this.logger.info("Counting author in list of approvals");
approvals.push(this.pr.user.login);
}
this.logger.debug(`PR approvals are ${JSON.stringify(approvals)}`);

return this.usersThatApprovedThePr;
return approvals;
}

/** Returns the login of the PR's author */
Expand Down
1 change: 1 addition & 0 deletions src/github/teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class GitHubTeamsApi implements TeamApi {
this.logger.debug(`Fetching team '${teamName}'`);
const { data } = await this.api.rest.teams.listMembersInOrg({ org: this.org, team_slug: teamName });
const members = data.map((d) => d.login);
this.logger.debug(`Members are ${JSON.stringify(members)}`);
this.teamsCache.set(teamName, members);
}
return this.teamsCache.get(teamName) as string[];
Expand Down
Loading