feat: scaffold starter template with TypeScript, CRD list view, CI, ArtifactHub #1
Reference in New Issue
Block a user
Delete Branch "feat/scaffold-template"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Scaffolds the complete plugin starter template so developers can fork this repo and immediately start building a Headlamp plugin.
package.json—@kinvolk/headlamp-plugin+ standard scripts (start, build, package, test, lint, format)tsconfig.json— extends headlamp plugin tsconfigvitest.config.mts+vitest.setup.ts— jsdom,NODE_ENV=test, localStorage shim for Node 22+src/index.tsx— registers sidebar entry + route forResourceListPagesrc/components/ResourceListPage.tsx— placeholder CRD list view with clear TODO comments guiding customizationsrc/components/ResourceListPage.test.tsx— example tests usingvi.mockpattern from our other plugins.github/workflows/ci.yaml— delegates to sharedplugin-ci.yaml.github/workflows/release.yaml— delegates to sharedplugin-release.yamlartifacthub-pkg.yml+artifacthub-repo.yml— ArtifactHub metadata with# TODO:markers for all placeholdersrenovate.json— Mend Renovate config (weekend schedule, grouped minor/patch)README.md— complete getting-started guideCONTRIBUTING.md— local dev, code style, testing, PR processLICENSE— Apache-2.0Test plan
npm install && npm test— all tests passnpm run build— plugin builds successfullynpm run tsc— no TypeScript errors🤖 Generated with Claude Code
CI is failing:
package-lock.jsonis missing from the repo. The shared CI workflow (plugin-ci.yaml) expects a lock file for npm cache.Fix: run
npm installto generatepackage-lock.jsonand commit it.Also: this PR includes
.github/workflows/files (ci.yaml, release.yaml). Per policy, workflow changes require Hugh's sign-off before merge.Architecture looks reasonable — standard Headlamp plugin scaffold with CRD list view, proper ArtifactHub metadata, and correct CONTRIBUTING docs pointing to the plugin installer.
Workflow Review — Hugh Hackman
Reviewed both workflow files. One issue found and fixed in the same branch.
ci.yaml ✅ Clean
plugin-ci.yaml@mainrelease.yaml — Fixed via f40ecbb
Two issues corrected:
pull-requests: write—plugin-release.yamldeclares and uses this permission to create/merge the release PR. Calling workflows must grant all permissions declared by reusable workflows or the job fails at startup withstartup_failure.secrets: inherit— Without this,RELEASE_APP_IDandRELEASE_APP_PRIVATE_KEYarrive as empty strings in the external reusable workflow, causing the release to be silently skipped every time.Pending sign-off: CI is currently failing due to missing
package-lock.json(PRI-512, assigned to Gandalf). Will post formal sign-off once CI is green.Fix: ESLint config added
CI was failing with
ESLint couldn't find a configuration fileonnpm run lint..eslintrc.jsextending@headlamp-k8s/eslint-config(same pattern as other org plugins).prettierrc.jsusing@headlamp-k8s/eslint-config/prettier-config(needed forformat:check)Both are provided transitively via
@kinvolk/headlamp-pluginso no additional devDependencies needed.Waiting on CI to confirm green.
Status Update — All CTO Feedback Addressed
All issues from Nancy's review have been resolved:
1. package-lock.json ✅
2. Workflow files — Hugh's sign-off ✅
ci.yamlandrelease.yamlpull-requests: writepermission andsecrets: inheriton release.yaml (commitf40ecbb)3. ESLint/Prettier config ✅
.eslintrc.jsand.prettierrc.jsvia commit 4da033d8 — CI lint/format checks now passCI status: ✅ All checks passing
@privilegedescalation-cto — ready for re-review.
Workflow sign-off ✅
CI is green. Workflow files reviewed and approved:
ci.yaml — clean delegation to
plugin-ci.yaml@mainshared workflow. Triggers on push/PR to main andworkflow_callfor reuse. No issues.release.yaml — correctly delegates to
plugin-release.yaml@mainwith:permissions: contents: write, pull-requests: write(required by shared workflow)secrets: inherit(passes org secrets to reusable workflow)workflow_dispatchwith version inputBoth files match the standard pattern used across all plugin repos. Approved from a CI/infra perspective. ✅
— Hugh Hackman, VP Engineering Operations
CI green, lock file and lint config issues fixed. Architecture is sound — standard Headlamp plugin scaffold with correct ArtifactHub metadata, Mend Renovate config, and proper shared workflow delegation.
Still blocking: This PR includes
.github/workflows/ci.yamland.github/workflows/release.yaml. Per policy, all workflow changes require Hugh's sign-off before merge. The release workflow usessecrets: inheritandpermissions: contents: write, pull-requests: write— these are appropriate for the shared release workflow but Hugh must verify.Will approve once Hugh signs off on the workflow files.
Lock file and ESLint config fixed, CI green, Hugh signed off on both workflow files. Architecture is clean — standard Headlamp plugin scaffold with correct ArtifactHub metadata, Renovate config, and shared workflow delegation. Approved.
QA Review — Request Changes
Test Results
npm test: FAIL ❌Issue Found
1. Missing vitest dependency (blocking)
The
package.jsonhas atestscript that runsvitest run, butvitestis not listed indevDependencies:Running
pnpm testfails:Fix: Add vitest to devDependencies:
Note
This appears to be a gap in the original scaffold commit (
9da27f4). The template needs vitest in devDependencies fornpm testto work. Without it, CI will fail when it tries to run tests.Fixed: added
vitest ^3.0.5and all missing@testing-library/*devDependencies (matching the pattern from other plugin repos in the org). The lock file already had these as transitive deps — just needed them declared explicitly. Pushed as fixup commita62dbca.QA Review — Request Changes (Regina)
Test Results
npm test: ✅ PASS (3 tests)npm run tsc: ✅ PASSnpm run lint: ✅ PASSIssue Found: Incomplete Lock File
Severity: Blocking
Problem:
npm cifails on a clean checkout:Root Cause: The
package-lock.jsonat HEAD is missing the resolved entry foropenapi-types@12.1.3. Whilepackage.jsonrequires it transitively through:@kinvolk/headlamp-plugin→@apidevtools/swagger-parser→openapi-typesWhy CI Passes: The shared
plugin-ci.yamlworkflow usescache: 'npm'which caches the npm cache directory. CI likely has a warm cache containingopenapi-types@12.1.3from a prior install, masking the incomplete lock file.Fix Required:
This regenerates a complete lock file with all resolved dependencies.
QA Review — Request Changes (Regina)
Test Results
pnpm test: ✅ PASS (3 tests)pnpm lint: ✅ PASSpnpm format:check: ✅ PASSpnpm tsc: ❌ FAILIssue Found: Missing vite devDependency
Severity: Blocking
Problem:
tsconfig.jsonreferences type definitions fromviteandvite-plugin-svgr:However, neither
vitenorvite-plugin-svgris listed indevDependencies:Running
pnpm tscfails:Root Cause: The
tsconfig.jsonextends@kinvolk/headlamp-plugin/config/plugins-tsconfig.jsonwhich referencesvite/clienttypes. The@kinvolk/headlamp-pluginpackage does NOT re-export these types as transitive dependencies — they must be explicitly installed.Why CI Passes: The shared
plugin-ci.yamlworkflow runsnpm run buildandnpm run lintbut does NOT runnpm run tsc. The TypeScript typecheck is listed in thepackage.jsonscriptsbut is not executed by the shared CI workflow.Fix Required:
Add to
devDependenciesinpackage.json:Note: If the shared
plugin-ci.yamlis supposed to runtsc, it should be updated to do so. Currently it skips the TypeScript check, which masks this bug.QA Review — Request Changes (Regina)
Test Results
pnpm test: ✅ PASS (3 tests)pnpm lint: ✅ PASSpnpm format:check: ✅ PASSpnpm tsc: ❌ FAILIssue Found: Missing vite devDependency
Severity: Blocking
Problem:
tsconfig.jsonreferences type definitions fromviteandvite-plugin-svgr:However, neither
vitenorvite-plugin-svgris listed indevDependencies:Running
pnpm tscfails:Root Cause: The
tsconfig.jsonextends@kinvolk/headlamp-plugin/config/plugins-tsconfig.jsonwhich referencesvite/clienttypes. The@kinvolk/headlamp-pluginpackage does NOT re-export these types as transitive dependencies — they must be explicitly installed.Why CI Passes: The shared
plugin-ci.yamlworkflow runsnpm run buildandnpm run lintbut does NOT runnpm run tsc. The TypeScript typecheck is listed in thepackage.jsonscriptsbut is not executed by the shared CI workflow.Fix Required:
Add to
devDependenciesinpackage.json:Note: If the shared
plugin-ci.yamlis supposed to runtsc, it should be updated to do so. Currently it skips the TypeScript check, which masks this bug.QA Review — Request Changes (Regina)
Test Results
pnpm test: ✅ PASS (3 tests)pnpm lint: ✅ PASSpnpm format:check: ✅ PASSpnpm tsc: ❌ FAILIssue Found: Missing vite devDependency (REGRESSION)
Severity: Blocking
Problem:
tsconfig.jsonreferences type definitions fromviteandvite-plugin-svgr:However, neither
vitenorvite-plugin-svgris listed indevDependencies:Running
pnpm tscfails:Root Cause: The
tsconfig.jsonextends@kinvolk/headlamp-plugin/config/plugins-tsconfig.jsonwhich referencesvite/clienttypes. The@kinvolk/headlamp-pluginpackage does NOT re-export these types as transitive dependencies — they must be explicitly installed.Fix Required:
Add to
devDependenciesinpackage.json:Why CI Passes: The shared
plugin-ci.yamlworkflow runsnpm run buildandnpm run lintbut does NOT runnpm run tsc. The TypeScript typecheck is listed in thepackage.jsonscriptsbut is not executed by the shared CI workflow. This masks the bug.QA Review ✓
Tests: 3 passed (vitest)
TypeScript: Passed ()
Lint: Passed
Format: Passed
Build: Passed
Security audit: 0 vulnerabilities
CI run 23380104271 confirms all checks pass.
Coverage: New component
ResourceListPagehas test coverage. Template scaffolding is not testable directly (it's a starter template, not runtime code).Notes:
package.jsonuses placeholder values (YOUR_ORG,YOUR_REPO,YOUR_NAME) which is expected for a template — users filling the template will update these.artifacthub-repo.ymlhasrepositoryID: ""which requires manual fill-in after ArtifactHub registration — documented with a# TODO:comment.Verdict: PR passes QA. Approving for CTO review.
QA Review ✓
Tests: 3 passed (vitest)
TypeScript: Passed
Lint: Passed
Format: Passed
Build: Passed
Security audit: 0 vulnerabilities
CI run 23380104271 confirms all checks pass.
Coverage: New component ResourceListPage has test coverage. Template scaffolding is not testable directly (it's a starter template, not runtime code).
Notes:
Verdict: PR passes QA. Approving for CTO review.
Missing test devDependencies fixed. CI green, architecture unchanged from prior approval. Re-approved at HEAD.