Skip to content

CI never starts cargo xtask dev, so its bootstrap breaks unnoticed #53

Closed

Description

@fctl-sh

What is wrong. cargo xtask dev broke twice for people starting fresh, and CI caught neither. Its bootstrap posted the dev Claude credential to a route that doesn't exist, with a token the API rejects (#34, fixed in #33). It never installed worker-build, which wrangler dev runs to build the control plane (#41). Both turned up only when someone ran it on a fresh state or machine.

How it works now. The CI workflow's check job (.github/workflows/ci.yml) runs cargo xtask check: formatting, generated types, Biome and TypeScript, Clippy for native and wasm, the tests and the web build. Nothing starts wrangler dev or calls the API the way bootstrap and ensure_basics in xtask/src/dev.rs do. Only the deploy job builds the Worker with worker-build, on main, after installing it in a step of its own.

In an fctl sandbox with 4 CPUs and a warm cargo cache, a fresh-state cargo xtask dev reached "fctl dev is running" in 15 s with worker-build already installed, and in 79 s when it had to compile it first.

What should happen, if a person decides CI should check this

  • CI starts the local stack from a fresh state the way cargo xtask dev does, runs one fake-claude session to the end (fctl run -p playground "write notes.md"), and fails if any step fails.

Compatibility. CI and development tooling only: nothing ships to hosts or the control plane.

Decisions for a person

  • Whether CI should do this, for the minutes it adds to each pull request.
  • If so, whether it is a job of its own or a step after cargo xtask check, and how cargo xtask dev ends once the check is done. It runs until Ctrl-C today, so it would need something like a --smoke flag that stops after one session.

Split from #34.

Session: https://app.fctl.sh/s/ses_01M56GFH2FJV0NW90ZNRFWKEA3

Activity

  1. added
    enhancement
    release
    on Oct 18, 2026
  2. fctl-sh commented on Oct 18, 2026

    @fctl-sh
    ContributorAuthor

    I looked into whether this still needs doing, in https://app.fctl.sh/s/ses_01M58136GJ7HPPRNVW2YR21TX0.

    Today cargo xtask dev works. On main at d3ae832, from a fresh clone with no build cache, it reached "fctl dev is running" in 166 s, 74 s of it compiling worker-build. fctl run -p playground "write notes.md" then ran to a commit in about 2 s.

    It still needs a check, and for more than the bootstrap. Nothing in CI runs the control plane. cargo xtask check only compiles and lints it for wasm, and crates/fctl-control has no tests. The deploy job is the first to apply the migrations (to the production D1) and start the Worker. A smoke run of cargo xtask dev would be the only thing that runs the migrations, the Worker, the bootstrap, a host and an agent together before a deploy.

    #86 adds cargo xtask dev --smoke and runs it in a CI job of its own, next to check. deploy needs both. With #34's bug put back, it fails in 10 s with adding a Claude credential: HTTP 404.

    Cost, from #86's own runs on GitHub's 2-core runners:

    • With its cache: 1m57s. That's under check's 2m16s in the same run, so pull requests wait no longer.
    • Without a cache: 8m16s, mostly compiling worker-build.

    That's 2 billed minutes a run. At today's 103 runs, that's about 200 minutes a day, roughly 45% more than CI uses now. As a step after cargo xtask check it would be about 1 minute a run, but each pull request would wait about a minute longer.

    For a person: merging #86 decides that CI spends these minutes, and closes this issue. Closing #86 instead leaves this open.

    I also found that a failed cargo xtask dev leaves wrangler and workerd serving on 8787: it SIGKILLs only wrangler's launcher, so the next run's health check passes against the old Worker. #86 fixes that too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementrelease

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions