Skip to content

perf(#9251): skip the GitLab CLI download when the image matches the pin - #9447

Merged
ggallen merged 1 commit into
mainfrom
agent/9251-skip-redundant-cli-reinstall
Nov 13, 2026
Merged

ggallen merged 1 commit into
mainfrom
agent/9251-skip-redundant-cli-reinstall

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

The GitLab scaffold's install-fullsend-cli.sh now skips the CLI download when the CLI already in the runner image reports exactly the pinned release. This applies to release pins and unset (latest) pins. Branch and SHA pins still build from source, and the private-CA trust step and CI_DEBUG_TRACE guard run in every case.

Related Issue

#9251

Changes

  • internal/scaffold/fullsend-repo-gitlab/.gitlab/ci/scripts/install-fullsend-cli.sh: in the v* path, run fullsend --version and skip the download/checksum/extract when the output equals fullsend version X.Y.Z for the pinned vX.Y.Z. The comparison is exact, so a prerelease (0.55.0-rc1), a dev-... build, a missing or broken binary, or unexpected output all fall through to the existing checksum-verified download. The existing download code is unchanged, just indented into the else branch.
  • latest (unset pin): this is a match-only check. The script still resolves the latest tag through the GitHub API, as it does today, and then compares. A cached :latest image that predates the newest release therefore still downloads it. The API lookup stays, but the per-run binary download goes away.
  • internal/scaffold/gitlab_job_scripts_test.go: the stub fullsend can report a chosen version (FULLSEND_STUB_VERSION) or fail (FULLSEND_STUB_FAIL), and the stub curl can answer the latest-release lookup (CURL_STUB_LATEST_TAG). New tests cover:
    • a release pin that matches the image (no download, no build)
    • mismatches (older release, prerelease, dev build, unparseable output, broken binary)
    • latest matching the image, and latest with an older image
    • a SHA pin, which still builds from source even when the image reports the same string
  • internal/scaffold/installfiles.go: updated the ResolveFullsendVersion comment, which said the before_script always overwrites the image binary.
  • docs/guides/getting-started/configuring-gitlab.md: the "Runner image version" section now describes when the jobs skip the download.

The comparison string was checked against a real build: with the runner image's ldflags (buildinfo.version=0.55.0), fullsend --version prints fullsend version 0.55.0.

Note: when the download is skipped, the job uses the image's own binary, which is built with CGO_ENABLED=1 -tags ORT, instead of the static release tarball. Running the image's binary is what the issue asks for.

Testing

  • go test ./internal/scaffold/... ./internal/repos/... passes
  • Tests added for the new skip and fall-through paths
  • make lint: pre-commit could not fetch its hook repos in the sandbox (TLS failure), so the applicable hooks were run directly instead. These passed: shellcheck (same args), gofmt, go vet, whitespace/EOF/line-ending checks, lint-docs-links, lychee, lint-broken-symlinks, and the secret scan. semgrep was not run because its ruleset download is blocked in the sandbox.
  • internal/cli TestStartFetchService_* and TestPostScriptEnv_NoSchemaAppended* fail in the sandbox with and without this change (local socket permissions / environment), so they are unrelated.

Checklist

  • PR title follows Conventional Commits (correct type, ! for breaking changes)
  • Commits are signed off (DCO): not applicable, autonomous agent commit
  • I wrote this contribution myself and can explain all changes in it: not applicable, agent-authored

🤖 Generated with Claude Code


Closes #9251

Post-script verification

  • Branch is not main/master (agent/9251-skip-redundant-cli-reinstall)
  • Secret scan passed (gitleaks — bc4f5fe240efa31276b22ccc901ee5dabe052c8c..HEAD)
  • PR body secret scan passed (gitleaks — no-git)
  • Final PR description secret scan passed (gitleaks — no-git)

The GitLab poll, dispatcher, and agent jobs source
install-fullsend-cli.sh, which downloaded the pinned release CLI on
every run. The runner image rendered for a release pin (X.Y.Z) or an
unset pin (latest) already carries that release's CLI, so the download
was redundant. The poll job runs every five minutes per project, and
the download writes to /usr/local/bin.

In the release path, the script now runs `fullsend --version` and skips
the download when the CLI on PATH reports exactly
"fullsend version X.Y.Z" for the pinned vX.Y.Z. For an unset pin the
latest tag is still resolved first, so a cached :latest image that
predates the newest release still downloads it. A prerelease, dev
build, missing, or broken binary also downloads. Branch and SHA pins
keep the source build. CA trust and the CI_DEBUG_TRACE guard run in
every path.

Tests stub `fullsend --version` and the latest-release lookup to cover
match, mismatch, latest, and SHA pins. The ResolveFullsendVersion
comment and the GitLab guide's runner image section are updated.

Note: pre-commit could not fetch its hook repos (TLS failure in the
sandbox); the hooks were run directly instead. semgrep was skipped
because its ruleset could not be downloaded. internal/cli
TestStartFetchService_* and TestPostScriptEnv_NoSchemaAppended* fail
in the sandbox with and without this change.

Closes #9251

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 7:42 PM UTC · Completed 7:52 PM UTC

Commit: d277dbb · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.76

@github-actions

Copy link
Copy Markdown

Site preview

Preview: https://f9bb7a08-site.fullsend-ai.workers.dev

Commit: d277dbb562d1a581b7b2a3fed48d45c0f87a10a9

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Nov 13, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Focused 4-file change with clear issue alignment and no protected path changes, moderated to score 2 by elevated git history churn and coupling across GitLab scaffold and documentation files alongside modifying existing script behavior without a toggle.

@fullsend-ai-review

Copy link
Copy Markdown

Looks good to me


Labels: PR changes the GitLab runner-image CLI install script and its guide.

@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge component/runner Agent runner behavior and lifecycle component/docs User-facing documentation labels Nov 13, 2026
@codecov

codecov Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ggallen
ggallen added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit 01252d3 Nov 13, 2026
92 of 93 checks passed
@ggallen
ggallen deleted the agent/9251-skip-redundant-cli-reinstall branch November 13, 2026 23:43

This branch was successfully deployed

1 active and 1 inactive deployments
site-preview — d277dbb5 Deployed Nov 13, 2026 by github-actions[bot]
dev — d277dbb5 Deployed Nov 13, 2026 by fullsend-ai-coder[bot] via behaviour #20179
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/docs User-facing documentation component/runner Agent runner behavior and lifecycle ready-for-merge All reviewers approved — ready to merge ready-for-review Triggers review agent dispatch risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gitlab: skip the redundant CLI reinstall when the runner image already matches fullsend_ref

1 participant