fix(ci): check out shallowly #272

Merged
claudiomaradonna merged 1 commit from fix/ci-shallow-checkout into main 2026-12-02 22:28:05 +01:00
Collaborator

Why

The Maintenance workflow has failed on most runs since #269. In each failed run the checkout step gives up at "Fetching the repository" after about 3m40s, so no check runs and publish is skipped. After the merge of #271, codex-plugin was never created and claude-plugin still holds an older build.

Both jobs check out with fetch-depth: 0. The forge serves the whole history slowly. Measured from outside, a full fetch of this 1.9 MB repository takes 61 to 94 s, while a depth-1 clone of main takes 4 s. The checkout's three attempts each fail at about a minute.

What changed

  • checks checks out at depth 1. When the checkout leaves no local main, as on a pull request, its step "Name the main branch" fetches main's tip at depth 1 instead of branching from origin/main. git diff --check main needs nothing more.
  • publish checks out at depth 1, and a new step, "Fetch the tip of main", fetches main at depth 50. The rollback check in scripts/publish-form.sh needs a later commit that has already been published, and a push's checkout holds only the pushed commit and its ancestors.

How to verify

Base main at 7d92842, branch tip d2e20ab.

  1. Emulate the checks job:

    git clone --depth=1 --branch fix/ci-shallow-checkout file://$PWD /tmp/example/ci
    cd /tmp/example/ci
    git fetch --depth=1 --no-tags origin +refs/heads/main:refs/heads/main
    

    Then run the steps of docs/MAINTENANCE.md. All pass: 427 agent-configuration tests, 46 work-folder tests, ShellCheck, prettier, the static validator, and git diff --check main.

  2. Emulate publish on a late run:

    • in a bare repository whose codex-plugin holds the build of 7d92842, start a repository holding only ef93d38, fetched at depth 1;
    • run the new fetch step;
    • run scripts/publish-form.sh codex ef93d38 <bare repository>.

    It prints "a later commit … nothing published". Without the fetch step, 7d92842 is missing and the guard would let the older build through.

  3. This pull request's own Maintenance run passes its checkout in seconds. The run after the merge publishes claude-plugin and creates codex-plugin.

Considerations

  • A later commit more than 50 commits ahead of the one being published is still not seen by the rollback check.
  • The forge's garbage collection is running separately. A full fetch still took 94 s while it ran.

https://claude.ai/code/session_012wUN2eKSj9s2vRHJdFPNk3

## Why The Maintenance workflow has failed on most runs since #269. In each failed run the checkout step gives up at "Fetching the repository" after about 3m40s, so no check runs and `publish` is skipped. After the merge of #271, `codex-plugin` was never created and `claude-plugin` still holds an older build. Both jobs check out with `fetch-depth: 0`. The forge serves the whole history slowly. Measured from outside, a full fetch of this 1.9 MB repository takes 61 to 94 s, while a depth-1 clone of `main` takes 4 s. The checkout's three attempts each fail at about a minute. ## What changed - **`checks`** checks out at depth 1. When the checkout leaves no local `main`, as on a pull request, its step "Name the main branch" fetches `main`'s tip at depth 1 instead of branching from `origin/main`. `git diff --check main` needs nothing more. - **`publish`** checks out at depth 1, and a new step, "Fetch the tip of main", fetches `main` at depth 50. The rollback check in `scripts/publish-form.sh` needs a later commit that has already been published, and a push's checkout holds only the pushed commit and its ancestors. ## How to verify Base `main` at `7d92842`, branch tip `d2e20ab`. 1. Emulate the `checks` job: ```sh git clone --depth=1 --branch fix/ci-shallow-checkout file://$PWD /tmp/example/ci cd /tmp/example/ci git fetch --depth=1 --no-tags origin +refs/heads/main:refs/heads/main ``` Then run the steps of `docs/MAINTENANCE.md`. All pass: 427 agent-configuration tests, 46 work-folder tests, ShellCheck, prettier, the static validator, and `git diff --check main`. 2. Emulate `publish` on a late run: - in a bare repository whose `codex-plugin` holds the build of `7d92842`, start a repository holding only `ef93d38`, fetched at depth 1; - run the new fetch step; - run `scripts/publish-form.sh codex ef93d38 <bare repository>`. It prints "a later commit … nothing published". Without the fetch step, `7d92842` is missing and the guard would let the older build through. 3. This pull request's own Maintenance run passes its checkout in seconds. The run after the merge publishes `claude-plugin` and creates `codex-plugin`. ## Considerations - A later commit more than 50 commits ahead of the one being published is still not seen by the rollback check. - The forge's garbage collection is running separately. A full fetch still took 94 s while it ran. https://claude.ai/code/session_012wUN2eKSj9s2vRHJdFPNk3
fix(ci): check out shallowly
All checks were successful
Maintenance / checks (push) Successful in 9m8s
Maintenance / publish (push) Successful in 55s
d2e20ab45d
The forge serves the repository's whole history slowly enough that the
checkout's fetch failed three times and the checks never ran, as on the
merge of #271, while a shallow fetch takes seconds. The checks need
only the commit under test and the tip of main, and publishing needs
the recent commits its rollback check compares.
claudiomaradonna deleted branch fix/ci-shallow-checkout 2026-12-02 22:28:17 +01:00
First-time contributor

Command failed

The agent did not complete this command, so nothing came of it. A person should look at this thread.

The run failed at step "aoe_purge". The operator reads the job logs in the Windmill editor, or finds the run with: wmill job list --path f/agents/bot_commands

## Command failed The agent did not complete this command, so nothing came of it. A person should look at this thread. The run failed at step "aoe_purge". The operator reads the job logs in the Windmill editor, or finds the run with: `wmill job list --path f/agents/bot_commands`
Sign in to join this conversation.
No description provided.