Skip to content

Commit ee4f7c6

Browse files
authored
Merge pull request ubiquity-os-marketplace#87 from rndquu/feat/new-priority-msg
feat: new error msg on missing required label
2 parents 0480ab3 + ef6198a commit ee4f7c6

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/handlers/shared/start.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,14 @@ export async function start(
2222

2323
if (requiredLabelsToStart.length && !requiredLabelsToStart.some((label) => issueLabels.includes(label))) {
2424
// The "Priority" label must reflect a business priority, not a development one.
25-
throw logger.error("This task does not reflect a business priority at the moment and cannot be started. This will be reassessed in the coming weeks.", {
26-
requiredLabelsToStart,
27-
issueLabels,
28-
issue: issue.html_url,
29-
});
25+
throw logger.error(
26+
`This task does not reflect a business priority at the moment. You may start tasks with one of the following labels: ${requiredLabelsToStart.join(", ")}`,
27+
{
28+
requiredLabelsToStart,
29+
issueLabels,
30+
issue: issue.html_url,
31+
}
32+
);
3033
}
3134

3235
if (!sender) {

tests/main.test.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,9 @@ describe("User start/stop", () => {
292292
context.adapters = createAdapters(getSupabase(), context);
293293

294294
await expect(userStartStop(context)).rejects.toMatchObject({
295-
logMessage: { raw: "This task does not reflect a business priority at the moment and cannot be started. This will be reassessed in the coming weeks." },
295+
logMessage: {
296+
raw: "This task does not reflect a business priority at the moment. You may start tasks with one of the following labels: Priority: 3 (High), Priority: 4 (Urgent), Priority: 5 (Emergency)",
297+
},
296298
});
297299
});
298300
});

0 commit comments

Comments
 (0)