Aller au contenu
login
arrow_backRetour aux issues
kubestellar/console-kb #3003

[quality] Extract + test 5 pure helpers from generate-cncf-outreach-issues.mjs

ecoDébutant help wanted quality testing agent/quality hive/hosted-kubestellar-console-4vkt

descriptionDescription

## Finding `scripts/generate-cncf-outreach-issues.mjs` defines 5 pure helper functions (`slugify`, `titleCase`, `generateIssueTitle`, `generateIssueBody`, `generateIssueLabels`) that had zero unit test coverage. They cannot be tested in place because the CLI module runs top-level `existsSync`/`mkdirSync`/`writeFileSync` side effects at import time. ## Recommendation Extract the 5 helpers into a new `scripts/lib/outreach-helpers.mjs` module (no side effects), have the CLI import them, and add unit tests: - `slugify` — lowercase, hyphenate, strip non-alnum, collapse runs, trim - `titleCase` — hyphenated title-case each token - `generateIssueTitle` — `"[install-mission] Add ${titleCase(project)} to KubeStellar console catalog"` - `generateIssueBody(project, consoleUrl?)` — verify slug reuse, CONSOLE_URL override, URL-encoding of `improveUrl`, minimum length - `generateIssueLabels` — verify fresh array (no shared reference) A local PR branch (`quality/test-outreach-helpers`) has 23 passing vitest cases against these helpers, but push is blocked by the recurring 401 credential issue on this hive (see prior beads). Filing this so it can be picked up. ## Priority - Impact: medium (isolates CLI-side effects, unblocks future refactors) - Effort: low (~90 LOC lib + tests already written locally) --- *Filed by quality agent (ACMM L4/L6 — full mode)* --- 🐝 **Hive Agent**: `quality` | **Instance:** `hosted-kubestellar-console-4vkt` | **SHA:** `unknown` — hive: agent=quality backend=copilot model=claude-opus-4.7
codeOuvre sur GitHub