Skip to content

Commit 497ee4e

Browse files
committed
feat: run git pull on all repos when workspacePath doesn't match
Addresses feedback from @cte in PR #5344 comment: #5344 (comment) When the workspacePath doesn't exactly match a repo path, we now run git pull on all configured repos instead of just the workspace directory. This ensures all repositories are up to date regardless of the workspace location. Changes: - Modified runTask function to iterate through all REPO_CONFIGS when no exact match is found - Added REPO_CONFIGS to imports from repoConfig module - Enhanced logging to indicate when pulling all repos vs single repo
1 parent 58cc547 commit 497ee4e

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

packages/evals/src/cli/runTask.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
createToolError,
2727
} from "../db/index.js"
2828
import { EVALS_REPO_PATH } from "../exercises/index.js"
29-
import { getRepoConfig } from "../config/repoConfig.js"
29+
import { getRepoConfig, REPO_CONFIGS } from "../config/repoConfig.js"
3030

3131
import { Logger, getTag, isDockerContainer } from "./utils.js"
3232
import { redisClient, getPubSubKey, registerRunner, deregisterRunner } from "./redis.js"
@@ -169,14 +169,18 @@ export const runTask = async ({ run, task, publish, logger }: RunTaskOptions) =>
169169
// Continue execution even if git pull fails
170170
}
171171
} else {
172-
// Fallback: try git pull in the workspace directory
173-
logger.info(`performing git pull in workspace: ${workspacePath}`)
174-
try {
175-
const gitPullResult = await execa("git", ["pull"], { cwd: workspacePath })
176-
logger.info(`git pull completed successfully: ${gitPullResult.stdout}`)
177-
} catch (error) {
178-
logger.warn(`git pull failed in workspace ${workspacePath}: ${error}`)
179-
// Continue execution even if git pull fails
172+
// If workspacePath doesn't exactly match a repo path, run git pull on all repos
173+
logger.info(`workspace path ${workspacePath} doesn't match any repo config, performing git pull on all repos`)
174+
175+
for (const config of REPO_CONFIGS) {
176+
logger.info(`performing git pull for repo: ${config.name} at ${config.path}`)
177+
try {
178+
const gitPullResult = await execa("git", ["pull"], { cwd: config.path })
179+
logger.info(`git pull completed successfully for ${config.name}: ${gitPullResult.stdout}`)
180+
} catch (error) {
181+
logger.warn(`git pull failed for ${config.name}: ${error}`)
182+
// Continue execution even if git pull fails
183+
}
180184
}
181185
}
182186

0 commit comments

Comments
 (0)