Skip to content

Commit d931119

Browse files
committed
ci: scope the packaged Windows gate to its own inputs
This lane packages, installs and updates Maka on Windows. It takes about 25 minutes on a runner class that is scarce on shared infrastructure, and it was being allocated for two reasons that its own steps cannot justify. `apps/desktop/src/main/runtime-host-boot.ts` was in the path filter because the packaged updater is driven through `MAKA_UPDATE_TEST_FEED`, which that file hands to the update service. The wiring is a handful of lines; the module is 1900 of them, and over the last 200 commits on main it was the sole reason this lane ran 13 times. It is now asserted by `scripts/update-test-feed-wiring.test.mjs`, which runs on every change in the required job before any toolchain is installed and costs milliseconds. The filter matches 41 of those 200 commits, down from 55. The pinned-baseline steps qualify a transition out of an already-released installer, so a pull request's diff is not their input and cannot change their outcome. Downloading that baseline is also this lane's most common failure: 14 of 36 failures across the last 300 runs, every one of them on a branch that could not have caused it, each costing another 25-minute Windows allocation. Those three steps move to a nightly schedule, which is still far ahead of release day, the moment they exist to precede. Packaging, release verification and the end-to-end autoupdate check still run on every matching pull request. Generated-by: Claude Code
1 parent 0c52f7f commit d931119

3 files changed

Lines changed: 84 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ jobs:
102102
- name: Test script entrypoint contracts
103103
run: node --test scripts/script-entrypoints.test.mjs
104104

105+
# The packaged Windows lane drives the updater through this wiring. It
106+
# is a few lines, so it is asserted here on every change rather than by
107+
# naming its module in that lane's 25-minute path filter.
108+
- name: Test the packaged update feed wiring
109+
run: node --test --test-concurrency=1 scripts/update-test-feed-wiring.test.mjs
110+
105111
# Install-free like its neighbours: the gate reads one source file and
106112
# compares it to a hand-edited inventory, so a hook that silently widens
107113
# its scope to the whole tree fails here rather than in a profile (#4109).

.github/workflows/release-windows-check.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ on:
4646
- 'scripts/package-windows-autoupdate-next.mjs'
4747
# The Abort-path rollback hook ships inside the installer itself.
4848
- 'apps/desktop/build/installer.nsh'
49-
# The packaged updater's feed behavior — and the boot wiring that hands
50-
# MAKA_UPDATE_TEST_FEED to it — is only observable on this path.
49+
# The packaged updater's feed behavior is only observable on this path.
50+
# The boot wiring that hands MAKA_UPDATE_TEST_FEED to it is not here:
51+
# that is a few lines, `scripts/update-test-feed-wiring.test.mjs` asserts
52+
# them on every change for free, and naming the file made a 1900-line
53+
# module the single largest source of runs on this 25-minute lane.
5154
- 'apps/desktop/src/main/app-update-service.ts'
5255
- 'apps/desktop/src/main/main-window.ts'
53-
- 'apps/desktop/src/main/runtime-host-boot.ts'
5456
- 'packages/runtime-host/src/client/connect-or-spawn.ts'
5557
- 'packages/runtime-host/src/client/launcher.ts'
5658
- 'apps/desktop/src/main/windows-maximize-renderer-sync.ts'
@@ -94,6 +96,11 @@ on:
9496
- 'apps/desktop/resources/licenses/cargo/THIRD_PARTY_NOTICES.txt'
9597
- '.github/workflows/release.yml'
9698
- '.github/workflows/release-windows-check.yml'
99+
# The installer upgrade and rollback steps below qualify a transition from a
100+
# pinned historical release, so their input is that release rather than the
101+
# diff. They run here instead, which is still far ahead of release day.
102+
schedule:
103+
- cron: '17 5 * * *'
97104
workflow_dispatch:
98105

99106
permissions:
@@ -135,8 +142,13 @@ jobs:
135142
version="$(node -p "require('./apps/desktop/package.json').version")"
136143
npm run verify:windows-x64 -- "apps/desktop/release/Maka-${version}-win-x64.exe"
137144
145+
# Qualifies a transition out of a pinned historical release, so a pull
146+
# request cannot change the outcome. Downloading that release is also
147+
# this lane's most frequent failure, on branches that cannot have caused
148+
# it, and each false red costs another 25-minute Windows runner.
138149
- name: Download and verify the pinned Windows upgrade baseline
139150
id: previous
151+
if: github.event_name != 'pull_request'
140152
env:
141153
GH_TOKEN: ${{ github.token }}
142154
run: |
@@ -146,6 +158,7 @@ jobs:
146158
echo "exe=$previous_exe" >> "$GITHUB_OUTPUT"
147159
148160
- name: Exercise pinned-version upgrade and uninstall
161+
if: github.event_name != 'pull_request'
149162
run: |
150163
version="$(node -p "require('./apps/desktop/package.json').version")"
151164
npm run verify:windows-installer -- \
@@ -163,6 +176,7 @@ jobs:
163176
apps/desktop/release-autoupdate-next
164177
165178
- name: Prove deterministic mid-install failure rollback
179+
if: github.event_name != 'pull_request'
166180
run: |
167181
version="$(node -p "require('./apps/desktop/package.json').version")"
168182
npm run verify:windows-installer-rollback -- \
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
/**
21+
* `verify-windows-autoupdate.mjs` drives the packaged updater by handing it
22+
* `MAKA_UPDATE_TEST_FEED`, and the boot path is what carries that value to the
23+
* update service. Break the wiring and the packaged run stops reaching the
24+
* harness feed, so the verifier proves nothing while still passing.
25+
*
26+
* The wiring is a handful of lines. Asserting them costs milliseconds on every
27+
* change, which is why naming their 1900-line module in the packaged Windows
28+
* lane's path filter — a 25-minute Windows job — was the wrong instrument.
29+
*/
30+
import assert from 'node:assert/strict';
31+
import { readFileSync } from 'node:fs';
32+
import test from 'node:test';
33+
34+
const FEED = 'MAKA_UPDATE_TEST_FEED';
35+
36+
function read(path) {
37+
return readFileSync(new URL(`../${path}`, import.meta.url), 'utf8');
38+
}
39+
40+
test('the packaged boot path hands the harness feed to the update service', () => {
41+
const boot = read('apps/desktop/src/main/runtime-host-boot.ts');
42+
43+
assert.match(boot, /const updateTestFeed = process\.env\.MAKA_UPDATE_TEST_FEED;/u);
44+
assert.match(boot, /createAppUpdateService\(\{[\s\S]*?testFeedUrl: updateTestFeed,/u);
45+
});
46+
47+
test('the harness feed still redirects packaged user data away from the real root', () => {
48+
// Without this the update test would write into the developer's own profile.
49+
const main = read('apps/desktop/src/main/main.ts');
50+
51+
assert.match(
52+
main,
53+
/resolveUpdateTestUserDataDirectory\(\{\n\s+feedUrl: process\.env\.MAKA_UPDATE_TEST_FEED,/u,
54+
);
55+
});
56+
57+
test('the Windows autoupdate verifier is what supplies the feed', () => {
58+
const verifier = read('scripts/verify-windows-autoupdate.mjs');
59+
60+
assert.match(verifier, new RegExp(`${FEED}: feed\\.url`, 'u'));
61+
});

0 commit comments

Comments
 (0)