1515const LABEL_NAME = 'pr-quota-reached' ;
1616const LABEL_COLOR = 'CFD3D7' ;
1717
18+ /**
19+ * Format open/limit counts as a bullet-point status block
20+ * @param {number } openCount - Number of currently open PRs
21+ * @param {number } quota - Allowed quota
22+ * @returns {string } Formatted status string
23+ */
24+ function formatStatus ( openCount , quota ) {
25+ return ` * Open: ${ openCount } \n * Limit: ${ quota } ` ;
26+ }
27+
1828/**
1929 * Calculate the quota for a user based on their merged PR count
2030 * @param {number } mergedCount - Number of merged PRs
@@ -279,8 +289,7 @@ async function postBlockingComment(octokit, owner, repo, issueNumber, author, op
279289 }
280290
281291 const message = `Hi @${ author } , thanks for your contribution! To ensure quality reviews, we limit how many concurrent PRs new contributors can open:
282- * Open: ${ openCount }
283- * Limit: ${ quota }
292+ ${ formatStatus ( openCount , quota ) }
284293
285294This PR is currently **on hold**. We will automatically move this into the review queue once your existing PRs are merged or closed.
286295
@@ -303,9 +312,12 @@ Please see our [Contributing Guidelines](https://github.com/jaegertracing/jaeger
303312 * Always posts when called - if PR was blocked again after being unblocked, user should be notified again
304313 */
305314async function postUnblockingComment ( octokit , owner , repo , issueNumber , author , openCount , quota , logger ) {
306- const message = `PR quota unlocked! @${ author } , this PR has been moved out of the waiting room and into the active review queue. Thank you for your patience.
315+ const message = `PR quota unlocked!
316+
317+ @${ author } , this PR has been moved out of the waiting room and into the active review queue:
318+ ${ formatStatus ( openCount , quota ) }
307319
308- **Current Status:** ${ openCount } / ${ quota } open .`;
320+ Thank you for your patience .`;
309321
310322 try {
311323 await octokit . rest . issues . createComment ( {
@@ -399,6 +411,7 @@ if (typeof module !== 'undefined' && module.exports) {
399411 module . exports = githubActionHandler ;
400412
401413 // Named exports for testing and direct usage
414+ module . exports . formatStatus = formatStatus ;
402415 module . exports . calculateQuota = calculateQuota ;
403416 module . exports . fetchAuthorPRs = fetchAuthorPRs ;
404417 module . exports . processQuotaForAuthor = processQuotaForAuthor ;
0 commit comments