Ci: repair the example issue-to-PR workflow - #172
Merged
Conversation
The examples build spawned `buildExamples()` without awaiting it. Under GJS
the process ends when the module's synchronous body does, so the promise chain
was torn down after the first directory: no index.ts was written, examples.ts
was never regenerated, and the script still exited 0. Both CI and the
issue-to-PR workflow therefore "built" the examples while producing nothing.
Await the build at the top level, and while here fix two defects it hid:
- slugToCamelCase only un-dashed `-[a-z]`, so a slug with a digit after a dash
('line-buster-6502') generated the identifier 'lineBuster-6502', which does
not parse.
- the directory list came straight from readdir, making the committed
examples.ts order filesystem-dependent.
Claude-Session: https://claude.ai/code/session_01FrdNDUY1rJWBJsDU1KAwKj
Every example submitted since the yarn.lock was dropped (#144) failed. The workflow still ran `yarn install --immutable` + `yarn workspace ... build` on a plain ubuntu runner, so yarn 1 silently wrote a fresh lockfile (which `git add -A` would have committed) and the examples build died on `spawn gjs ENOENT` — ubuntu-latest ships no gjs. - Run in the fedora:43 container the CI type-check job uses, and install with `gjsify install --immutable` per gjsify-lock.json. Build steps use the workspace-pinned CLI, not the floating bootstrap copy. - Parse and validate the submission in .github/scripts/example-from-issue.mjs instead of shell + python json escaping: slug, license, the 2048-char displayMemory, an unused slug, and proper TS string escaping. - Gate on the example actually working: it must assemble with the headless `learn6502` CLI, land in examples.ts, and type-check against app-web. - Add workflow_dispatch(issue) so a submission can be retried — the issues event fires once, which is why the three open submissions were stranded. - Report the reason back on the issue when a submission is rejected, instead of leaving the contributor with silence. - Stage explicit paths rather than `git add -A`, and pass every untrusted value through env instead of splicing it into shell or JS. Claude-Session: https://claude.ai/code/session_01FrdNDUY1rJWBJsDU1KAwKj
JumpLink
force-pushed
the
fix/issue-to-pr-example-pipeline
branch
from
August 24, 2026 07:19
ca2ba51 to
52ce4f1
Compare
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.
Every
[example]submission since #144 dropped theyarn.lockhas failed. Issues #169, #170 and #171 are all stranded.What was broken
1. The workflow was still a yarn workflow. It ran
yarn install --immutable+yarn workspace @learn6502/examples run buildon a plainubuntu-latestrunner. Yarn 1 ignored--immutableand wrote a freshyarn.lock(which thegit add -Awould have committed), then the examples build died onspawn gjs ENOENT— ubuntu-latest ships nogjs. CI already solved this by running its GJS jobs in afedora:43container.2. The examples build produced nothing, and exited 0 anyway.
build.tscalledbuildExamples()without awaiting it; under GJS the process ends when the module body does, so it was torn down after the first directory. Noindex.tswritten,examples.tsnever regenerated — and a green step. Fixed in the first commit, along with two defects it was hiding:slugToCamelCaseleft a dash in identifiers when a digit followed it (line-buster-6502→lineBuster-6502, which does not parse), and the directory order came straight fromreaddir, making the committedexamples.tsfilesystem-dependent.3. Nothing checked that a submission works. No assemble, no type check, no assertion that the example is exported anywhere.
4. A failed submission was unrecoverable and silent. The
issuesevent fires once, so a fixed workflow could never be retried, and a rejected contributor got no explanation.What this changes
fedora:43(GJS 1.86, the gjsify target) and installs withgjsify install --immutable. Build steps use the CLI versiongjsify-lock.jsonpins, not the floating bootstrap copy..github/scripts/example-from-issue.mjs: slug shape, allowed license, the 2048-chardisplayMemory, an already-used slug, and real TypeScript string escaping instead of shell +python3 json.dumps.learn6502CLI, the example must actually appear inexamples.ts, and the generatedindex.tsmust type-check againstapp-web.workflow_dispatch(issue)so a submission can be retried without opening a new issue.git addpaths instead ofgit add -A, and every untrusted value reaches shell/JS throughenvrather than expression interpolation.Verification
Ran the full pipeline locally against issues #169 and #171:
Both render, build into
examples.ts, type-check viagjsify workspace @learn6502/app-web check, and run to completion underlearn6502 run. The[example]placeholder body of #170 is rejected with the message the contributor needs.https://claude.ai/code/session_01FrdNDUY1rJWBJsDU1KAwKj