Skip to content

fix(workflow-executor): single source of truth for CLI defaults#1596

Merged
nbouliol merged 1 commit into
feat/prd-214-server-step-mapperfrom
feature/prd-394-cli-defaults-single-source
May 26, 2026
Merged

fix(workflow-executor): single source of truth for CLI defaults#1596
nbouliol merged 1 commit into
feat/prd-214-server-step-mapperfrom
feature/prd-394-cli-defaults-single-source

Conversation

@nbouliol
Copy link
Copy Markdown
Member

@nbouliol nbouliol commented May 26, 2026

Summary

  • Created src/defaults.ts exporting all 6 CLI-visible defaults (DEFAULT_HTTP_PORT, DEFAULT_FOREST_SERVER_URL, DEFAULT_POLLING_INTERVAL_MS, DEFAULT_STEP_TIMEOUT_MS, DEFAULT_STOP_TIMEOUT_MS, DEFAULT_MAX_CHAIN_DEPTH).
  • build-workflow-executor.ts, runner.ts, and cli-core.ts now import from defaults.ts instead of duplicating constants.
  • logStartup now resolves forestServerUrl/pollingIntervalMs against the defaults so logged values match runtime behavior (previously logged undefined when env vars were unset).

fixes PRD-394

Test plan

  • yarn workspace @forestadmin/workflow-executor test (774 passing)
  • yarn workspace @forestadmin/workflow-executor lint (no new warnings)
  • yarn workspace @forestadmin/workflow-executor build
  • New test asserts printHelp output contains every default value
  • New test asserts logStartup logs resolved defaults when env-derived options are undefined

🤖 Generated with Claude Code

Note

Centralize CLI default constants in workflow-executor into a single defaults module

  • Introduces defaults.ts as the single source of truth for DEFAULT_HTTP_PORT, DEFAULT_FOREST_SERVER_URL, DEFAULT_POLLING_INTERVAL_MS, DEFAULT_STEP_TIMEOUT_MS, DEFAULT_STOP_TIMEOUT_MS, and DEFAULT_MAX_CHAIN_DEPTH.
  • Updates cli-core.ts, build-workflow-executor.ts, and runner.ts to import from ./defaults instead of defining constants locally.
  • logStartup now logs the default pollingIntervalMs value when none is provided, closing a gap in startup output.
  • Behavioral Change: DEFAULT_POLLING_INTERVAL_MS is no longer exported from build-workflow-executor; consumers must import it from ./defaults.

Macroscope summarized 729eacb.

fixes PRD-394

Move all CLI-visible defaults to src/defaults.ts. cli-core.ts now imports
constants instead of hardcoding values in readEnvConfig, printHelp, and
logStartup. logStartup also resolves defaults so logged values match
actual runtime behavior.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@linear
Copy link
Copy Markdown

linear Bot commented May 26, 2026

PRD-394

@qltysh
Copy link
Copy Markdown

qltysh Bot commented May 26, 2026

Qlty


Coverage Impact

This PR will not change total coverage.

Modified Files with Diff Coverage (4)

RatingFile% DiffUncovered Line #s
Coverage rating: A Coverage rating: A
packages/workflow-executor/src/runner.ts100.0%
Coverage rating: A Coverage rating: A
packages/workflow-executor/src/build-workflow-executor.ts100.0%
Coverage rating: A Coverage rating: A
packages/workflow-executor/src/cli-core.ts100.0%
New Coverage rating: A
packages/workflow-executor/src/defaults.ts100.0%
Total100.0%
🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@nbouliol nbouliol merged commit 44363ac into feat/prd-214-server-step-mapper May 26, 2026
30 checks passed
@nbouliol nbouliol deleted the feature/prd-394-cli-defaults-single-source branch May 26, 2026 14:22
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.

2 participants