From 839630cd574520bb70e9d461b47fd8f0459282c8 Mon Sep 17 00:00:00 2001 From: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Wed, 21 Oct 2026 08:58:42 -0400 Subject: [PATCH] chore(coverage): v8-ignore requireMatchingLabel's bundle-unreachable non-Error arm Every await in apply() rewraps its rejection in new Error, so the e instanceof Error ? e.message : e fold at the rule loop's catch can only take its Error arm from dist/index.js. Mark the alternate with /* v8 ignore next */, the form config.ts already uses, so the e2e lane stops reporting a branch no bundle input can reach. The unit test that drives the arm stays. dist/ repacked (comment lines only). Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- dist/index.js | 4 +++- src/plugins/requireMatchingLabel.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 6b20c354..298d5c89 100644 --- a/dist/index.js +++ b/dist/index.js @@ -45227,7 +45227,9 @@ async function enforceRequiredLabels(octokit, context, target, options = {}) { await apply(octokit, context, issueNumber, rule, labels); } catch (e) { - errors.push(`${rule.missing_label}: ${e instanceof Error ? e.message : e}`); + // every await in apply() rewraps its rejection in new Error (labelIssue, removeLabels, createComment, + // botCommentsWithMarker, deleteMissingComments), so only an Error reaches this catch from the bundle + errors.push(`${rule.missing_label}: ${e instanceof Error ? e.message : /* v8 ignore next -- non-Error arm unreachable from dist/index.js; requireMatchingLabel.test.ts drives it */ e}`); } } if (errors.length > 0) { diff --git a/src/plugins/requireMatchingLabel.ts b/src/plugins/requireMatchingLabel.ts index b2b8211c..9b10f5fc 100644 --- a/src/plugins/requireMatchingLabel.ts +++ b/src/plugins/requireMatchingLabel.ts @@ -164,7 +164,9 @@ export async function enforceRequiredLabels(octokit: Octokit, context: Context, await apply(octokit, context, issueNumber, rule, labels) } catch (e) { - errors.push(`${rule.missing_label}: ${e instanceof Error ? e.message : e}`) + // every await in apply() rewraps its rejection in new Error (labelIssue, removeLabels, createComment, + // botCommentsWithMarker, deleteMissingComments), so only an Error reaches this catch from the bundle + errors.push(`${rule.missing_label}: ${e instanceof Error ? e.message : /* v8 ignore next -- non-Error arm unreachable from dist/index.js; requireMatchingLabel.test.ts drives it */ e}`) } }