lab install.sh one-liner ignores the fetched branch — always builds lab from development #317

Open
opened 2026-06-09 14:23:42 +00:00 by mahmoud · 0 comments
Owner

Summary

crates/lab/install.sh invoked as the documented one-liner
(curl -sSfL .../raw/branch/<X>/crates/lab/install.sh | bash) does not
build lab from branch <X>. It always clones hero_skills@development and
builds lab (with --locked) against whatever that branch's lab Cargo.lock
pins — i.e. the development-pinned herolib_*, hero_proc_sdk,
hero_blueprint, etc.

Why

  • BRANCH="${BRANCH:-development}" — the default branch is development.
  • In one-liner mode the script is read from stdin, so the
    "use existing checkout" detection (BASH_SOURCE[0] is a real file) never
    fires; it falls through to git clone --branch "$BRANCH".
  • The branch embedded in the URL the script was fetched from is invisible
    to the script, so fetching .../raw/branch/main/.../install.sh still clones
    and builds development.

Impact

The canonical release workflow (.forgejo/workflows/lab-publish.yaml) runs on
main, development, and integration. On main and integration runs the
build tool lab was still being compiled from development-pinned deps. Seen
directly in CI on a hero_proc integration run:

Compiling herolib_oschema v0.6.0 (…/hero_lib.git?branch=development#599e2c37)
Compiling hero_proc_sdk    v0.6.0 (…/hero_proc.git?branch=development#f3d28e2b)
Compiling hero_rpc_generator v0.6.0 (…/hero_blueprint.git?branch=development#b63e0fec)
Compiling lab v0.1.0 (/root/code/hero_skills/crates/lab)

Current workaround (already in the canonical workflow)

The workflow now fetches install.sh from the matching branch and passes
--branch, which the script does honor:

curl -sSfL ".../raw/branch/${LAB_BRANCH}/crates/lab/install.sh" -o /tmp/lab-install.sh
bash /tmp/lab-install.sh --branch "${LAB_BRANCH}"

Suggested fix (upstream, so callers don't have to remember --branch)

  • Honor a BRANCH/LAB_BRANCH env var in one-liner mode (so
    ... | BRANCH=main bash works), and/or
  • default to main instead of development for stability, and/or
  • document clearly that one-liner callers MUST pass --branch to build lab
    from a specific branch.

Filed while rolling out the 3-branch canonical lab-publish.yaml across the
production repos.

## Summary `crates/lab/install.sh` invoked as the documented one-liner (`curl -sSfL .../raw/branch/<X>/crates/lab/install.sh | bash`) does **not** build `lab` from branch `<X>`. It always clones `hero_skills@development` and builds `lab` (with `--locked`) against whatever that branch's lab `Cargo.lock` pins — i.e. the `development`-pinned `herolib_*`, `hero_proc_sdk`, `hero_blueprint`, etc. ## Why - `BRANCH="${BRANCH:-development}"` — the default branch is `development`. - In one-liner mode the script is read from stdin, so the "use existing checkout" detection (`BASH_SOURCE[0]` is a real file) never fires; it falls through to `git clone --branch "$BRANCH"`. - The branch embedded in the **URL** the script was fetched from is invisible to the script, so fetching `.../raw/branch/main/.../install.sh` still clones and builds `development`. ## Impact The canonical release workflow (`.forgejo/workflows/lab-publish.yaml`) runs on `main`, `development`, and `integration`. On `main` and `integration` runs the build tool `lab` was still being compiled from `development`-pinned deps. Seen directly in CI on a hero_proc `integration` run: ``` Compiling herolib_oschema v0.6.0 (…/hero_lib.git?branch=development#599e2c37) Compiling hero_proc_sdk v0.6.0 (…/hero_proc.git?branch=development#f3d28e2b) Compiling hero_rpc_generator v0.6.0 (…/hero_blueprint.git?branch=development#b63e0fec) Compiling lab v0.1.0 (/root/code/hero_skills/crates/lab) ``` ## Current workaround (already in the canonical workflow) The workflow now fetches install.sh from the matching branch **and** passes `--branch`, which the script does honor: ```bash curl -sSfL ".../raw/branch/${LAB_BRANCH}/crates/lab/install.sh" -o /tmp/lab-install.sh bash /tmp/lab-install.sh --branch "${LAB_BRANCH}" ``` ## Suggested fix (upstream, so callers don't have to remember --branch) - Honor a `BRANCH`/`LAB_BRANCH` env var in one-liner mode (so `... | BRANCH=main bash` works), **and/or** - default to `main` instead of `development` for stability, **and/or** - document clearly that one-liner callers MUST pass `--branch` to build lab from a specific branch. Filed while rolling out the 3-branch canonical `lab-publish.yaml` across the production repos.
mahmoud added this to the now milestone 2026-06-10 09:21:21 +00:00
mahmoud added this to the ACTIVE project 2026-06-10 09:21:23 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_skills#317
No description provided.