Repository navigation
Build a complete CI pipeline modeled on magpie (yetone/magpie) #30
Copy link
Copy link
Closed
Description
Reference
yetone/magpie: its .github/workflows test.yml, release.yml, docker.yml and ui-preview.yml, and the CI lessons in its LESSONS.md.
Patterns worth taking from magpie:
- Main's runs always finish.
cancel-in-progressis on only off main, because a release waits for a green run on its commit, and runs cancelled by the next push would leave none. - Fail fast and cheap. A formatting check runs before the long suite, and slow installs have timeouts. A stuck apt mirror once held magpie's main for 2.5 h.
- The OS matrix includes macOS, with OS-specific steps.
- A second job builds what users install (
cli: the terminal-only release build plus the installer and site tests). - A tag-driven release that publishes artifacts and release notes.
- Docker image smoke test and UI preview recordings on PRs.
Current CI state (main)
.github/workflows/test.yml("Test") runs on push to main, PRs and manual dispatch.- Matrix: ubuntu Node 24 / DSH 0.2.0-rc.2, windows Node 24 / rc.2, ubuntu Node 22 / rc.2, ubuntu Node 24 / DSH 0.2.1-alpha.1.
- Steps:
npm ci, the DSH harness,npm test,build-client.mjs --check,npm run lint.
- Gaps:
- The plugin suites never run. That covers
ds-bot/plugins/social/test/*.test.jsandds-bot/plugins/tree/test/tree.test.js(45 tests). - There is no coverage.
- There is no macOS leg, though FlyBot users run it on macOS.
- Nothing checks what gets packed and installed into a DSH profile.
- There is no release workflow.
- Every push to main cancels the previous main run.
- The plugin suites never run. That covers
ds-bot/test/tree-host.test.js(the tree plugin on a real ds-bot) runs insidenpm test, but is not part of any coverage.- Branch protection on main requires the four matrix job names.
Proposal (adapted to FlyBot)
| From magpie | For FlyBot |
|---|---|
test.yml concurrency: cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} |
Same, so a release can wait for main's run. |
| Format/vet before tests; install-step timeouts | npm run lint and the client bundle check run first; npm ci and the DSH install get 5-minute timeouts; job timeout 25 min. |
| OS matrix with macOS | Following #31: the PR gate is one job, ubuntu-latest · Node 24 · DSH 0.2.0-rc.2. Windows, macOS, Node 22 and DSH 0.2.1-alpha.1 run in a Compatibility workflow (nightly, manual, and on PRs touching it), with jobs named compat · …. A shared composite action keeps both workflows' steps identical. |
| (plugin tests: magpie runs its plugin flows explicitly) | Run the social and tree plugin suites, including plugins/tree/test/tree.test.js. test/tree-host.test.js keeps running in ds-bot's suite. |
| n/a (Go has no coverage step there) | One leg runs ds-bot, social and tree in a single coverage run, including tree-host and tree.test.js. The summary goes to the job summary and lcov is uploaded as an artifact. |
cli job: build what users install, test the installer |
package job: npm pack ds-bot, @flybot/social and @flybot/tree, the packages a DSH profile installs. It checks every main/exports/files entry is packed and no test/ or dev/ files are. It also runs a strict tsc on types/*.d.ts (the plugin API), checks that CHANGELOG.md has an Unreleased section, and runs actionlint. |
release.yml on v* tags |
On a v* tag matching ds-bot/package.json: wait for a green Test run on the tagged commit, pack, then publish a GitHub Release with the tarballs and that version's CHANGELOG.md section. GITHUB_TOKEN only. Magpie's cross-repo dispatch needs a PAT and has no FlyBot equivalent. |
docker.yml |
Not applicable: FlyBot has no server image. |
ui-preview.yml (pull_request_target, Playwright recordings) |
Deferred: dev/ui-shots.mjs could record the sidebar per PR, but it needs a DSH bench and Chrome, and fork-safe handling of PR content. |
Kept from general hardening, because it's cheap and useful:
- Actions pinned to commit SHAs, with
persist-credentials: false. - A
tests-okaggregate check. - CodeQL for javascript-typescript and actions.
- Grouped weekly Dependabot updates with a 7-day cooldown, to keep the SHA pins current.
No job requires a secret.
Impact on branch-protection required checks
Main currently requires all four legs. With the slim gate (#31), three of them are no longer reported, so protection must change:
- Keep
ubuntu-latest · Node 24 · DSH 0.2.0-rc.2. - Add
packageandtests-ok. - Remove
ubuntu-latest · Node 24 · DSH 0.2.1-alpha.1,ubuntu-latest · Node 22 · DSH 0.2.0-rc.2andwindows-latest · Node 24 · DSH 0.2.0-rc.2(now non-requiredcompat · …jobs). - Optional:
Analyze (javascript-typescript),Analyze (actions).
Tasks
- Test: main's runs finish (cancel only off main); lint/build before tests; install timeouts
- Single PR-gate job (ci: slim Test matrix to ubuntu Node 24 + DSH 0.2.0-rc.2 #31); Compatibility workflow (nightly/manual) for Windows, macOS, Node 22 and DSH next, sharing one composite action
- Test: social and tree plugin suites, incl.
plugins/tree/test/tree.test.js;test/tree-host.test.jsstays in ds-bot's suite - Coverage over ds-bot, social and tree (incl. tree-host and tree.test.js): job summary and lcov artifact
-
packagejob: pack check of the three packages, strict typecheck oftypes/*.d.ts, CHANGELOG check, actionlint -
tests-okaggregate - Release on
v*tags: version check, wait for green Test, tarballs and CHANGELOG notes (GITHUB_TOKEN) - SHA-pinned actions, least-privilege permissions,
persist-credentials: false - CodeQL; Dependabot for actions and npm
- Deferred: UI preview recordings on PRs (
dev/ui-shots.mjs) - Deferred: JS typecheck (
checkJs, needs@types/nodeand fixes first) - Not applicable: Docker image
- Branch protection: add the new contexts once stable (maintainers)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]Build a complete CI pipeline modeled on magpie[/-][+]Build a complete CI pipeline modeled on magpie (yetone/magpie)[/+]