Commit Graph

394 Commits

Author SHA1 Message Date
github-actions[bot] 4de00d6948 chore: version packages (#122)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@redwoodjs/agent-ci@0.7.1 dtu-github-actions@0.7.1
2026-04-07 15:43:50 +02:00
Peter Pistorius 8ff11e0497 test: add reproduction test for issue #126 (#132)
Adds a test that verifies resolveDtuHost() correctly uses the
AGENT_CI_DOCKER_BRIDGE_GATEWAY env var when the fs.existsSync mock
intercepts the /.dockerenv check. Verified passing both locally and
inside Docker via agent-ci.

Closes #126

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 15:22:41 +02:00
Peter Pistorius 73f6bf0685 fix: propagate job-level env into DTU Variables store (#104) (#131)
* fix: propagate job-level env into DTU Variables and add AGENT_CI_LOCAL to container env

Closes #104. Job-level `env` from the CLI payload was not propagated into
the DTU's Variables store or ContextData, so `AGENT_CI_LOCAL` was unavailable
to the runner's expression engine. Also adds `AGENT_CI_LOCAL=true` to the
Docker container env for shell access.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* ci: re-trigger agent-ci checks

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 13:44:47 +02:00
Peter Pistorius 336fb984fb fix: treat runner that never contacted DTU as failure (#130)
* fix: treat runner that never contacted DTU as failure

When the runner container exits with code 0 but never sent any timeline
entries (isBooting is still true), the job was incorrectly reported as
succeeded. Now checks !isBooting in the jobSucceeded condition.

Closes #102

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: treat runner that never contacted DTU as failure

When the runner container exits with code 0 but never sent any timeline
entries (isBooting is still true), the job was incorrectly reported as
succeeded. Extract isJobSuccessful() and add tests covering the #102
regression case.

Closes #102

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 12:54:36 +02:00
Peter Pistorius 5fadfee0eb fix: clean up all containers on signal, not just the first job's (#129)
* fix: remove stopped containers before network prune to prevent address pool exhaustion

Closes #107

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: clean up all containers on signal, not just the first job's

Each job registered process.once("SIGINT") with process.exit(1) in
the handler. The first handler to fire would kill the process before
other jobs' handlers could clean up their containers, leaving them
running indefinitely.

Changed to process.on so all handlers fire, removed process.exit(1)
from per-job handlers, and added a top-level handler in cli.ts that
defers exit until after all per-job cleanup completes.

Closes #107

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 12:25:04 +02:00
Peter Pistorius 17ef34087e fix: pin runnerName before DTU seed to prevent cross-workflow job stealing (#103) (#127)
When running --all, jobs seeded without runnerName landed in the shared
generic pool where runners from other concurrent workflows could steal
them, causing single-job workflows to hang indefinitely.

- Pin job.runnerName = containerName before the /_dtu/seed call
- Move container and ephemeralDtu cleanup into finally block
- Add process.setMaxListeners(0) for parallel job EventEmitter warnings
- Add reproduction test for generic pool job stealing

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 11:16:49 +02:00
Peter Pistorius 1e9d7caa9d feat: support pull_request_target in workflow relevance check (#124)
* feat: support pull_request_target in workflow relevance check

Treat pull_request_target identically to pull_request in isWorkflowRelevant(),
applying the same branch and paths filter logic. This fixes agent-ci --all
skipping workflows that use pull_request_target.

Closes #106

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: Docker container name collision when running multiple workflows via --all

Pre-allocate unique base run numbers per workflow before launching them
in parallel, so job suffixes (-j1, -j2, -j3) never produce duplicate
container names across concurrent workflows.

Closes #125

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: resolveDtuHost test and smoke-tests build

Clear AGENT_CI_DTU_HOST in resolveDtuHost tests so the bridge gateway
test exercises the correct code path when running inside agent-ci's
Docker containers (which inject AGENT_CI_DTU_HOST).

Scope binary-smoke build to @redwoodjs/agent-ci... to avoid building
apps/website which fails due to warm-modules symlink resolution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 10:16:01 +02:00
Peter Pistorius cc73a1f9c2 fix: atomic log directory allocation for concurrent runs (#123)
* fix: use atomic mkdir for concurrent log directory allocation

Closes #105

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test: add tests for atomic log directory allocation

Tests EEXIST collision handling, multiple consecutive collisions,
and uniqueness across many sequential calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: clear AGENT_CI_DTU_HOST in resolveDtuHost tests

The resolveDtuHost function returns early if AGENT_CI_DTU_HOST is set.
When tests run inside Docker via agent-ci, this env var is present,
causing the bridge gateway test to be bypassed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 10:03:15 +02:00
Peter Pistorius be5cacd35f fix: re-throw errors in handleWorkflow instead of swallowing them (#121)
The catch block in handleWorkflow was returning an empty array on error,
causing the CLI to exit 0 even when workflow setup failed. Now re-throws
so failures propagate and exit non-zero.

Closes #101

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 20:46:13 +02:00
github-actions[bot] 70f548cdcc chore: version packages (#118)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@redwoodjs/agent-ci@0.7.0 dtu-github-actions@0.7.0
2026-04-06 20:17:45 +02:00
Peter Pistorius c2fe31b888 feat: action tarball disk cache, step output capture, and demo recording (#117)
* feat: action tarball disk cache, step output capture, and demo recording

- Cache action tarballs on first download and serve from disk on re-runs,
  eliminating ~30s GitHub CDN delays
- Capture step output via tee to signals dir for reliable pause-on-failure
  tail display
- Fix CLI to treat empty results as failure and skip summary print
- Add marketing demo recording setup with VHS tape and test project
- Add `agent-ci` script alias in root package.json

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test: add tests for action tarball cache, group filtering, and empty-results fix (#119)

Cover the untested changes from the tarball cache PR: action tarball proxy
cache hit/miss, download info URL rewriting with sub-path stripping, step
output group filtering, tee output capture, and CLI empty-results exit logic.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* fix: prevent concurrent tarball cache-miss race condition

Use an in-flight download map so concurrent requests for the same
tarball coalesce into a single GitHub fetch instead of racing on
the same tmp file, which could cause corruption or rename errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: use relative path in demo.tape for portability

Replace hard-coded absolute path with a relative path so the demo
recording works on any contributor's machine.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: correct sanitized-refs test to assert 404 for slash-containing refs

The test was passing vacuously (status >= 200 matches 404). Now it
properly asserts that Polka does not bind :ref across slashes, so
slash-containing refs return 404 and do not serve cached content.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 20:16:18 +02:00
Peter Pistorius f9f17fd0b9 fix: only mount relevant PM cache for detected package manager (#114)
* fix: only mount relevant PM cache based on detected package manager

Projects using npm/yarn/bun no longer get unnecessary pnpm store bind
mounts (and vice versa). Detects PM from lockfile and conditionally
creates cache dirs, bind mounts, and virtual cache patterns.

Closes #112

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: add debug log for detected PM, remove verbose bind mount log

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* test: add PM-scoped caching integration tests

Tests createRunDirectories and buildContainerBinds for each package
manager (npm, pnpm, yarn, bun) plus the no-lockfile fallback. Each
test creates a real git repo fixture with the relevant lockfile and
verifies only the correct PM's cache dir and bind mount are produced.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 18:44:55 +02:00
Peter Pistorius acb750f346 feat: show Docker pull progress during boot (#116)
* feat: show Docker image pull progress during runner boot

Display download progress (bytes downloaded / total with percentage) as
a sub-step under "Starting runner" while pulling the container image.
Aggregates per-layer progress from the Docker API and throttles UI
updates to every 250ms.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: only track Downloading events for pull progress

Extracting events reset the current byte count per layer, making
overall progress appear stuck or go backwards. Filter to only
"Downloading" status events so progress climbs steadily to 100%.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: handle Download complete events to reach 100%

Docker's last event per layer is "Download complete" with no
progressDetail, so layers were never marked as fully downloaded.
Now explicitly set current = total when a layer completes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* debug: log all docker pull events to diagnose stuck progress

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: track download and extraction phases separately

The progress was getting stuck because:
1. "Download complete" events fired rapidly and got throttled
2. Extraction phase was invisible — no events passed the filter

Now tracks downloading and extracting as separate phases with
independent progress maps. The UI shows "Downloading: X/Y (Z%)"
then transitions to "Extracting: X/Y (Z%)" once extraction begins.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: force UI update on download→extract phase transition

The throttle was swallowing the first "Extracting" event, leaving
the display frozen on the last download snapshot. Now flushProgress
accepts a force flag and the first extraction event always triggers
an immediate store update regardless of throttle timing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: show reset hint when image pull takes over 60s

After 60s of pulling, shows a dim hint beneath the progress line:
  "Taking a while? Run: docker rmi <image>"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* debug: log logDir presence in boot node renderer

* fix: remove debug logging, shorten logDir, lower hint threshold to 30s

- Remove debug-renderer and pull flush diagnostic logging
- Shorten logDir display path to agent-ci/cli/runs/... so it stays
  visible alongside the progress line without wrapping
- Lower the "Taking a while?" hint threshold from 60s to 30s since
  Docker stalls immediately when resuming a partially cached layer

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: remove reset hint from pull progress display

The docker rmi hint wasn't helpful since it doesn't fix the stalled
download (the partial blob lives inside Docker's VM, not the layer
store). Removed along with the now-unused image/startedAt fields.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-06 18:43:59 +02:00
Peter Pistorius be06e223d1 feat(website): add blog section with first post (#113)
* feat(website): add blog section with first post

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(website): integrate blog section with routing and styles

* Add lock file.

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 08:51:14 +02:00
Peter Pistorius 91804ed850 docs: add blog post ideas from community feedback
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 12:34:35 +02:00
Peter Pistorius baacbd3a99 feat(website): add Ahmad Awais and Juho Vepsäläinen testimonials
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 07:08:23 +02:00
Peter Pistorius 2a4bd27a5c feat(website): add Copy Agent Instructions button (#111)
* feat(website): add Copy Agent Instructions button to hero and quick start sections

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: remove retry-proof failure test from CI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 06:19:13 +02:00
Peter Pistorius 4326a2b517 Merge pull request #98 from jokull/fix/large-monorepo-compat
fix: support large monorepos and sub-path actions
2026-03-29 15:19:02 +11:00
Jökull Sólberg 3bb8525421 fix: support large monorepos and sub-path actions
Three fixes discovered while running agent-ci against a ~40K file
pnpm/turbo monorepo:

1. Sub-path actions (e.g. `actions/cache/save@v5`) produce invalid
   tarball URLs. The DTU was using `action.nameWithOwner` directly
   which includes the sub-path, producing
   `api.github.com/repos/actions/cache/save/tarball/v5` (404).
   Fix: strip to `owner/repo` before constructing the URL.

2. `copyWorkspace` uses `execSync("git ls-files ...")` with the
   default 1MB maxBuffer. Repos with 30K+ tracked files overflow
   this, causing ENOBUFS and an empty workspace in the container.
   Fix: increase maxBuffer to 100MB.

3. Post-success cleanup `fs.rmSync(containerWorkDir)` can throw
   ENOTEMPTY when the container hasn't fully released file handles.
   Fix: wrap in try/catch for best-effort cleanup.
2026-03-27 22:58:00 +00:00
Peter Pistorius b01655c081 Merge pull request #84 from redwoodjs/changeset-release/main
chore: version packages
@redwoodjs/agent-ci@0.6.0 dtu-github-actions@0.6.0
2026-03-28 07:33:32 +11:00
github-actions[bot] 987477bae4 chore: version packages 2026-03-27 20:32:23 +00:00
Peter Pistorius 78c0ca9d78 Merge pull request #94 from redwoodjs/fix/show-full-step-log-on-failure
fix: show full per-step log in failure summary
2026-03-28 07:31:52 +11:00
Peter Pistorius 5b52862ed0 fix: update commit status target URL to agent-ci.dev
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 07:27:20 +11:00
Peter Pistorius 8ddffdd1db ci: run checks on PR open for repo members
Add 'opened' to pull_request_target types so checks fire immediately
when a PR is created by an owner/member/collaborator. External
contributors still require the 'safe-to-run' label (handled by the
existing if: condition on each job).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 07:19:22 +11:00
Peter Pistorius d273b76c64 fix: show full per-step log in failure summary
Replace the 20-line tail (with "Last output:" label and indentation)
with the full content of the per-step log file already captured at
failedStepLogPath. Falls back to lastOutputLines when no log file
exists (e.g. container crash).

Adds reporter.test.ts to prove the behaviour, and an end-to-end check
in tests.yml that runs the retry-proof workflow and asserts the step
output appears in stdout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 07:15:11 +11:00
Peter Pistorius 6ea8a21e2e Fix website. 2026-03-27 23:29:09 +11:00
Peter Pistorius 11a66eeecf Merge pull request #91 from redwoodjs/feat/website
feat: move website to apps/website, improve content and fix SSR
2026-03-27 21:28:47 +11:00
Peter Pistorius a572503483 Merge main into feat/website, resolving conflicts
- CompatibilityMatrix: keep individual tables rendering, take expanded notes from main
- headers.ts: keep both pbs.twimg.com and unavatar.io in img-src CSP
- wrangler.jsonc: keep agent-ci-website worker name and routes
- compatibility.md: keep expanded notes from feat/website
- Remove welcome.tsx and welcome.module.css (replaced by new site)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 21:19:52 +11:00
Peter Pistorius 0f70009d6c chore(website): configure wrangler with production worker name and routes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 21:09:31 +11:00
Peter Pistorius ce28e03d90 fix(website): update xcancel.com to x.com and allow external avatar images in CSP
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 21:07:17 +11:00
Peter Pistorius bf5ff183b4 Move website. 2026-03-27 20:05:24 +11:00
Peter Pistorius e9c8ae3e6d Update marketing stats. 2026-03-27 17:41:55 +11:00
Peter Pistorius 9c7af4e683 Merge pull request #88 from redwoodjs/docs/compatibility-notes
docs: add explanatory notes for concurrency and local actions
2026-03-27 17:32:27 +11:00
Peter Pistorius bdd269ff10 feat: move website to apps/website, improve content and fix SSR
- Move website from website/ to apps/website/ (update pnpm workspace)
- Remove logo icon from navbar, keep AGENT-CI text
- Configure domain routes for agent-ci.dev in wrangler.jsonc
- Replace tabs with stacked tables in compatibility matrix
- Expand all ⚠️ and ❌ notes with reasons and details
- Update compatibility.md to match website content
- Fix useContext SSR error by removing motion/react, using CSS animations
- Add img-src CSP header for pbs.twimg.com (Twitter profile images)
- Remove npx run --all command from hero, rename button to Quick start
- Remove decorative border elements from hero section
- Update footer "Built by" link to rwsdk.com

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 17:27:26 +11:00
Peter Pistorius 221b869d80 Merge pull request #89 from redwoodjs/feat/website
feat: add website (agent-ci.dev) as workspace package
2026-03-27 16:20:06 +11:00
Peter Pistorius d1bdd9f02e feat: add website (agent-ci.dev) as workspace package
Moves the agent-ci.dev marketing site into the monorepo under website/.
Built with RWSDK + Tailwind CSS, deployed to Cloudflare Workers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 15:26:07 +11:00
Peter Pistorius fe5dd27ec5 docs: add explanatory notes for concurrency and local actions in compatibility.md
- Explain why concurrency is unsupported (server-side mechanism, no local coordinator)
- Document local actions (uses: ./) as unsupported with fail-fast behaviour

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 15:01:00 +11:00
Peter Pistorius b9db825a32 Merge pull request #86 from redwoodjs/dependabot/npm_and_yarn/npm_and_yarn-e5a595f223
chore(deps): bump flatted from 3.4.1 to 3.4.2 in the npm_and_yarn group across 1 directory
2026-03-27 10:37:36 +11:00
Peter Pistorius 1a2ff652b5 Add video to example. 2026-03-27 10:36:24 +11:00
Peter Pistorius 76f64f4a35 docs: add marketing tweets directory with launch tweet
No changeset needed — docs-only change outside of packages/.
2026-03-27 10:18:44 +11:00
dependabot[bot] 571f8ebe71 chore(deps): bump flatted in the npm_and_yarn group across 1 directory
Bumps the npm_and_yarn group with 1 update in the / directory: [flatted](https://github.com/WebReflection/flatted).


Updates `flatted` from 3.4.1 to 3.4.2
- [Commits](https://github.com/WebReflection/flatted/compare/v3.4.1...v3.4.2)

---
updated-dependencies:
- dependency-name: flatted
  dependency-version: 3.4.2
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-26 14:26:15 +00:00
Peter Pistorius 60b0105413 Merge pull request #83 from redwoodjs/feat/commit-status
feat: post GitHub commit status via gh CLI
2026-03-26 05:29:29 +13:00
Peter Pistorius 6e7494bc8b fix: remove tickmark from commit status description
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 05:28:33 +13:00
Peter Pistorius 98ccd6fb8f fix: use checkmark instead of emoji in commit status description
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 05:27:13 +13:00
Peter Pistorius ec535e1508 fix: remove 4-byte emoji from commit status description
GitHub's commit status API rejects 4-byte Unicode characters.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 03:40:41 +13:00
Peter Pistorius ad7482fcac fix: auto-run CI for repo members without requiring safe-to-run label
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 03:29:56 +13:00
Peter Pistorius f80dd3253d fix: remove push trigger from CI workflows to eliminate duplicate checks
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 03:23:01 +13:00
Peter Pistorius a9cc7f7fca feat: update success commit status message
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-26 03:04:52 +13:00
Peter Pistorius 97227c4251 Merge pull request #77 from simoncrypta/fix/docker-host-ip
fix: make Docker host resolution universal
2026-03-26 02:41:29 +13:00
Simon Gagnon 345b24ba34 docs: deduplicate docker host config guidance
Keep root README concise by linking to the CLI README section as the source of truth for custom Docker host resolution configuration.
2026-03-24 19:31:00 -04:00