Skip to content

ci: dev-bootstrap smoke job + centralized dev-server docs#738

Merged
shaoster merged 4 commits into
mainfrom
ci/dev-bootstrap-smoke
May 29, 2026
Merged

ci: dev-bootstrap smoke job + centralized dev-server docs#738
shaoster merged 4 commits into
mainfrom
ci/dev-bootstrap-smoke

Conversation

@shaoster
Copy link
Copy Markdown
Owner

Summary

Adds a CI smoke job that verifies the developer bootstrap works end to end, and centralizes the dev-server setup/login knowledge it relies on (previously buried in /report).

CI: dev-smoke job

On a clean checkout, runs the documented flow and fails if any step breaks:

  1. source env.shgz_start (brings up the dev stack; bazel provides web node_modules, so no install step)
  2. Sign in via the mock-IdP dev login flow (relative redirect_uri, two-step curl)
  3. Assert /api/auth/me/ is authenticated and /api/pieces/ returns seeded pieces (first login seeds ~75)
  4. gz_stop, then assert both servers actually stopped

The whole sequence runs in one shell because gz_start registers an EXIT trap that also cleans up on failure. Wired into record-fingerprint so the skip-main optimization requires it. Uses only the whitelisted BAZEL_REMOTE_API_KEY secret (passes the in-workflow security audit). Validated locally: the exact sequence logs in, returns pieces, and stops cleanly.

Docs: centralize dev-server bootstrap + login

The dev login flow lived only in /report §3, and its redirect_uri example was the wrong absolute form (the view requires the relative path and 400s otherwise). Now documented once and referenced:

  • dev-environment skill — new "Authenticating Against the Local Dev Server (dev login)" section (correct flow, auto-seeded pieces, DEV_BOOTSTRAP_ENABLED guard); "Production Backup & Local Repro From a Prod Snapshot" section (gz_backup/gz_restore); the "agents source env-agent.sh, never env.sh" rule; frontmatter description updated for recall.
  • report-bug skill — §3d points at the canonical flow instead of duplicating it.
  • dev-packages skill — new npm packages must be added to both the dev/build (web_lib, component *_src) and production (web_prod_lib) lib targets by default (the react-easy-crop two-commit footgun).
  • docs/agents/dev.mdgz_* helper reference table, backup/restore subsection, env-agent.sh-not-env.sh correction.
  • AGENTS.md — bootstrapping index row now mentions dev login, running servers, and prod backup/restore.

Notes

  • Replaces/obsoletes the unmerged pull_prod_pieces.py API-scraping approach (deleted) in favor of the sanctioned gz_backupgz_restore path.

🤖 Generated with Claude Code

shaoster and others added 4 commits May 28, 2026 21:31
Adds a `dev-smoke` CI job that verifies the documented developer bootstrap
end to end on a clean checkout: `source env.sh` → `gz_start` → sign in via the
mock-IdP dev login flow → assert `/api/pieces/` returns seeded data → `gz_stop`
(and asserts the servers actually stopped). Wired into `record-fingerprint` so
the skip-main optimization requires it too. No dependency-install step — bazel
provides web `node_modules` via the gz_start launcher build.

Centralizes the dev-server bootstrap + login knowledge that was previously
buried in /report (and whose redirect_uri example was the wrong absolute form):

- dev-environment skill: new "Authenticating Against the Local Dev Server"
  section (correct relative-redirect_uri two-step curl flow, auto-seeded
  pieces, DEV_BOOTSTRAP_ENABLED guard); "Production Backup & Local Repro"
  section for gz_backup/gz_restore; corrected "agents source env-agent.sh,
  never env.sh" rule; frontmatter description updated for recall.
- report-bug skill: §3d now points at the canonical flow instead of
  duplicating it.
- dev-packages skill: new npm packages must be added to BOTH the dev/build
  (web_lib, component *_src) and production (web_prod_lib) lib targets by
  default — the react-easy-crop two-commit footgun.
- docs/agents/dev.md: gz_* helper reference table, backup/restore subsection,
  env-agent.sh-not-env.sh correction.
- AGENTS.md: bootstrapping index row mentions dev login, running servers,
  prod backup/restore.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…docstring

The dev-smoke step used `set -euo pipefail`; the -u (nounset) aborted on
`source env.sh` because env-agent.sh reads $_GLAZE_AGENT_ENV_LOADED before it
is set (line 35). Existing lint/coverage jobs source env.sh without -u. Use
`set -eo pipefail` (the Actions bash wrapper already applies -e and pipefail).

Also corrects the mock_idp_views.py module docstring: redirect_uri must be the
relative /api/auth/mock-idp/complete/ (absolute is 400'd), and BASE must be
prefixed on the complete/ GET since the returned Location is relative.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`gz_status | grep -q "running"` also matched "backend: not running", so the
post-stop assertion fired even when gz_stop succeeded. Match `: running` to
catch only the affirmative running state.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
main's report-bug fix told the agent to `source env.sh` to start the server,
which contradicts the rule this PR establishes (agents source env-agent.sh,
never env.sh — env.sh unsets GLAZE_AGENT). Switch §3c to source env-agent.sh
from the worktree, preserving the GLAZE_ROOT-from-worktree guidance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@shaoster shaoster force-pushed the ci/dev-bootstrap-smoke branch from cb12b99 to 96dd6b7 Compare May 29, 2026 01:33
@shaoster shaoster merged commit 11504c8 into main May 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant