Skip to content

Commit 84022a6

Browse files
committed
chore: add more logs
1 parent 4c50b72 commit 84022a6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/bot.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export const robot = (app: Probot) => {
4646
const chat = await loadChat(context);
4747

4848
if (!chat) {
49+
console.log('Chat initialized fialed');
4950
return 'no chat';
5051
}
5152

@@ -56,6 +57,7 @@ export const robot = (app: Probot) => {
5657
pull_request.locked ||
5758
pull_request.draft
5859
) {
60+
console.log('invalid event paylod');
5961
return 'invalid event paylod';
6062
}
6163

@@ -65,6 +67,7 @@ export const robot = (app: Probot) => {
6567
(!pull_request.labels?.length ||
6668
pull_request.labels.every((label) => label.name !== target_label))
6769
) {
70+
console.log('no target label attached');
6871
return 'no target label attached';
6972
}
7073

@@ -96,6 +99,7 @@ export const robot = (app: Probot) => {
9699
}
97100

98101
if (!changedFiles?.length) {
102+
console.log('no target label attached');
99103
return 'no change';
100104
}
101105

@@ -110,6 +114,9 @@ export const robot = (app: Probot) => {
110114
}
111115

112116
if (!patch || patch.length > MAX_PATCH_COUNT) {
117+
console.log(
118+
`${file.filename} skipped caused by its diff is too large`
119+
);
113120
continue;
114121
}
115122
const res = await chat?.codeReview(patch);

0 commit comments

Comments
 (0)