Skip to content

Commit 9550c33

Browse files
feat: add log messages for api-review/skip-delay label handling (#179)
1 parent 5be84e8 commit 9550c33

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/api-review-state.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,22 @@ export const hasAPIReviewRequestedLabel = (pr: PullRequest) =>
4747
export const getPRReadyDate = (pr: PullRequest) => {
4848
let readyTime = new Date(pr.created_at).getTime();
4949

50-
if (!pr.labels.some((l) => l.name === API_SKIP_DELAY_LABEL)) {
50+
if (pr.labels.some((l) => l.name === API_SKIP_DELAY_LABEL)) {
51+
log(
52+
'getPRReadyDate',
53+
LogLevel.INFO,
54+
`${pr.number} has "${API_SKIP_DELAY_LABEL}" label - skipping minimum open time`,
55+
);
56+
} else {
5157
const isMajorMinor = pr.labels.some((l) => isSemverMajorMinorLabel(l.name));
5258
readyTime += isMajorMinor ? MINIMUM_MINOR_OPEN_TIME : MINIMUM_PATCH_OPEN_TIME;
59+
log(
60+
'getPRReadyDate',
61+
LogLevel.INFO,
62+
`${pr.number} has no "${API_SKIP_DELAY_LABEL}" label - applying minimum open time for ${
63+
isMajorMinor ? 'major/minor' : 'patch'
64+
}`,
65+
);
5366
}
5467

5568
return new Date(readyTime).toISOString().split('T')[0];

0 commit comments

Comments
 (0)