Skip to content

Commit 9227bdf

Browse files
wesbillmanCarl
andauthored
fix(ci): ratchet file sizes against the base tree (#3352)
## Summary - replace the whole-tree file-size gate with a stateless differential ratchet - allow inherited files over 1,000 lines to hold or shrink, but never grow - delete the 44-entry numeric override ledger and run the same policy across Desktop, Web, and Mobile CI - fail closed when the local base cannot be resolved and cover policy, Git status parsing, and base resolution in unit tests This removes the shared mutable policy state that caused unrelated PRs to fail after neighboring merges. It does **not** by itself prevent two stale green PRs from becoming invalid when combined; that requires merge queue or up-to-date branch enforcement. ### Related issue None found. This follows the design discussion in the linked Buzz channel. ### Testing - `node --test scripts/check-file-sizes-core.test.mjs` (6/6) - Desktop, Web, and Mobile ratchet entrypoints - `just desktop-check` - `just web-check` - Mobile analysis - `git diff --check` The repository pre-push suite also exposed an unrelated existing Mobile widget failure in `ChannelDetailPage keeps follow mode off while a tall newest message stays visible`; it reproduces in isolation and this branch does not touch Mobile widget behavior. Signed-off-by: Wes <[email protected]> Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz>
1 parent 826bed4 commit 9227bdf

6 files changed

Lines changed: 267 additions & 762 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,21 @@ jobs:
4848
- 'scripts/run-tests.sh'
4949
- 'justfile'
5050
desktop:
51+
- 'scripts/check-file-sizes-core.mjs'
52+
- 'scripts/check-file-sizes-core.test.mjs'
5153
- 'desktop/**'
5254
- '!desktop/src-tauri/**'
5355
- 'pnpm-lock.yaml'
5456
desktop-rust:
5557
- 'desktop/src-tauri/**'
5658
web:
59+
- 'scripts/check-file-sizes-core.mjs'
60+
- 'scripts/check-file-sizes-core.test.mjs'
5761
- 'web/**'
5862
- 'pnpm-lock.yaml'
5963
mobile:
64+
- 'scripts/check-file-sizes-core.mjs'
65+
- 'scripts/check-file-sizes-core.test.mjs'
6066
- 'mobile/**'
6167
- 'scripts/mobile-release.sh'
6268
- 'scripts/mobile-worktree-overrides.sh'
@@ -76,6 +82,8 @@ jobs:
7682
scripts/test-mobile-release-candidate-publisher.sh
7783
- name: Mobile worktree identity contract
7884
run: scripts/test-mobile-worktree-overrides.sh
85+
- name: File size ratchet unit tests
86+
run: node --test scripts/check-file-sizes-core.test.mjs
7987

8088
rust-lint:
8189
name: Rust Lint
@@ -130,6 +138,8 @@ jobs:
130138
contents: read
131139
steps:
132140
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
141+
with:
142+
fetch-depth: 2
133143
- uses: cashapp/activate-hermit@cea9af7913204a965fd488637a8d1811bba2e616 # v1
134144
- uses: rui314/setup-mold@9c9c13bf4c3f1adef0cc596abc155580bcb04444 # v1
135145
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
@@ -751,6 +761,8 @@ jobs:
751761
contents: read
752762
steps:
753763
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
764+
with:
765+
fetch-depth: 2
754766
- uses: cashapp/activate-hermit@cea9af7913204a965fd488637a8d1811bba2e616 # v1
755767
- name: Get pnpm store directory
756768
id: pnpm-cache
@@ -784,6 +796,8 @@ jobs:
784796
contents: read
785797
steps:
786798
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
799+
with:
800+
fetch-depth: 2
787801
- uses: cashapp/activate-hermit@cea9af7913204a965fd488637a8d1811bba2e616 # v1
788802
- name: Compute Hermit cache key
789803
id: hermit-bin-hash
@@ -822,6 +836,8 @@ jobs:
822836
with:
823837
path: ~/.pub-cache
824838
key: pub-${{ runner.os }}-${{ hashFiles('mobile/pubspec.lock') }}
839+
- name: File size ratchet
840+
run: node mobile/scripts/check-file-sizes.mjs
825841
- name: Format check
826842
run: cd mobile && dart format --output=none --set-exit-if-changed .
827843
- name: Analyze

0 commit comments

Comments
 (0)