fix: unbreak scaffold-smoke — resolve generate language headlessly, add per-language legs - #128
Merged
Merged
Conversation
…dd per-language legs
The weekly scaffold-smoke workflow has been red since 2026-08-03. The run
scaffolds a TypeScript project and then calls a bare `apso generate`, which
fell through to the interactive inquirer language prompt ("Select target
language for code generation:") because the v2.0.0 TypeScript template ships
an .apsorc without a `language` field and init never recorded the one it was
given. In the non-TTY CI runner the prompt dies immediately (exit 130).
Fixes, smallest first:
- init: stamp the chosen language into the scaffolded .apsorc
(stampApsorcLanguage in template.ts, called from cloneTemplate). A fresh
scaffold is now self-describing, so a bare `apso generate` resolves the
language from config. Best-effort: existing values and unparseable files
are left alone. Covered by a new unit test suite.
- generate: when the language cannot be resolved from the flag or .apsorc
and the session is headless (CI / no TTY / APSO_NONINTERACTIVE), fail fast
with the flag named instead of prompting, using the existing
isInteractive()/missingFlag() pattern from init.
- scaffold-smoke.sh: seed one entity before generating (every generator
errors on "entities": [], so the old script both failed and tested no
codegen), then install/compile per language: tsc --noEmit --rootDir . for
TypeScript (the v2.0.0 template tsconfig includes test/** with rootDir
src, tripping TS6059), go mod tidy + swag init + go build for Go (the
template imports the swag-generated app/docs package), venv + pip install
+ compileall for Python.
- workflow: matrix over typescript/python/go with fail-fast off, so the
weekly run is a real regression net for the Go and Python generators that
shipped in 0.36/0.37.
All three legs verified green locally via bash scripts/scaffold-smoke.sh
<language>.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The weekly
scaffold smoke testworkflow has been red on every run since 2026-08-03 (runs 30802602127, 31366760662, 32003487994).Root cause
The run scaffolds a TypeScript project, then calls a bare
apso generate. Because the v2.0.0 TypeScript template ships an.apsorcwithout alanguagefield andapso initnever records the language it was given,generatefell through its flag > .apsorc > prompt resolution to the interactive inquirer prompt — which dies in the non-TTY CI runner. From the failed run log (job 95308243016):(The Go/Python templates already carry
"language"in their.apsorc; only the pinned TS template lacks it.)Two latent issues sat behind that one: every generator hard-errors on
"entities": [], so even past the prompt the old script would have failed while exercising zero codegen; and the workflow had no Go or Python leg at all despite being the only regression net for the generators shipped in 0.36/0.37.Changes
.apsorc(stampApsorcLanguage, called fromcloneTemplate). Fresh scaffolds are self-describing, so a bareapso generate— what the docs tell a new user to run — works. Best-effort: existing values and unparseable files are left alone. New unit test suite (5 tests)..apsorcand the session is headless, fail fast naming the flag instead of prompting (isInteractive()/missingFlag(), the same pattern init already uses):tsc --noEmit --rootDir .(TS; the v2.0.0 template tsconfig includestest/**withrootDir: src, tripping TS6059 under bare tsc),go mod tidy+swag init+go build ./...(Go; the template imports the swag-generatedapp/docspackage, per its README setup), venv +pip install -e .+compileall(Python).[typescript, python, go]withfail-fast: false, plus setup-go/setup-python steps. Refreshed the stale header comment (the "unpublished @apso/crud" blocker it described is resolved; v2.0.0 installs from npm).Verification
main:CI=true bin/run generateon a scaffold without.apsorclanguage renders the prompt and exits 130. After the fix: language-less config fails fast with the error above; a fresh scaffold generates without prompting ([apso] Using language from .apsorc: ...).bash scripts/scaffold-smoke.sh typescript|python|goeach end inPASS: scaffolded <language> project installs and compiles.npm test: 26 suites, 351 tests passing.npm run lint: 0 errors.workflow_dispatchto prove it in CI.🤖 Generated with Claude Code