Skip to content

Commit

Permalink
chore: add metric log
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed Dec 20, 2023
1 parent e91c501 commit fa08227
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ working
*.pem
package-lock.json
yarn-error.log
.DS_Store
.DS_Store
.envrc
15 changes: 12 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ const tryBackportAllCommits = async (opts: TryBackportOptions) => {
await context.octokit.issues.createComment(
context.repo({
issue_number: opts.pr.number,
body: 'This PR has exceeded the automatic backport commit limit \
body:
'This PR has exceeded the automatic backport commit limit \
and must be performed manually.',
}),
);
Expand Down Expand Up @@ -356,8 +357,9 @@ const checkUserHasWriteAccess = async (
);

const params = context.repo({ username: user });
const { data: userInfo } =
await context.octokit.repos.getCollaboratorPermissionLevel(params);
const {
data: userInfo,
} = await context.octokit.repos.getCollaboratorPermissionLevel(params);

// Possible values for the permission key: 'admin', 'write', 'read', 'none'.
// In order for the user's review to count, they must be at least 'write'.
Expand Down Expand Up @@ -522,6 +524,13 @@ export const backportImpl = async (
end();
}

console.log({
msg: 'backport-result',
pullRequest: pr.number,
backportPurpose: purpose,
success,
});

// Throw if neither succeeded - if we don't we
// never enter the ErrorExecutor and the check hangs.
if (!success) {
Expand Down

0 comments on commit fa08227

Please sign in to comment.