refactor(ci): split ci.yml into ci.yml + deploy.yml#8
Merged
Conversation
Separates concerns so badges reflect reality: - ci.yml (name: CI) — runs on PR + push to main, plus repository_dispatch for contract updates. One job (check): type check, tests + coverage, build, contract schema validation. - deploy.yml (name: CD) — triggered via workflow_run after CI succeeds on main. Builds, applies D1 migrations, deploys via wrangler-action, runs the health check + smoke test + post-deploy contract round-trip. README now shows two badges (CI + CD); previously one ambiguous "CI / Deploy" workflow had a single badge that didn't tell the reader whether the issue was a failed test or a failed deploy. Also addresses post-merge review findings on #7: - api-reference.md List Configs example: drop user_id, custom_script, dotfiles_repo, forked_from, created_at — getUserConfigs does not SELECT them (see src/lib/server/db/configs.ts:80). - api-reference.md Get Current User: add avatar_url back — getCurrentUser selects it (src/lib/server/auth.ts:58,70). - api-reference.md install endpoint auth note: replace the vague "browser-friendly auth flow" mention with the actual behavior (404 on the page route for non-owners; no interactive prompt). HARNESS.md: point the post-deploy rows at deploy.yml; clarify the push-to-main → workflow_run → deploy chain in the "not in the harness" section. required-checks.txt is unchanged: `check` and `validate-commits` still exist as job names in ci.yml and conventional-commits.yml. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
The single
ci.ymlworkflow (namedCI / Deploy) was doing both CI and CD with one ambiguous badge — you couldn't tell whether a red badge meant a failed test or a failed deploy. Splits into two workflows so each concern has its own badge.ci.yml(name: CI) — runs on PR + push to main +repository_dispatch(contract updates). One job (check): type check, tests + coverage, build, contract schema validation.deploy.yml(name: CD) — triggered viaworkflow_runafter CI succeeds on main. Builds, applies D1 migrations, deploys viawrangler-action, runs health check + smoke test + post-deploy contract round-trip.README now shows two badges.
docs/HARNESS.mdpost-deploy rows point atdeploy.yml.required-checks.txtis unchanged —checkandvalidate-commitsare still required, both still exist as job names.Also folds in the three post-merge review findings on #7 (api-reference inaccuracies):
getUserConfigsdoes not SELECT (user_id,custom_script,dotfiles_repo,forked_from,created_at).avatar_urlback — it is selected bygetCurrentUser.Test plan
npm run check— 0 errorsnpm run validateran inpre-pushhook on pushci.ymlruns and turns the CI badge greendeploy.ymlfires viaworkflow_runand turns the CD badge green/api/healthreports healthy after CD finishesrequired-checks alignment (drift)sensor on harness.yml still passesRisk
workflow_runtriggers run from the default branch's workflow file, so the very first deploy after this merge usesdeploy.ymlas-merged on main — there's no chicken-and-egg. If the deploy job has a bug, the fallback iswrangler deployfrom a clean checkout (covered by AGENTS.md as a manual step).🤖 Generated with Claude Code