Skip to content

Commit 0703e1c

Browse files
authored
feat(pipeline): add --target and --targets flags to pipeline run and pipeline input (#1108)
* feat(pipeline): add --target and --targets flags to pipeline run and pipeline input Mirrors the --target / --targets options already available on \�gentv eval run\. Allows reusing the same eval.yaml across different targets without duplicating files. Both commands now accept: --target <name> Override target name from targets.yaml --targets <path> Path to targets.yaml (overrides discovery) These values are forwarded directly to selectTarget() via cliTargetName and explicitTargetsPath, the same pathway used by eval run. Fixes #1107 * style(pipeline): remove stray blank line in run.ts * docs(agents): note bun install after branch/PR checkout
1 parent 7e24450 commit 0703e1c

3 files changed

Lines changed: 30 additions & 2 deletions

File tree

AGENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,10 @@ cp "$(git worktree list --porcelain | head -1 | sed 's/worktree //')/.env" .env
494494
```
495495
Both steps are required before running builds, tests, or evals in the worktree.
496496

497+
### After Checking Out an Existing Branch or PR
498+
499+
Whenever you `git checkout`, `gh pr checkout`, `git pull`, or otherwise switch to a ref that may have changed `package.json` / `bun.lock`, run `bun install` before building, testing, or pushing. The pre-push hook builds all workspaces — if dependencies are stale, the push fails with errors like `Cannot find module 'recharts'` even though the source change is unrelated. `bun install` is cheap when already up-to-date, so run it by default after any ref switch.
500+
497501
## Version Management
498502

499503
This project uses a simple release script for version bumping. The git commit history serves as the changelog.

apps/cli/src/commands/pipeline/input.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,18 @@ export const evalInputCommand = command({
6565
long: 'experiment',
6666
description: 'Experiment label (e.g. with_skills, without_skills)',
6767
}),
68+
target: option({
69+
type: optional(string),
70+
long: 'target',
71+
description: 'Override target name from targets.yaml (mirrors eval run --target)',
72+
}),
73+
targets: option({
74+
type: optional(string),
75+
long: 'targets',
76+
description: 'Path to targets.yaml (overrides discovery)',
77+
}),
6878
},
69-
handler: async ({ evalPath, out, experiment }) => {
79+
handler: async ({ evalPath, out, experiment, target, targets }) => {
7080
const resolvedEvalPath = resolve(evalPath);
7181
const outDir = resolve(out ?? buildDefaultRunDir(process.cwd(), experiment));
7282
const repoRoot = await findRepoRoot(dirname(resolvedEvalPath));
@@ -94,6 +104,8 @@ export const evalInputCommand = command({
94104
testFilePath: resolvedEvalPath,
95105
repoRoot,
96106
cwd: evalDir,
107+
cliTargetName: target,
108+
explicitTargetsPath: targets,
97109
dryRun: false,
98110
dryRunDelay: 0,
99111
dryRunDelayMin: 0,

apps/cli/src/commands/pipeline/run.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,18 @@ export const evalRunCommand = command({
9292
description:
9393
'Which grading phase to run: "code" runs code-graders inline, omit to skip grading (use pipeline grade separately)',
9494
}),
95+
target: option({
96+
type: optional(string),
97+
long: 'target',
98+
description: 'Override target name from targets.yaml (mirrors eval run --target)',
99+
}),
100+
targets: option({
101+
type: optional(string),
102+
long: 'targets',
103+
description: 'Path to targets.yaml (overrides discovery)',
104+
}),
95105
},
96-
handler: async ({ evalPath, out, workers, experiment, graderType }) => {
106+
handler: async ({ evalPath, out, workers, experiment, graderType, target, targets }) => {
97107
const resolvedEvalPath = resolve(evalPath);
98108
const outDir = resolve(out ?? buildDefaultRunDir(process.cwd(), experiment));
99109
const repoRoot = await findRepoRoot(dirname(resolvedEvalPath));
@@ -124,6 +134,8 @@ export const evalRunCommand = command({
124134
testFilePath: resolvedEvalPath,
125135
repoRoot,
126136
cwd: evalDir,
137+
cliTargetName: target,
138+
explicitTargetsPath: targets,
127139
dryRun: false,
128140
dryRunDelay: 0,
129141
dryRunDelayMin: 0,

0 commit comments

Comments
 (0)