Skip to content

ci(bin): split full ShellCheck lint into three single-worker partitions - #25

Merged
twilwa merged 3 commits into
mainfrom
fm/fm-ci-lint1-sigterm
Sep 26, 2026
Merged

twilwa merged 3 commits into
mainfrom
fm/fm-ci-lint1-sigterm

Conversation

@twilwa

@twilwa twilwa commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Intent

Make the fork's CI Lint 1 job pass again on main and on pull requests, without weakening what it checks.

Since main moved to 47099cc (PR 8, Treehouse allocation binding), the Lint 1 job (bin/fm-lint.sh --partition 1of2 --telemetry ..., full ShellCheck extended analysis with --external-sources) ends with ##[error]Process completed with exit code 143 roughly 6-8 minutes in and prints no ShellCheck diagnostics.
The previous main run at f843953 passed Lint 1 in about 8 minutes, and Lint 2 still passes everywhere.
The failure reproduced on main run 36219124883, twice on PR 23 run 36221000876, and on PR 20 run 36221073628, so it blocks every fork PR merge.
The job timeout is 30 minutes, so 143 is not the job timeout; locally, tests/fm-lint.test.sh is known to be OOM-killed even on main, which makes memory pressure from a single ShellCheck process following sources across a large root set a leading hypothesis to test, not a conclusion.

Test-step limit: do not run bin/fm-lint.sh partitions, full lint, or any ShellCheck over the whole tree on this shared host; verify with bash -n, the partition inventory via --list-files, and targeted tests only; the PR CI Lint 1/2/3 jobs are the proof.

What Changed

  • bin/fm-lint.sh --partition now accepts 1of3, 2of3 and 3of3, and refuses the old 1of2/2of2 values. The greedy byte-weight assignment now spreads roots across three complete, disjoint partitions. Each partition still runs the full source-aware ShellCheck analysis with --external-sources.
  • Partition runs now default to one worker, so two large source-following ShellCheck processes can't run at the same time on a CI runner. Non-partition runs still default to two workers, and FM_LINT_JOBS/--jobs still override the default.
  • The CI lint matrix goes from [1, 2] to [1, 2, 3], and Lint 3 is added to the required job contexts in CONTRIBUTING.md. tests/fm-ci-workflow.test.sh now requires the three-partition matrix. tests/fm-lint.test.sh now checks all three partitions for coverage, unchanged analysis flags and default jobs 1 telemetry, and confirms 1of2, 0of3 and 4of3 are rejected. The header comment in bin/fm-lint.sh and docs/fm-test-portable-shards.md are updated to describe the new layout.

Risk Assessment

✅ Low: The change only reconfigures CI lint partitioning: every check is unchanged (full analysis, --external-sources, no excludes, workflow lint and backend purity in each partition), the greedy three-way split stays complete and disjoint, and only partitions default to one worker, so local and gate lint behave as before.

Testing

  • ⏭️ Test - skipped

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • ℹ️ bin/fm-lint.sh:461 - The fix assumes the exit code 143 comes from memory pressure. The intent calls that a hypothesis to test, not a conclusion. The change lowers the peak ShellCheck memory at any one time: before, two processes ran at once, each over about 1/4 of the roots (about 1/2 of the tree in memory). Now one process runs at a time over about 1/6 of the roots (two shards per partition, run one after the other). That is consistent with the hypothesis, but if the SIGTERM has another cause, Lint 1/2/3 could still end with 143. Telemetry is written only after all workers finish (bin/fm-lint.sh:895-915). The TERM trap exits before that, so a failing run uploads no telemetry and gives no memory evidence. This was already true before the change. The PR CI Lint 1/2/3 results are the stated proof, so no action is needed here.
⏭️ **Test** - skipped

Step was skipped.

✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Summary by Sourcery

Split full CI ShellCheck lint across three single-worker partitions to reduce peak resource usage without weakening coverage.

Bug Fixes:

  • Prevent CI full-rigor ShellCheck lint jobs from exceeding runner resource limits by replacing the two-way layout with three smaller partitions and sequential partition workers.

Enhancements:

  • Preserve complete, disjoint source-aware lint coverage while balancing the canonical inventory across three partitions.
  • Keep non-partition lint concurrency unchanged while allowing explicit job overrides.

CI:

  • Expand the lint workflow matrix and required status checks from two partitions to three.

Documentation:

  • Update lint partition documentation and usage guidance for the three-partition layout.

Tests:

  • Update workflow and lint tests to verify three-way coverage, unchanged analysis settings, sequential defaults, and invalid partition rejection.

@sourcery-ai sourcery-ai Bot 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.

Sorry @twilwa, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 19 hours and 10 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Reviewer's Guide

The PR changes full CI lint from two two-worker partitions to three deterministic, complete, disjoint partitions that default to one ShellCheck worker, reducing peak memory pressure while preserving source-aware analysis and adding workflow, documentation, and regression-test coverage for the new contract.

Flow diagram for deterministic CI lint partitioning

flowchart TD
    I[Canonical lint inventory] --> W[Compute root byte weights]
    W --> A[Largest-first greedy assignment]
    A --> S1[1of3]
    A --> S2[2of3]
    A --> S3[3of3]
    S1 --> C[Complete, disjoint CI coverage]
    S2 --> C
    S3 --> C
    C --> SC[Full source-aware ShellCheck\nwith external sources]
Loading

File-Level Changes

Change Details Files
Repartition full source-aware CI lint across three memory-bounded lanes.
  • Replace the two-entry workflow matrix with partitions 1, 2, and 3.
  • Update partition validation and required status-check documentation for Lint 3.
  • Use a deterministic largest-first three-way root assignment while preserving complete, disjoint coverage and unchanged ShellCheck checks.
.github/workflows/ci.yml
CONTRIBUTING.md
bin/fm-lint.sh
docs/fm-test-portable-shards.md
tests/fm-ci-workflow.test.sh
tests/fm-lint.test.sh
Make partition lint sequential by default to reduce peak memory usage without changing general lint behavior.
  • Select one worker by default only when --partition is used; retain two workers for non-partition runs.
  • Continue allowing FM_LINT_JOBS and --jobs overrides, with partition mode still enforcing full canonical analysis.
bin/fm-lint.sh
tests/fm-lint.test.sh
Expand regression coverage for the new partition contract and preserved analysis semantics.
  • Verify all three partitions are valid, exhaustive, and disjoint via --list-files.
  • Verify partition telemetry reports one worker and ShellCheck retains external sources, full analysis, and no exclusions.
  • Reject obsolete or out-of-range partition identifiers and weakened partition invocations.
tests/fm-ci-workflow.test.sh
tests/fm-lint.test.sh
Document the revised lint topology and its CI capacity tradeoff.
  • Describe three one-worker lint jobs and the memory rationale.
  • Update the long-lived Linux job count and latency considerations.
bin/fm-lint.sh
docs/fm-test-portable-shards.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-26T06:57:35.088485Z fe276ca PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@twilwa

twilwa commented Sep 26, 2026

Copy link
Copy Markdown
Owner Author

Final disposition for head fe276ca:

  • Validation: isolated no-mistakes run 01M3E7V0F9N6MH4N5ZKTR84SXE on claude-opus-5-5 reviewed e6c9dcb; fe276ca is that run's document-step commit changing one comment line in bin/fm-lint.sh. The run's CI auto-fix was aborted because it was editing an unrelated test.
  • CI: Lint 1, Lint 2 and Lint 3 pass. Behavior portable serial 3 failed once on an unrelated timing test (tests/fm-startup-network.test.sh, which passes on main) and passed on rerun. Every other check passes except 'PR must be raised via no-mistakes', which fails only because the local test step is skipped for fork-local changes and is waived under the standing fork policy.
  • Review feedback: a Sourcery rate-limit notice plus Sourcery and Codex summaries with no findings; nothing to address.
  • Merging under the repository's standing merge policy.

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