Repository navigation
ci: split lint jobs and cut motd into thirteen segments - #63
Merged
Merged
Conversation
Run ShellCheck as two jobs (production warning, tests error) so one group cannot hide the other, and re-cut motd into thirteen segments over the same three shards. With nine test shards per OS plus the two lint jobs the plan is exactly the twenty-job concurrency.
Owner
Author
|
CI run 总墙钟 83 s(上一批 main 92 s)。20 个前置作业全部在 +2/+3 s 启动,无排队。
Debian motd 13 段(
两个新切出来的段(旧段 2 的两半)为 34 s 与 44 s;旧段 3 的两半为 36 s 与 30 s。均未达 45 s,切分两半比值 1.29:1,未触发调整重推。仍 ≥ 45 s 的是未被本 PR 触碰的旧段 0/1(50/51 s,基线 46/48 s;每作业并发段数由 4 增到 5,单段略慢)。 PASS 多重集与基线一致:motd 648(Ubuntu)/ 653(Debian),cloudflare 312,push-worker 303(两个 OS 各自求和)。 两个必需检查 待观察:lint 拆作业只把 73 s 降到 69 s(预期约 60 s 未达到)。瓶颈是测试组里的 |
The ubuntu gate assertion only counted `= success` lines against the needs entries, so a swapped binding (LINT_TESTS_RESULT reading needs.lint.result) or a relaxed `&&` still passed while the gate could go green on a failed job. Require the exact literal env and assertion block with grep -Fxq: every variable must read its own needs entry and all three tests must be chained. Existing needs-set and line-count checks are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
main的 Shell tests 墙钟 92 s 的两个剩余长尾——ShellCheck 单作业 73 s、Debian motd-a 段 0–3 的 55/75 s——各切一刀:lint 拆成生产组与测试组两个作业,motd 由 11 段重切成 13 段(仍 3 个作业,5/4/4)。前置作业从 19 增到正好 20,用满 Free 的 20 并发,仍不排队。预期收益:ShellCheck 75 s → 约 60 s(取两组较慢者);Debian motd-a 由 ~75 s 降到 ~50–55 s;总墙钟目标 ~75 s 量级。
Scope
包含:
.github/workflows/shell-tests.yml:lint作业只跑生产组(--severity=warning,保留步骤名Run ShellCheck);新增lint-tests(nameShellCheck (tests),步骤Run ShellCheck tests)只跑tests/*.sh(--severity=error)。两个作业各自保留-n1 -P4逐文件四路并行、set -o pipefail与status语义,枚举失败同样 rc=1。聚合作业ubuntu改为needs: [lint, lint-tests, ubuntu-tests],三个 result 都必须 success。segments: 13,segment_set为0 1 2 3 4/5 6 7 8/9 10 11 12。tests/test-motd.sh:11 → 13 段,只在顶层语句边界切,测试逻辑与循环体不动。旧段 2 在pending_phase与pending_kind之间切成「信号 + pending_phase」和「pending_kind + journal/tamper/symlink-target/native_id」;旧段 3 在 SIGKILL 矩阵与后续子 shell 之间切开。其余守卫整体后移两位,最终0..12各一次。tests/run.sh:[test-motd.sh]=13;TEST_SEGMENTS词法上限到 13,单段下标上限到 12。tests/test-shards.sh:矩阵 token 词法、motd 13 段的子集/拒绝/非法 token 用例同步;保留双位数段按自身执行的用例(9 10 11 12)。tests/test-lint-coverage.sh:从「一个 step 内两组」改写为双 step 契约——两个 step 各自被完整提取、各自恰好一次-n1 -P4、severity 分别为 warning/error、互不选对方文件;每个 step 独立运行并跟随自身组的退出码与文件集合;枚举失败各自 rc=1 且不产生该组记录;新增门禁断言ubuntu的needs覆盖两个 lint 作业并要求每个依赖结果都被断言,同时锁住两个必需检查名。README.md:段数(13 段 5/4/4)、TEST_SEGMENTS/TEST_SEGMENT_SET语义、lint 拆作业后的实际语义与失败面订正。明确不做:不动 push / push-worker / cloudflare / other 的分段;不改两个必需检查名
Ubuntu 24.04 lint and tests、Debian 13 tests;不新增第三个必需检查。Validation
bash tests/test-shards.sh、bash tests/test-lint-coverage.sh均 rc=0(见下方 CI 与本地记录)。bash -n通过;测试组shellcheck -x --severity=error对改动文件无告警。TEST_SEGMENTS=13 TEST_SEGMENT_SET="2"/"3"各自独立跑完。Risks
Rollback
git revert本 PR 即可整体回退到 11 段 / 单 lint 作业(无数据迁移、无外部状态);回退后前置作业回到 19。