Repository navigation
ci: gate image publish on pack, flake, and runtime smoke checks - #71
Open
LizAinslie wants to merge 4 commits into
Open
LizAinslie wants to merge 4 commits into
LizAinslie wants to merge 4 commits into
Conversation
The v0.2.0 /login crash came from a +page.svelte that used ctx in its template while the script called page<LoginPage>() without binding the result. typecheck only covers .ts files and vite build bundles the broken page happily, so walk the page templates directly.
Add local pre-publish gates and make the docker workflow run them before the multi-arch build/push: - smoke-image.sh builds the runtime stage, boots it with a disposable postgres, and checks health, /login HTML, the served pack bootstrap and login modules, an admin login, and an authenticated calendars fetch. - check-flake.sh runs nix flake check --no-build and nix flake show. - pre-publish-checks.sh orchestrates the guard above plus both checks. - docker.yml gains pack-check, flake-check, and smoke-image jobs and the docker job now needs all three.
Deploying kalendee-docs with
|
| Latest commit: |
e8122a8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a0811110.kalendee-docs.pages.dev |
| Branch Preview URL: | https://hotfix-pre-publish-checks.kalendee-docs.pages.dev |
Add a pull_request trigger limited to main so PRs exercise the pack-check, flake-check, and smoke-image gates. The build+push docker job stays tag/dispatch-only via if: github.event_name != 'pull_request'; it still needs all three checks.
3 tasks
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.
Why
v0.2.0 shipped a
/loginpage runtime crash:server/pack/src/pages/kalendee/login/+page.sveltecalledpage<LoginPage>()without binding the result, soctxwas undefined when the template rendered.pnpm typecheckonly runstscover.tsfiles andvite buildhappily bundles the broken component, so nothing failed until a browser loaded the page from the pack baked into the published image. (Fixed onmainby a1d706e, released as v0.2.1.)This PR adds local + CI gates that run before the runtime image is pushed.
Gates
scripts/check-page-context.mjswalks everyserver/pack/src/pages/**/+page.svelteand fails if the template referencesctxwhile the script does not bindpage<...>().svelte-checkwas tried first (addscheckscript +.svelteto tsconfig include). It does catch this regression (Cannot find name 'ctx'), but the pack has 23 pre-existing unrelated type errors, so it cannot be shipped as a failing gate yet. The targeted guard was used instead per plan.scripts/check-flake.shrunsnix flake check --no-buildthennix flake show.scripts/smoke-image.shbuilds the Dockerfileruntimestage (or reusesIMAGE_TAGwith--no-build), boots it with a disposable PostgreSQL, and asserts:GET /api/v1/healthcontains"ok"GET /loginreturns 200 HTML/__keel/pack/kalendee/bootstrap.jsreturns 200 non-empty JS/__keel/pack/kalendee/pages/kalendee.login.jsreturns 200 and containsSign in(the real page module is in the served pack)POST /api/v1/auth/login(admin) returns 200 and a session cookieGET /api/v1/calendarsreturns 200scripts/pre-publish-checks.shruns all three locally.CI
.github/workflows/docker.ymlgainspack-check,flake-check, andsmoke-imagejobs; the existing multi-archdockerjob nowneedsall three, so nothing is pushed unless every gate passes.on:, permissions, concurrency, env, and the existing build/push step are untouched.latestand0.2.1are unaffected: no image is rebuilt or retagged by this PR, and the new gates only apply to future pushes/tags.