{"record":{"id":"01de910fc6df10fc","repo":"stablyai/orca","slug":"adhoc-label-has-no-usable-characters-json-strin","errorCode":null,"errorMessage":"Adhoc label has no usable characters: ${JSON.stringify(label)}","messagePattern":"Adhoc label has no usable characters: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/scripts/adhoc-build-version.mjs","lineNumber":68,"sourceCode":" *\n * The input is free text from whoever ran the workflow, so it cannot be trusted\n * to stay inside the title's shape: a stray `•` would forge a field separator,\n * and a newline would break the `$GITHUB_OUTPUT` line the workflow parses. Both\n * collapse to `-` here, which is why this replaces rather than rejects.\n */\nexport function normalizeAdhocLabel(label) {\n  const cleaned = String(label ?? '')\n    // `refs/heads/x` and `origin/x` are what a ref input tends to arrive as; the\n    // prefix is noise in a title where every row is already a branch build.\n    .replace(/^(?:refs\\/heads\\/|origin\\/)/, '')\n    .replace(/[^\\p{L}\\p{N}._/-]+/gu, ' ')\n    .trim()\n    .replace(/\\s+/g, '-')\n    .slice(0, ADHOC_LABEL_MAX_LENGTH)\n    // Truncation can land mid-separator, leaving a title ending in `-` or `/`.\n    .replace(/[-._/]+$/, '')\n  if (!cleaned) {\n    throw new Error(`Adhoc label has no usable characters: ${JSON.stringify(label)}`)\n  }\n  return cleaned\n}\n\n/**\n * `1.4.163 • wasm-terminal • Aug 1, 2:25PM • abc1234` — the human-facing release\n * title, shown verbatim in both the GitHub releases list and the build picker.\n *\n * Why the label sits where hourly puts its build number: several adhoc builds\n * from different branches coexist in the channel, so the picker needs the branch\n * to tell them apart. A counter would say nothing about which one to pick.\n */\nexport function formatAdhocReleaseName(version, label, commit, date) {\n  return [\n    version.split('-')[0],\n    normalizeAdhocLabel(label),\n    formatReleaseTitleTimestamp(date),\n    commit.slice(0, 7)","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/adhoc-build-version.mjs#L50-L86","documentation":"Thrown by normalizeAdhocLabel when, after stripping refs/heads/ and origin/ prefixes, collapsing disallowed characters, trimming, truncating to 32 chars, and trimming trailing separators, the result is empty. The label goes verbatim into a release title and a $GITHUB_OUTPUT line, so the function replaces rather than rejects — but if every input character was disallowed (whitespace, emoji, punctuation only) there is nothing left to keep.","triggerScenarios":"ORCA_ADHOC_LABEL env var was unset (empty string default), all punctuation/whitespace, or a single emoji; the workflow dispatched with the label field left blank.","commonSituations":"User triggered an adhoc build without filling the label input; label was set to a string of special characters (e.g. '!!! ???'); a script defaulted ORCA_ADHOC_LABEL to an empty string instead of a branch name.","solutions":["Set ORCA_ADHOC_LABEL to a branch or feature name containing at least one letter or digit before dispatching the workflow.","If the label should be optional, change the workflow to fall back to the branch/ref name when ORCA_ADHOC_LABEL is empty rather than passing it through verbatim.","Pre-validate the label in the workflow dispatch input with a pattern that requires at least one \\p{L}|\\p{N} character.","Surface a friendlier error message that names the env var and the required character class."],"exampleFix":"// before\n// ORCA_ADHOC_LABEL='' node config/scripts/adhoc-build-version.mjs\n// -> 'Adhoc label has no usable characters: \"\"'\n\n// after\n// ORCA_ADHOC_LABEL='wasm-terminal' node config/scripts/adhoc-build-version.mjs","handlingStrategy":"validation","validationCode":"function hasUsableLabel(label) {\n  const cleaned = String(label ?? '')\n    .replace(/^(?:refs\\/heads\\/|origin\\/)/, '')\n    .replace(/[^\\p{L}\\p{N}._/-]+/gu, ' ')\n    .trim()\n    .replace(/\\s+/g, '-')\n    .slice(0, 32)\n    .replace(/[-._/]+$/, '')\n  return cleaned.length > 0\n}\n// if (!hasUsableLabel(process.env.ORCA_ADHOC_LABEL)) throw new Error('ORCA_ADHOC_LABEL needs at least one letter or digit')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default ORCA_ADHOC_LABEL to the branch name (e.g. ${GITHUB_REF#refs/heads/}) in the workflow when the operator leaves it blank.","Add a workflow_dispatch input pattern that requires at least one letter or digit.","Document near the workflow input that pure-punctuation/emoji labels are rejected."],"tags":["release","adhoc-build","label","validation","i18n-safe"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}