Skip to content

Commit 2e295f8

Browse files
committed
ci: cap ecosystem format parallelism to fix transient walk error
the formatter ecosystem check intermittently failed with a single project error — `ruff format --preview` emitting many pathless `No such file or directory (os error 2)` from the parallel file walk on one large project (a different one each run: ibis, then airflow). root cause is load: ruff-ecosystem defaults to 50 concurrent projects, each running a 12-thread `buff format` walk plus git clone/reset. on the fork's small `ubuntu-latest` runner this massively oversubscribes cpu and fs and the parallel walk transiently races; astral's 32-core depot runner absorbs it, so upstream stays green. the walker code itself is byte-identical to upstream. add a `--max-parallelism` flag to the vendored ruff-ecosystem cli (default unchanged at 50) and pass `--max-parallelism 2` for the two `format` runs. the read-only `check` runs never errored, so they keep the default. not reproducible locally on macos (linux/load-specific); validated the flag plumbing end-to-end. the 360-minute job budget absorbs the slower run.
1 parent d7e766a commit 2e295f8

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

  • .github/workflows
  • python/ruff-ecosystem/ruff_ecosystem

.github/workflows/ci.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,13 +709,21 @@ jobs:
709709
cat ecosystem-result-check-preview >> ecosystem-result
710710
echo "" >> ecosystem-result
711711
712+
# `--max-parallelism 2`: the default (50) oversubscribes the fork's small
713+
# `ubuntu-latest` runner — dozens of concurrent multi-threaded `buff format`
714+
# walks plus git clone/reset churn make the parallel file walk intermittently
715+
# surface a transient `No such file or directory` on one large project (a
716+
# different one each run), which the "Fail on ecosystem errors" step turns
717+
# into a hard failure. astral's 32-core depot runner absorbs the load; ours
718+
# needs the concurrency capped. (format only — the read-only check runs are
719+
# unaffected.)
712720
- name: Run `ruff format` stable ecosystem check
713721
if: ${{ needs.determine_changes.outputs.formatter == 'true' }}
714722
run: |
715723
# Set pipefail to avoid hiding errors with tee
716724
set -eo pipefail
717725
718-
ruff-ecosystem format ./target/debug/buff-baseline ./target/debug/buff --cache ./checkouts --output-format markdown | tee ecosystem-result-format-stable
726+
ruff-ecosystem format ./target/debug/buff-baseline ./target/debug/buff --cache ./checkouts --output-format markdown --max-parallelism 2 | tee ecosystem-result-format-stable
719727
720728
cat ecosystem-result-format-stable > "$GITHUB_STEP_SUMMARY"
721729
echo "### Formatter (stable)" >> ecosystem-result
@@ -728,7 +736,7 @@ jobs:
728736
# Set pipefail to avoid hiding errors with tee
729737
set -eo pipefail
730738
731-
ruff-ecosystem format ./target/debug/buff-baseline ./target/debug/buff --cache ./checkouts --output-format markdown --force-preview | tee ecosystem-result-format-preview
739+
ruff-ecosystem format ./target/debug/buff-baseline ./target/debug/buff --cache ./checkouts --output-format markdown --force-preview --max-parallelism 2 | tee ecosystem-result-format-preview
732740
733741
cat ecosystem-result-format-preview > "$GITHUB_STEP_SUMMARY"
734742
echo "### Formatter (preview)" >> ecosystem-result

python/ruff-ecosystem/ruff_ecosystem/cli.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def entrypoint():
9999
project_dir=Path(cache),
100100
raise_on_failure=args.pdb,
101101
format_comparison=format_comparison,
102+
max_parallelism=args.max_parallelism,
102103
)
103104
)
104105
# https://stackoverflow.com/a/58840987/3549270
@@ -151,6 +152,16 @@ def parse_args() -> argparse.Namespace:
151152
action="store_true",
152153
help="Force preview mode to be enabled for all projects",
153154
)
155+
parser.add_argument(
156+
"--max-parallelism",
157+
type=int,
158+
default=50,
159+
help=(
160+
"Maximum number of projects to clone/format concurrently. Lower this on "
161+
"small CI runners: high concurrency thrashes the filesystem and can make "
162+
"the parallel file walk race with concurrent git clone/reset operations."
163+
),
164+
)
154165
parser.add_argument(
155166
"--format-comparison",
156167
choices=[option.value for option in FormatComparison],

0 commit comments

Comments
 (0)