Commit Graph
9 Commits
Author SHA1 Message Date
Omar Sobh bfcc11de82 runner follow-ups: XDG config path + composite action + docs
Build with clawstor cache / Cargo build (clawstor-cached) (pull_request) Successful in 10s
Three fixes surfaced by the 2026-07-13 Gitea Actions wire-up.

## XDG config path

Before: `client_config::user_config_path` only looked at
`~/.claw-cargo/config.toml`. My runner-integration doc initially
told operators to install at `~/.config/claw-cargo/config.toml`
(XDG-style). Config wasn't loaded.

Now: three-way lookup, first hit wins.
  1. `$XDG_CONFIG_HOME/claw-cargo/config.toml`
  2. `$HOME/.config/claw-cargo/config.toml`
  3. `$HOME/.claw-cargo/config.toml` (legacy, still honoured)

+3 tests: XDG env wins when the file exists, .config wins over
legacy dotfile when both present, legacy dotfile returned as
error-message fallback when none exist.

## Composite action

Before: composite action silently no-op'd. Log showed the script
lines echoed but only the `if command -v claw-cargo` fail branch
ran. Root cause: Gitea Actions composite steps run with a stripped
PATH that omits `/usr/local/bin`.

Now: composite step exports PATH defensively:

    export PATH="/usr/local/bin:$HOME/.cargo/bin:$PATH"

And it looks for the config at BOTH the XDG-style path and the
legacy dotfile (same order as client_config).

Workflow file back to using the composite action.

## Docs

Runner-integration doc now:
- Explicitly warns that `ubuntu-latest` routes to container mode
  even with `:host` suffix on runner labels (field-observed).
- Documents the dedicated `clawstor-cache` label pattern that
  works.
- Sample workflow uses `runs-on: clawstor-cache` instead of
  `ubuntu-latest`.

+3 tests, 262 total (baseline unchanged).
2026-07-13 06:21:42 -07:00
Omar Sobh 927c3e03ea workflow: check ~/.claw-cargo/config.toml (actual convention)
Build with clawstor cache / Cargo build (clawstor-cached) (push) Successful in 7s
client_config.rs load_layered looks at ~/.claw-cargo/config.toml,
not ~/.config/claw-cargo/config.toml. Fix the workflow preflight
path to match. Both runners already have the file at both locations.
2026-07-13 01:48:50 -07:00
Omar Sobh 9bae8ab69b workflow: inline all steps instead of composite action
Build with clawstor cache / Cargo build (clawstor-cached) (pull_request) Failing after 3s
Composite action was being echoed but not executed. Inline to
validate.
2026-07-13 01:45:24 -07:00
Omar Sobh 0c941e7d08 workflow: debug PATH + explicitly add /usr/local/bin to GITHUB_PATH
Build with clawstor cache / Cargo build (clawstor-cached) (pull_request) Failing after 5s
Runner reports claw-cargo MISSING even though it is at
/usr/local/bin/claw-cargo. Debug what PATH the workflow inherits.
2026-07-13 01:43:05 -07:00
Omar Sobh 98c600bf78 workflow: use dedicated clawstor-cache runner label
Build with clawstor cache / Cargo build (clawstor-cached) (pull_request) Failing after 3s
Fleet has 7 linux-amd64 runners; only tank + architect have
claw-cargo provisioned. Added a clawstor-cache:host label to those
two runners so this workflow only lands on them.
2026-07-13 01:41:39 -07:00
Omar Sobh 8ada892e37 workflow: constrain runner to linux-amd64 to avoid macOS matcher
Build with clawstor cache / Cargo build (clawstor-cached) (pull_request) Failing after 4s
Bare self-hosted matched a macOS runner (smith). Compound label
narrows to tank/architect where claw-cargo is provisioned.
2026-07-13 01:39:51 -07:00
Omar Sobh 4d309137e7 workflow: force host mode via self-hosted label
Build with clawstor cache / Cargo build (clawstor-cached) (pull_request) Failing after 5s
ubuntu-latest routes to container mode in act_runner even with the
:host suffix on the runner labels. Explicit self-hosted forces
host-mode where /usr/local/bin/claw-cargo + per-runner tls_dir are
visible.
2026-07-13 01:37:45 -07:00
Omar Sobh cb9d3d5180 workflow: drop apt/rustup install steps for host runner
Build with clawstor cache / Cargo build (clawstor-cached) (pull_request) Failing after 3s
Host runners have cmake/gcc/pkg-config from the OS and cargo/rustup
in the act_runner user's ~/.cargo/bin. apt-get needs root — the
runner isn't. Replace with a preflight that fails fast when any
tool is missing.
2026-07-13 01:35:23 -07:00
Omar Sobh 89f5892e20 gitea: composite cargo-cache action + runner-integration doc
Build with clawstor cache / Cargo build (clawstor-cached) (pull_request) Failing after 4s
Ships the wire-up piece for real CI: a composite Gitea Action that
wraps `claw-cargo build` with cache-outcome reporting, plus a
matching workflow file that opts the clawstor repo itself into
being cache-hit-tested on every push. Also docs the one-time
per-runner provisioning (leaf cert, PATH install, config.toml).

* `.gitea/actions/cargo-cache/action.yml` — composite Action.
  Inputs: workspace, profile, no-upload, parallel-restore. Outputs:
  cache-outcome (HIT|MISS|POPULATED|SKIPPED), fingerprint,
  elapsed-seconds. Runner-side config lives in
  `~/.config/claw-cargo/config.toml` (not in the workflow — no
  secrets shipped from repos).
* `.gitea/workflows/build-with-cache.yml` — dogfoods the action on
  clawstor's own repo. `no-upload` set from event_name so PRs from
  forks can't poison the cache.
* `docs/runner-integration.md` — one-time setup steps, sample
  workflow snippet, expected numbers (Pi 5: 2.79× wall, tank:
  2.18×), and troubleshooting for the failures I hit in the tank
  and Pi pilots (bind_lan on fabric-only, missing CLI/config,
  rustc drift warn).

Test protocol: push this branch → main triggers the workflow → the
runner on tank has claw-cargo + tls + config provisioned already
(2026-07-13 pilot setup) → first build should MISS + populate,
subsequent build on same fingerprint should HIT.
2026-07-13 01:29:51 -07:00