Skip to content

LAB-1141: CI for edge (TS) and hotpath (Rust-WASM) deploy targets - #10

Merged
27Bslash6 merged 6 commits into
mainfrom
lab-1141-edge-hotpath-ci
Aug 5, 2026
Merged

LAB-1141: CI for edge (TS) and hotpath (Rust-WASM) deploy targets#10
27Bslash6 merged 6 commits into
mainfrom
lab-1141-edge-hotpath-ci

Conversation

@27Bslash6

@27Bslash6 27Bslash6 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds continuous integration (CI) workflows for two of the project's three deploy targets — the edge (TypeScript) and hotpath (Rust/WASM) components — completing CI coverage alongside the existing ingester workflow.

Changes

New CI Workflow: edge-qa

Adds a GitHub Actions workflow that gates the TypeScript edge/ component on pull requests and pushes to main (path-filtered to edge/**). It runs:

  • Lockfile-strict install (npm ci) — ensuring a PR that edits package.json without updating the lockfile (or pins an uninstallable version) fails, per the LAB-831 note.
  • Linting (npm run lint)
  • Type checking (npm run type-check)
  • Format checking (npm run format:check)
  • Tests (npm test) — with no network or credentials.

New CI Workflow: hotpath-qa

Adds a GitHub Actions workflow for the Rust/WASM hotpath/ component (path-filtered to hotpath/**), split into two jobs:

  • native: runs cargo test --locked and cargo clippy (native, warnings-as-errors).
  • wasm32: runs clippy against the wasm32-unknown-unknown target and performs a full worker-build --release. The comment explains this actually builds (not just lints) the WASM target because a lint-only check can compile a runtime panic that reaches a deployed Worker (referencing LAB-1079).

The wasm32 job also pins the build toolchain per the architecture docs: it installs a checksummed wasm-bindgen-cli 0.2.126 and worker-build 0.1.14 to avoid a version mismatch against the crate graph's pinned wasm-bindgen.

Documentation Updates

  • README.md: Clarifies that there is "No CD by design" (not "No CI/CD"), and documents that CI now gates all three components (ingester, edge, hotpath) on PR and push.
  • edge/README.md and hotpath/README.md: Add notes describing exactly what their respective CI workflows run.

Notes

  • All actions are pinned to specific commit SHAs, and downloaded binaries are checksum-verified, indicating a focus on reproducible and secure builds.
  • Deployment remains manual by design; only CI (quality gating) is added here.

Summary

This PR fixes the Rust-WASM (hotpath) CI build by correcting how the pinned wasm-bindgen-cli binary is installed for worker-build.

Problem

The previous approach installed wasm-bindgen-cli 0.2.126 onto the PATH, assuming worker-build would use it. However, worker-build 0.1.x ignores PATH and instead hardcodes CLI version 0.2.105 into its own cache directory (~/.cache/worker-build/wasm-bindgen-*-0.2.105/). This caused the build to fail, since the crate graph pins wasm-bindgen = "=0.2.126".

Changes

  • .github/workflows/hotpath-qa.yml: Instead of adding the binary to PATH, the workflow now extracts the pinned 0.2.126 binary directly into the cache directory that worker-build actually invokes (the ...-0.2.105 path name is intentional). A version check was also added to verify the seeded binary. The step was renamed from "Install wasm-bindgen-cli" to "Seed worker-build cache with wasm-bindgen-cli 0.2.126".

  • docs/architecture.md: Updated the build-chain pin documentation to reflect the corrected approach — clarifying that the CLI must be pre-installed into the specific cache path (not PATH), and noting this was verified in CI on 2026-08-03.

Impact

Restores a working CI pipeline for the edge (TS) and hotpath (Rust-WASM) deploy targets by aligning the wasm-bindgen toolchain version with the crate graph's pin.


LAB-1141: CI for edge (TS) and hotpath (Rust-WASM) deploy targets

Description

This PR sets up and validates CI pipelines for two deploy targets: the edge (TypeScript) and hotpath (Rust-WASM) components. The changes introduce deliberate failing code in each target to verify that the CI configuration correctly detects and reports build/test failures ("red-run demo").

Changes

Edge (TypeScript) — edge/src/handler.ts

  • Added a type-invalid declaration (const lab1141RedRunDemo: number = "deliberate red-run demo"), assigning a string to a number-typed variable. This intentionally triggers a TypeScript type-check failure to confirm the edge CI pipeline catches type errors.

Hotpath (Rust-WASM) — hotpath/src/compute.rs

  • Added a test (lab_1141_red_run_demo) that asserts 1 + 1 == 3, which intentionally fails. This verifies the hotpath CI pipeline correctly runs and reports failing Rust tests.

Purpose

Both additions are deliberate, intentionally-failing changes ("red-run demo") used to prove the CI validation works as expected across both deploy targets. As noted in the code comments, these are meant to be reverted immediately once the CI red-run behavior is confirmed.

Notes

  • These changes are not intended for permanent inclusion in main; they exist to validate CI failure detection and should be reverted after verification.

Summary

This PR hardens the hotpath-qa CI workflow for the Rust-WASM build target and simplifies documentation across the repository's QA workflows.

Changes

CI hardening (hotpath-qa.yml)

  • Extracted the worker-build cache directory path into a WB_CACHE_DIR env var, coupling it explicitly with the pinned worker-build 0.1.14 version so both move together on future bumps.
  • Added a new verification step ("Assert the seeded CLI was the one used") that fails the build if worker-build downloaded an unchecksummed binary instead of using the seeded wasm-bindgen-cli 0.2.126. It asserts the seeded CLI is executable and that only one wasm-bindgen-* cache dir exists.
  • Bumped the Swatinem/rust-cache action pin to a new commit SHA (still v2.9.1) in both jobs.

Documentation cleanup

  • README.md, edge/README.md, and hotpath/README.md: condensed the per-workflow descriptions of exact CI steps into simpler "gates every PR and push" statements, reducing duplication of implementation detail.
  • docs/architecture.md and hotpath/README.md: clarified that wasm-bindgen-cli 0.2.126 is seeded into worker-build's cache (PATH is ignored), and made explicit that the hardcoded 0.2.105 dir name is tied to worker-build 0.1.14, so the two pins must be bumped together.

Purpose

The core functional change ensures CI can no longer silently pass using an unverified, auto-downloaded wasm-bindgen binary — if a future worker-build version changes its hardcoded CLI path, the build now fails loudly rather than drifting off the checksummed, pinned toolchain. Documentation is streamlined so workflow files remain the single source of truth for exact CI steps.


Summary

This PR adds CI hardening for the edge (TypeScript) and hotpath (Rust-WASM) deploy targets and clarifies the deployment documentation.

Changes

CI Security Hardening

  • Added persist-credentials: false to the actions/checkout steps in both edge-qa.yml and hotpath-qa.yml workflows (three checkout steps total across the two files).
  • This prevents the GitHub token used during checkout from being persisted in the local git config, reducing the risk of credential exposure during CI runs.

Documentation

  • Updated README.md to more accurately describe the deploy process. The revised text explains that deploys are performed by hand by design—initial Render setup and both Workers deploys via wrangler—with one exception: after the initial setup, the ingester relies on Render's git-push auto-deploy.

Purpose

The changes reinforce the security posture of the CI pipelines that gate the edge and hotpath components, and improve the clarity of the project's deployment documentation to reflect the actual manual/auto-deploy workflow.

Two path-filtered workflows modelled on ingester-qa.yml, so 'CI green'
on this repo means all three deploy targets, not just the Python one:

- edge-qa: npm ci (lockfile-strict — the LAB-831 class of breakage),
  eslint, tsc --noEmit, prettier --check, vitest (25 tests).
- hotpath-qa: cargo test (13 tests) + clippy -D warnings on native;
  clippy + worker-build --release on wasm32 with the documented
  build-chain pins (worker-build 0.1.14, wasm-bindgen-cli 0.2.126,
  checksummed) — a real wasm32 build, because clippy alone compiled
  the LAB-1079 runtime panic happily.

READMEs updated to stop claiming 'No CI/CD by design'.
@kodus-27b

This comment has been minimized.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added automated quality checks for edge and hotpath changes, including linting, type checks, formatting validation, tests, and release builds.
    • Added path-aware validation for relevant pull requests and pushes to the main branch.
  • Documentation

    • Updated project and component documentation to explain the new automated validation workflows and their checks.

Walkthrough

The change adds path-filtered CI workflows for edge and hotpath. The workflows run pinned, read-only validation jobs. Repository and component documentation now describe the automated checks and manual deployment process.

Changes

Edge CI validation

Layer / File(s) Summary
Edge CI workflow
.github/workflows/edge-qa.yml, edge/README.md
Runs locked Node.js installation, linting, type checking, format validation, and tests for relevant pull requests and pushes to main. Documents these checks in the edge development guide.

Hotpath CI validation

Layer / File(s) Summary
Hotpath CI workflow
.github/workflows/hotpath-qa.yml, hotpath/README.md
Runs native Rust tests and Clippy, wasm32 Clippy, and a pinned release worker build for relevant pull requests and pushes to main. Documents that deployment is excluded.

Repository CI documentation

Layer / File(s) Summary
CI overview
README.md
Describes manual demonstration deployment and path-filtered CI validation for the ingester, edge API, and Rust-WASM hot path.

Sequence Diagram(s)

sequenceDiagram
  participant GitHub
  participant EdgeQA
  participant HotpathQA
  participant Checks
  GitHub->>EdgeQA: Trigger for edge changes
  EdgeQA->>Checks: Run Node.js quality checks
  GitHub->>HotpathQA: Trigger for hotpath changes
  HotpathQA->>Checks: Run Rust, wasm32, and release build checks
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarises the main change: CI for the Edge TypeScript and Hotpath Rust-WASM deploy targets.
Description check ✅ Passed The description directly explains the CI workflows, toolchain pinning, security hardening, documentation updates, and deliberate validation changes.

Comment @coderabbitai help to get the list of available commands.

kodus-27b[bot]
kodus-27b Bot previously approved these changes Aug 3, 2026
worker-build 0.1.x ignores PATH and invokes the hardcoded
~/.cache/worker-build/wasm-bindgen-*-0.2.105/ binary (first CI run
failed exactly as docs/architecture.md predicted). Pre-install the
0.2.126 CLI into that dir instead; docs updated to drop the false
'or PATH' alternative.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/edge-qa.yml:
- Around line 36-37: Fix the Type check step in the edge-qa workflow by either
defining the missing type-check script in edge/package.json or changing the
command to the established TypeScript validation command. Ensure the workflow
invokes a valid command that completes the edge type check successfully.
- Line 24: Disable persisted checkout credentials by adding persist-credentials:
false to all three checkout steps: .github/workflows/edge-qa.yml lines 24-24,
.github/workflows/hotpath-qa.yml lines 24-24, and
.github/workflows/hotpath-qa.yml lines 45-45.

In `@README.md`:
- Around line 91-95: Update the README deployment description to reflect that
the ingester has push-triggered Render deployment, while retaining the
manual-deployment statement only for the initial Render deployment and
Cloudflare Workers. Ensure the surrounding CI description remains unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a4e0b050-2aeb-4e65-a742-dd15c3dc0290

📥 Commits

Reviewing files that changed from the base of the PR and between 7e2c347 and 97d790d.

📒 Files selected for processing (5)
  • .github/workflows/edge-qa.yml
  • .github/workflows/hotpath-qa.yml
  • README.md
  • edge/README.md
  • hotpath/README.md

Comment thread .github/workflows/edge-qa.yml
Comment thread .github/workflows/edge-qa.yml
Comment thread README.md Outdated
@kodus-27b

This comment has been minimized.

kodus-27b[bot]
kodus-27b Bot previously approved these changes Aug 3, 2026
@kodus-27b

This comment has been minimized.

Comment thread edge/src/handler.ts Outdated
Comment thread edge/src/handler.ts Outdated
Comment thread hotpath/src/compute.rs Outdated
- Pin Swatinem/rust-cache to the peeled commit SHA (was the annotated
  tag object SHA — immutable but illegible to audit tooling/org policy).
- Assert post-build that the seeded, checksummed wasm-bindgen CLI is
  the only one in worker-build's cache: a future worker-build bump that
  hardcodes a different CLI version would otherwise silently orphan the
  seed and use an unchecksummed download.
- Fix hotpath/README's stale 'CLI on PATH' claim (PATH is ignored);
  document the worker-build-pin <-> cache-dir-name coupling in
  docs/architecture.md; de-platform the cache path (<host-triple>).
- Cut drift-prone per-workflow step enumerations from READMEs (link,
  don't list).
@kodus-27b

This comment has been minimized.

@27Bslash6

Copy link
Copy Markdown
Contributor Author

Red-run demonstration complete — every acceptance criterion is now CI-proven on this PR:

Component Red run (deliberate break, 5a78558) Green after revert
edge-qa run 30821657195 — eslint caught the planted error
hotpath-qa (native) run 30821657122cargo test caught the planted failing assert
hotpath-qa (wasm32) genuine red on the first push (run 30820254078): worker-build ignored PATH and used its hardcoded 0.2.105 CLI — exactly the friction docs/architecture.md predicted; fixed by seeding worker-build's cache

Also passed the workspace expert-panel review; surviving findings applied in 2d2a7e2 (rust-cache pinned to the peeled commit SHA, post-build assert that the seeded checksummed CLI was the one used, doc-contradiction fixes).

For ray: the checks exist and are green — marking edge-qa, hotpath-qa (native/wasm32) and ingester-qa as required status checks is now a branch-protection decision (out of scope for this PR per LAB-1141).

kodus-27b[bot]
kodus-27b Bot previously approved these changes Aug 3, 2026
- persist-credentials: false on every checkout in the two new workflows
  (read-only QA jobs never need the token in .git/config).
- README: 'No CD by design' overclaimed — the ingester rides Render's
  git-push auto-deploy after first setup; scoped the by-hand statement.
- type-check finding rejected: edge/package.json defines the script and
  the step passed on this PR.

CodeRabbit-Resolved: .github/workflows/edge-qa.yml:24:persist-credentials
CodeRabbit-Resolved: .github/workflows/edge-qa.yml:37:type-check-false-positive
CodeRabbit-Resolved: README.md:91:cd-statement
@kodus-27b

kodus-27b Bot commented Aug 3, 2026

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@27Bslash6

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@27Bslash6

Copy link
Copy Markdown
Contributor Author

@kody start-review

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@27Bslash6
27Bslash6 merged commit 28e586d into main Aug 5, 2026
5 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