Skip to content

feat: configurable setup script timeout (CYPACK-1080)#1114

Open
cyrusagent wants to merge 1 commit into
mainfrom
cypack-1080
Open

feat: configurable setup script timeout (CYPACK-1080)#1114
cyrusagent wants to merge 1 commit into
mainfrom
cypack-1080

Conversation

@cyrusagent
Copy link
Copy Markdown
Contributor

Assignee: @Connoropolous (connor)

Summary

Setup scripts previously had a hard-coded 5-minute timeout, which is too short for steps like a full database restore. Introduces per-repo and global overrides in ~/.cyrus/config.json.

Fixes CYPACK-1080 (GitHub issue #1102).

Changes

  • setupScriptTimeoutMs (number, per-repo) — timeout in milliseconds for the repository setup script (cyrus-setup.sh/.ps1/.cmd/.bat). Added to RepositoryConfig.
  • global_setup_script_timeout_ms (number, top-level) — timeout in milliseconds for the global setup script. Added to EdgeConfig.
  • Both default to 300000 (5 minutes), so unchanged configs behave exactly as before.
  • Timeout-exceeded log message now reports the actual timeout instead of hard-coding "5 minutes".

Implementation

  • packages/core/src/config-schemas.ts: added both Zod fields; JSON schemas regenerated.
  • packages/edge-worker/src/GitService.ts: runSetupScript and runRepoSetupScript now accept a timeoutMs parameter; CreateGitWorktreeOptions.globalSetupScriptTimeoutMs is threaded through createGitWorktreecreateSingleRepoWorktreerunSetupScript; per-repo timeout is read from repository.setupScriptTimeoutMs.
  • apps/cli/src/services/WorkerService.ts: forwards edgeConfig.global_setup_script_timeout_ms into createGitWorktree.
  • docs/SETUP_SCRIPTS.md, docs/CONFIG_FILE.md: documented both new fields with JSON examples.

Test plan

  • New unit tests in packages/edge-worker/test/GitService.test.ts cover:
    • default 5-minute timeout when no override is set
    • globalSetupScriptTimeoutMs option is honored for the global setup script
    • repository.setupScriptTimeoutMs is honored for the per-repo setup script
  • pnpm test:packages:run — all 571 edge-worker tests pass
  • pnpm typecheck — clean across all packages
  • pnpm biome check — no new warnings introduced
  • JSON schema sync test passes (schemas regenerated from Zod)

Tip: I will respond to comments that @ mention @cyrusagent on this PR. You can also submit a review with all your feedback at once, and I will automatically wake up to address each comment.

Setup scripts were killed after a hard-coded 5-minute timeout, which is
too short for steps like full database restores. Expose two overrides
in ~/.cyrus/config.json:

- `setupScriptTimeoutMs` on a repository entry — controls the timeout
  for `cyrus-setup.sh`/`.ps1`/`.cmd`/`.bat` for that repo.
- `global_setup_script_timeout_ms` at the top level — controls the
  timeout for `global_setup_script`.

Both are in milliseconds and default to 300_000 (5 minutes), preserving
existing behavior for users who don't set them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant