diff --git a/services/coderabbit/coderabbit-pull-request.service.js b/services/coderabbit/coderabbit-pull-request.service.js index 1ccea952b90ca..75a53e8db9252 100644 --- a/services/coderabbit/coderabbit-pull-request.service.js +++ b/services/coderabbit/coderabbit-pull-request.service.js @@ -1,5 +1,6 @@ import Joi from 'joi' import { BaseJsonService, pathParams } from '../index.js' +import { metric } from '../text-formatters.js' const schema = Joi.object({ reviews: Joi.number().required(), @@ -46,7 +47,7 @@ class CodeRabbitPullRequest extends BaseJsonService { static render({ reviews }) { return { - message: `${reviews}`, + message: metric(reviews), color: 'blue', } } diff --git a/services/coderabbit/coderabbit-pull-request.tester.js b/services/coderabbit/coderabbit-pull-request.tester.js index a7da6f70ce099..9fa96b594de81 100644 --- a/services/coderabbit/coderabbit-pull-request.tester.js +++ b/services/coderabbit/coderabbit-pull-request.tester.js @@ -1,5 +1,5 @@ -import Joi from 'joi' import { createServiceTester } from '../tester.js' +import { isMetric } from '../test-validators.js' export const t = await createServiceTester() @@ -7,7 +7,7 @@ t.create('live CodeRabbitPullRequest') .get('/prs/github/coderabbitai/ast-grep-essentials.json') .expectBadge({ label: 'coderabbit reviews', - message: Joi.number().min(0), + message: isMetric, }) t.create('live CodeRabbitPullRequest nonexistent org')