Skip to content

feat: add --ordered option to run command - #1989

Open
vjymisal0 wants to merge 1 commit into
ipfs:mainfrom
vjymisal0:feat/run-unordered
Open

feat: add --ordered option to run command#1989
vjymisal0 wants to merge 1 commit into
ipfs:mainfrom
vjymisal0:feat/run-unordered

Conversation

@vjymisal0

Copy link
Copy Markdown

Summary

Fixes #1500

Adds an ordered option to aegir run (default true, preserving current behaviour). When set to false, scripts are started for every project as soon as a concurrency slot is free, instead of waiting for a project's sibling dependencies to finish first.

This is useful for scripts like test where running in dependency order isn't required and only adds unnecessary latency, as noted in the issue.

Changes

  • src/types.ts: add ordered?: boolean to RunOptions
  • src/config/user.js: default run.ordered to true
  • src/cmds/run.js: add --ordered/--no-ordered CLI flag
  • src/run.js: forward ctx.ordered to everyMonorepoProject
  • src/utils.js: when opts.ordered === false, everyMonorepoProject skips the dependency in-degree bookkeeping and queues every project immediately (still bounded by concurrency)
  • test/run.js: add a test proving that with --no-ordered a downstream project (d) starts before its dependency (a) finishes, using the existing a-large-monorepo fixture

Test plan

  • Added an automated test in test/run.js (should execute commands without waiting for dependencies with --no-ordered) that fails against the old code (dependency order enforced) and passes with the fix.
  • aegir lint (eslint + tsc) passes locally on the changed files.
  • Verified manually with a standalone script exercising everyMonorepoProject directly against the a-large-monorepo fixture: with ordered: true project d only starts after a finishes; with ordered: false it starts immediately alongside a, b, and c.

Note: I could not run the full Mocha test/run.js suite end-to-end locally since it is skipped on Windows (os.platform() === 'win32') due to a pre-existing symlink-based fixture setup unrelated to this change; I validated the new logic directly against the same fixture instead, as described above.

Adds an `ordered` option to `aegir run` (default `true`, preserving
current behaviour). When set to `false`, scripts are started for every
project as soon as a concurrency slot is free, instead of waiting for
a project's sibling dependencies to finish first.

This is useful for scripts like `test` where running in dependency
order isn't required and only adds unnecessary latency.

Fixes ipfs#1500
Copilot AI lite review requested due to automatic review settings August 9, 2026 04:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

feat: unordered concurrency for test scripts

2 participants