Commit Graph

301 Commits

Author SHA1 Message Date
Peter Pistorius c2bde4d2ec Merge pull request #61 from redwoodjs/changeset-release/main
chore: version packages
@redwoodjs/agent-ci@0.3.1 dtu-github-actions@0.3.1
2026-03-17 22:37:44 +13:00
github-actions[bot] 2e9e8bb6f9 chore: version packages 2026-03-17 08:41:15 +00:00
Peter Pistorius 6e0ace7c3a chore: add changeset for job execution fixes 2026-03-17 21:37:04 +13:00
Peter Pistorius d85cc56690 Merge pull request #60 from simoncrypta/main
fix: handle rejected promises in job execution
2026-03-17 21:32:02 +13:00
Peter Pistorius ed4a92ebd5 Fix pull-requests. 2026-03-17 21:30:04 +13:00
Simon Gagnon 4bfd515bff refactor: use type guards and attach taskName to error 2026-03-16 23:21:17 -04:00
Simon Gagnon 1dcf0d74ef fix: handle rejected promises in job execution 2026-03-16 23:03:14 -04:00
Peter Pistorius 8fadb39584 Fix docs formatting. 2026-03-17 08:13:29 +13:00
Peter Pistorius 9769aac57b Update docs. 2026-03-17 08:10:35 +13:00
Peter Pistorius e8e2e823ea chore: update README, add engines field, scope release workflow paths 2026-03-16 21:26:58 +13:00
Peter Pistorius d74b1e634e Fix publishing. @redwoodjs/agent-ci@0.3.0 dtu-github-actions@0.3.0 2026-03-16 18:24:38 +13:00
Peter Pistorius 1ad079b338 chore: remove derive package and clean up references 2026-03-16 10:41:20 +13:00
Peter Pistorius c088fb5063 fix: use Node.js 24 for npm OIDC trusted publishing support
npm OIDC requires npm CLI >= 11.5.1, which is bundled with Node 24.
Node 22's npm doesn't support the OIDC handshake, causing 404 errors.
2026-03-16 07:48:21 +13:00
Peter Pistorius ec1b9d12c6 fix: add repository field for npm OIDC provenance verification 2026-03-16 07:31:17 +13:00
Peter Pistorius bad063f192 fix: add NPM_CONFIG_PROVENANCE for OIDC npm publishing 2026-03-16 07:26:44 +13:00
Peter Pistorius 9c1a67bf51 fix: restore derive filter in release test step 2026-03-16 07:23:48 +13:00
Peter Pistorius f009084c59 fix: remove derive filter from release test step 2026-03-16 07:21:27 +13:00
Peter Pistorius 399a1972ba fix: add id-token permission for npm OIDC provenance publishing 2026-03-16 07:09:14 +13:00
Peter Pistorius d2023fc9f3 fix: prevent recursive double test execution in pnpm -r test
pnpm -r test was including the root workspace, whose test script
is itself `pnpm -r test`, causing every test to run twice in parallel.
Both runs share /tmp/dtu_cache, and when one run's beforeEach cleanup
deleted temp files the other run's server was using → ENOENT.

Add --include-workspace-root=false to prevent the root workspace from
being matched by recursive test runs.
2026-03-16 07:00:42 +13:00
Peter Pistorius 31b8a0ce6a Merge pull request #58 from redwoodjs/changeset-release/main
chore: version packages
2026-03-16 06:15:27 +13:00
github-actions[bot] b67be925f1 chore: version packages 2026-03-15 17:00:23 +00:00
Peter Pistorius a3615d1448 Merge pull request #59 from redwoodjs/fix/issue-47-race-condition
fix: prevent generic pool from stealing runner-targeted jobs
2026-03-16 05:59:42 +13:00
Peter Pistorius 8f2dfb1d65 chore: add changeset 2026-03-16 05:43:32 +13:00
Peter Pistorius 38af50c9b2 fix: prevent generic pool from stealing runner-targeted jobs (#47)
When a runner-specific job was seeded, it was stored in both state.jobs
(generic pool) and state.runnerJobs (runner-targeted). A runner polling
before its own job was seeded could fall back to state.jobs and steal
another runner's job, leaving the original runner spinning indefinitely.

Fix: runner-targeted jobs now go only into state.runnerJobs. The generic
pool is reserved for jobs without runner affinity.

Adds three tests covering the race condition, concurrent stress with
8 runners, and the job-theft scenario.

Closes #47
2026-03-16 05:41:47 +13:00
Peter Pistorius 6c7ebad5b9 Merge pull request #57 from redwoodjs/feat/workflow-compatibility
feat: workflow compatibility — cross-job outputs, job-level if, fail-fast
2026-03-15 20:36:06 +13:00
Peter Pistorius d543138c0c feat: cross-job output capture via synthetic step + DTU parsing
The runner's FinalizeJob deletes _temp/_runner_file_commands/ inside the
container before exit, making  files unreachable from the host.

Solution: inject a synthetic 'Capture outputs' step (runs with if:always())
that reads all set_output_* files and echoes them as ::agent-ci-output::key=value.
The DTU parses these prefixed lines and persists them to outputs.json in the
runner's log directory. On job completion, local-job.ts reads outputs.json and
attaches the outputs to the JobResult.

Pipeline verified end-to-end — all 8 smoke tests pass:
- Cross-job outputs (setup-outputs → consume-outputs) ✅
- Job-level if:always() ✅
- Matrix shards with fail-fast:false ✅
- Artifacts, services, env vars ✅

All 279 unit tests pass.
2026-03-15 20:18:37 +13:00
Peter Pistorius b2c061ba1f fix: capture step outputs via DTU and fix _runner_file_commands path
- Fix extractStepOutputs path: _temp/_runner_file_commands/ (not root)
- DTU outputs endpoint now captures and persists outputs.json
- local-job.ts reads outputs.json from log dir instead of work dir
- Add smoke test jobs for cross-job outputs and if:always()

All 279 tests pass.
2026-03-15 19:22:17 +13:00
Peter Pistorius aa7f91e574 chore: add changeset for workflow compatibility features 2026-03-15 08:11:35 +13:00
Peter Pistorius e6ecd4a0ac feat(#54,#55): wire job-level if and fail-fast into CLI orchestration
#54 - Job-level if conditions:
- shouldSkipJob() evaluates if: conditions before dispatching
- Tracks upstream job results (success/failure/skipped)
- Creates synthetic skipped results for skipped jobs
- Default behavior: skip if any upstream dependency failed

#55 - Respect fail-fast setting:
- Replaces unconditional wave abort with parseFailFast check
- Only aborts if not all jobs in wave have fail-fast: false
- Logs when continuing despite failures

All 279 tests pass.
2026-03-15 08:06:49 +13:00
Peter Pistorius 12806b6af0 feat(#53): wire needsContext through CLI orchestration
- parseWorkflowSteps now accepts needsContext parameter
- All expandExpressions calls in step parsing thread needsContext
- cli.ts wave loop accumulates job outputs and builds needsContext
  for downstream jobs
- Step names now use raw YAML value for expression preservation

2 new tests, all 279 pass.
2026-03-15 08:03:43 +13:00
Peter Pistorius 19235bbc16 Merge pull request #50 from redwoodjs/changeset-release/main
chore: version packages
2026-03-15 07:59:01 +13:00
Peter Pistorius 394d748ac9 feat(#52): add resolveJobOutputs to map step outputs to job outputs
resolveJobOutputs() resolves job output templates (e.g.
${{ steps.check.outputs.skip }}) against the flat step outputs
captured by extractStepOutputs().

6 new tests, all 277 pass.
2026-03-15 07:57:02 +13:00
Peter Pistorius 275cf2bff6 feat: add workflow compatibility features
- fromJSON()/toJSON() expression functions
- Cross-job outputs: needsContext in expandExpressions, parseJobOutputDefs
- Job-level if: parseJobIf, evaluateJobIf with always/success/failure/==/!=
- strategy.fail-fast: parseFailFast
- extractStepOutputs: reads $GITHUB_OUTPUT files from _runner_file_commands
- outputs field added to JobResult
- Updated compatibility.md

39 new tests, all 271 tests pass.
2026-03-15 07:53:17 +13:00
github-actions[bot] ad5cc3e83c chore: version packages 2026-03-13 14:11:46 +00:00
Peter Pistorius 24125d64f6 v0.2.0. 2026-03-13 16:11:03 +02:00
Peter Pistorius d20287e73b v0.1.1 2026-03-13 16:03:38 +02:00
Peter Pistorius 5648f8c6a1 Clean up docs. 2026-03-13 15:35:19 +02:00
Peter Pistorius 2a488cee1f Bump versions. 2026-03-13 15:24:29 +02:00
Peter Pistorius 4280c4253e chore: fix README formatting 2026-03-13 15:14:02 +02:00
Peter Pistorius 9441452c07 chore: prepare initial release 2026-03-13 15:11:14 +02:00
Peter Pistorius 5fb1020908 Merge pull request #49 from redwoodjs/move-packages
chore: move cli and dtu-github-actions into packages/
2026-03-13 00:09:49 +02:00
Peter Pistorius c8dd79f478 chore: move cli and dtu-github-actions into packages/ 2026-03-13 00:07:29 +02:00
Peter Pistorius f5aa92021f Merge pull request #48 from redwoodjs/paths-filter
feat: add paths/paths-ignore filtering to isWorkflowRelevant
2026-03-12 23:59:47 +02:00
Peter Pistorius e2fdc0c359 feat: add paths/paths-ignore filtering to isWorkflowRelevant 2026-03-12 23:33:07 +02:00
Peter Pistorius 40fc512690 Merge pull request #46 from redwoodjs/pp-rename-to-agent-ci
Rename machinen to agent-ci
2026-03-12 23:11:30 +02:00
Peter Pistorius 17e03d6102 Make pause-on-failure an opt-in flag, exit-on-failure is now the default
- Flip pauseOnFailure default to false in cli.ts and local-job.ts
- Replace --exit-on-failure/-x with --pause-on-failure/-p
- Add .agents/rules.md requiring /agent-ci before completing work
- Rename verify workflow to agent-ci (aliased as validate) with -p flag
2026-03-12 23:09:21 +02:00
Peter Pistorius 5b8acda506 Rename machinen to agent-ci
- Rename package from 'machinen' to 'agent-ci' across all source, tests, scripts, configs, and docs
- Rename CLI binary from 'machinen' to 'agent-ci'
- Rename .machinen → .agent-ci, .env.machinen → .env.agent-ci, MACHINEN_* → AGENT_CI_*
- Rename --runner flag to --name/-n (--runner still accepted for compat)
- agent-ci-dev script now builds DTU before running CLI
- Extract YAML compatibility tables to cli/compatibility.md
- Expand CLI usage docs with per-command flag tables
- Document DOCKER_HOST support for remote Docker
2026-03-12 22:35:26 +02:00
Peter Pistorius d88c47dadc Merge pull request #45 from redwoodjs/pp-agent-mode-quiet
feat: agent mode + DTU tarball route
2026-03-10 23:15:10 +02:00
Peter Pistorius 6e69d5e473 feat: suppress animated rendering in agent mode, add DTU tarball route (#44)
When running inside an AI agent (AI_AGENT=1 or --quiet/-q flag), replace
the 80ms logUpdate render loop with a synchronous callback that emits
plain-text step progress to stderr. This avoids massive token waste from
animated spinners/trees that are meaningless to LLMs.

Agent-mode output includes: runner start with log path, step progress
(running/completed/failed), and pause-on-failure details with retry command.

Also adds a tarball route to the DTU so actions/checkout doesn't 404 — it
returns an empty tar.gz since the workspace is already bind-mounted.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 21:03:58 +00:00
Peter Pistorius 514c33b21c Merge pull request #43 from redwoodjs/pp-issue-28-runner-boot-time
feat: add boot timing debug logs for runner startup
2026-03-10 22:12:38 +02:00