Skip to content

Fix CI: pin opencode install and repair fx/php builds on Ubuntu resolute base - #15

Open
f3l1x wants to merge 4 commits into
masterfrom
claude/nodejs-ci-fix-349fz6
Open

Fix CI: pin opencode install and repair fx/php builds on Ubuntu resolute base#15
f3l1x wants to merge 4 commits into
masterfrom
claude/nodejs-ci-fix-349fz6

Conversation

@f3l1x

@f3l1x f3l1x commented Aug 6, 2026

Copy link
Copy Markdown
Member

Summary

Fixes the flaky opencode installation that broke the nodejs smoke test, and repairs the fx/php builds that broke when codercom/enterprise-base:ubuntu moved to Ubuntu resolute.

Key Changes

opencode install hardened (all five images)

  • Version is pinned via ENV OPENCODE_VERSION (same convention as GLAB_VERSION). This skips the installer's unauthenticated api.github.com/releases/latest lookup, which gets rate-limited on shared GitHub Actions runner IPs — the cause of the original nodejs failure.
  • The binary stays in /home/coder/.opencode/bin owned by coder, so the coder user can still run opencode upgrade inside a workspace.
  • The || true around the installer is gone and opencode --version runs at build time, so a failed install now fails the build instead of producing a broken image.

fx + php builds fixed for Ubuntu resolute

  • ppa:ondrej/php publishes no release for resolute (404) and is being merged into packages.sury.org. PHP 8.5 and all required extensions are now installed from the native Ubuntu archive; the PPA and software-properties-common are removed.
  • ⚠️ php8.5-imap is dropped: the imap extension was unbundled from PHP core in 8.4 and no package exists for resolute (neither in the archive nor the PPA).

Silent-failure bug fixed (all five images)

The fx/php breakage went undetected at build time because of an unparenthesized chown ... || true late in the RUN chain: since && and || bind with equal precedence, that || true rescued the failed apt-get update, skipped every install step in between, and let the build "succeed" with an image missing node/php entirely. Ownership chowns are now plain commands and the remaining intentional fallbacks are parenthesized, so any mid-chain failure fails the build.

https://claude.ai/code/session_01S9abShYK5RMmbeuZurGH3b

claude added 2 commits August 5, 2026 09:47
The curl installer fetches the latest version from the unauthenticated
GitHub API, which is rate-limited on shared Actions runner IPs. Failures
were swallowed by '|| true', leaving a dangling /usr/local/bin/opencode
symlink and failing the 'opencode --version' test only after the build.

Install the opencode-ai npm package instead (npm registry only, no
GitHub API) and verify the binary during the build.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S9abShYK5RMmbeuZurGH3b
The codercom/enterprise-base:ubuntu image moved to Ubuntu resolute,
which broke fx and php builds in two compounding ways:

1. ppa:ondrej/php publishes no release for resolute (404). PHP 8.5 and
   all needed extensions are now in the native Ubuntu archive, so drop
   the PPA (and software-properties-common, only needed for it).
   php8.5-imap is dropped: the imap extension was unbundled from PHP
   core in 8.4 and no package exists for resolute.

2. The failure was masked by an unparenthesized 'chown ... || true'
   near the end of the RUN chain: && and || have equal precedence, so
   that '|| true' rescued the failed apt-get update, skipped every
   install step in between, and produced a 'successful' image with no
   node/php inside. Ownership chowns are now plain commands (their
   targets always exist) and the claude chmod fallbacks are
   parenthesized, so a mid-chain failure fails the build.

opencode is now installed with a pinned version (ENV OPENCODE_VERSION,
matching the GLAB_VERSION convention) instead of 'latest':
- deterministic: skips the unauthenticated api.github.com 'latest'
  lookup that gets rate-limited on shared Actions runners (the original
  nodejs failure) and downloads the release tarball directly
- the binary stays in /home/coder/.opencode/bin owned by coder, so the
  coder user can still run 'opencode upgrade' (replaces the earlier
  npm-based approach, which put a root-owned binary in /usr/lib)
- no '|| true': a failed install now fails the build, and
  'opencode --version' verifies the binary at build time

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S9abShYK5RMmbeuZurGH3b
@f3l1x f3l1x changed the title Simplify OpenCode installation to use npm package Fix CI: pin opencode install and repair fx/php builds on Ubuntu resolute base Aug 6, 2026
claude added 2 commits August 6, 2026 16:51
Test (fx) and Test (golang) failed with 'Failed to resolve action
download info: Service Unavailable' before any repo code ran.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S9abShYK5RMmbeuZurGH3b
Every installed tool now has an ENV *_VERSION pin: claude, deno, bun,
composer, codex, copilot, pi, t3, pnpm, agent-browser (opencode, glab,
go, node were already pinned). Conventions noted in CLAUDE.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S9abShYK5RMmbeuZurGH3b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants