Skip to content

Commit 15067d3

Browse files
committed
Merge main previews and repair grouped message interactions
Signed-off-by: Arjun Mahanti <[email protected]>
2 parents 80b92db + 49ae64b commit 15067d3

285 files changed

Lines changed: 22363 additions & 5181 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 110 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ jobs:
139139
run: ./bin/node scripts/ci-test-report.mjs kind=playwright report=test-results/browser/ci-report.json evidence=test-results/browser/ci-timing.json title="Browser measurements" -- ./bin/pnpm test:browser:ci --project '*-measurements' --workers=1 --reporter=list,json
140140
# Cases tagged @classic-scrollbars need Chromium's platform scrollbars,
141141
# which Linux always draws as classic ones. One file cannot join the
142-
# six-way engine matrix (empty shards are errors), so it runs here, and
142+
# eight-way engine matrix (empty shards are errors), so it runs here, and
143143
# CI required already blocks on this job. The project writes to its own
144144
# outputDir so this run does not clear the measurement evidence above.
145145
- name: Chromium classic-scrollbar layout
@@ -193,7 +193,7 @@ jobs:
193193

194194
browser:
195195
if: github.event_name != 'workflow_dispatch'
196-
name: Browser journeys (${{ matrix.engine }}, ${{ matrix.shard }}/6)
196+
name: Browser journeys (${{ matrix.engine }}, ${{ matrix.shard }}/8)
197197
# Measurements stay isolated on their own runner, not on our critical path.
198198
# CI required still requires their success independently of these jobs.
199199
needs: [browser_fixture]
@@ -208,14 +208,14 @@ jobs:
208208
env:
209209
HOME: /root
210210
BUZZ_BROWSER_FIXTURE_DIR: target/ci-browser-fixture
211-
# Six file-level shards split the large file groups that remain together
212-
# with four or five shards, leaving room for setup inside the same deadline.
211+
# Eight file-level shards leave setup headroom for the growing journey suite.
212+
# Keep the same workers and deadline; every case still runs in both engines.
213213
timeout-minutes: 15
214214
strategy:
215215
fail-fast: false
216216
matrix:
217217
engine: [chromium, webkit]
218-
shard: [1, 2, 3, 4, 5, 6]
218+
shard: [1, 2, 3, 4, 5, 6, 7, 8]
219219
steps:
220220
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
221221
with:
@@ -243,7 +243,7 @@ jobs:
243243
- name: Functional journeys
244244
env:
245245
PLAYWRIGHT_JSON_OUTPUT_FILE: test-results/browser/ci-report.json
246-
run: ./bin/node scripts/ci-test-report.mjs kind=playwright report=test-results/browser/ci-report.json evidence=test-results/browser/ci-timing.json title="Browser journeys (${{ matrix.engine }}, ${{ matrix.shard }}/6)" -- ./bin/pnpm test:browser:ci --project ${{ matrix.engine }} --no-deps --shard=${{ matrix.shard }}/6 --reporter=list,json
246+
run: ./bin/node scripts/ci-test-report.mjs kind=playwright report=test-results/browser/ci-report.json evidence=test-results/browser/ci-timing.json title="Browser journeys (${{ matrix.engine }}, ${{ matrix.shard }}/8)" -- ./bin/pnpm test:browser:ci --project ${{ matrix.engine }} --no-deps --shard=${{ matrix.shard }}/8 --reporter=list,json
247247
- name: Browser evidence
248248
if: always()
249249
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
@@ -278,6 +278,110 @@ jobs:
278278
path: test-results/browser
279279
retention-days: 7
280280

281+
# Advisory flake check: repeat the tests a pull request changes. These lanes
282+
# skip when no test changed, so they stay out of CI required (which rejects
283+
# skipped lanes); their own statuses and step summaries carry the result.
284+
flake_select:
285+
if: github.event_name == 'pull_request'
286+
name: Flake check selection
287+
runs-on: ubuntu-24.04
288+
timeout-minutes: 5
289+
outputs:
290+
vitest: ${{ steps.select.outputs.vitest }}
291+
browser: ${{ steps.select.outputs.browser }}
292+
steps:
293+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
294+
with:
295+
persist-credentials: false
296+
# The merge commit's first parent is the base branch tip, so this
297+
# diff is exactly the pull request's change without a full clone.
298+
fetch-depth: 2
299+
- uses: ./.github/actions/setup
300+
- name: Map changed hunks to tests
301+
id: select
302+
run: ./bin/node scripts/flake-check.mjs select HEAD^1 HEAD
303+
304+
flake_vitest:
305+
name: Flake check (Vitest)
306+
needs: [flake_select]
307+
if: needs.flake_select.outputs.vitest != ''
308+
runs-on: ubuntu-24.04
309+
timeout-minutes: 20
310+
steps:
311+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
312+
with:
313+
persist-credentials: false
314+
- uses: ./.github/actions/setup
315+
- name: Repeat changed Vitest tests
316+
env:
317+
# Match the JavaScript lane's worker contention.
318+
BUZZ_TEST_WORKERS: "2"
319+
SELECTED: ${{ needs.flake_select.outputs.vitest }}
320+
run: ./bin/node scripts/flake-check.mjs vitest $SELECTED
321+
- name: Vitest iteration reports
322+
if: always()
323+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
324+
with:
325+
name: flake-vitest
326+
path: test-results/flake
327+
retention-days: 7
328+
329+
flake_browser:
330+
name: Flake check (${{ matrix.engine }})
331+
needs: [flake_select, browser_fixture]
332+
if: needs.flake_select.outputs.browser != ''
333+
runs-on: ubuntu-24.04
334+
# Match package.json's Playwright version and pin immutable browser/OS layers.
335+
container:
336+
image: mcr.microsoft.com/playwright:v1.63.0-noble@sha256:eff16c30e6f3f4af0a03fa4b706120d5e9b0891c344a27d64559aff5900a4a27
337+
options: --init --ipc=host
338+
defaults:
339+
run:
340+
shell: bash
341+
env:
342+
HOME: /root
343+
BUZZ_BROWSER_FIXTURE_DIR: target/ci-browser-fixture
344+
timeout-minutes: 30
345+
strategy:
346+
fail-fast: false
347+
matrix:
348+
engine: [chromium, webkit]
349+
steps:
350+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
351+
with:
352+
persist-credentials: false
353+
- name: Trust this container workspace
354+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
355+
- uses: ./.github/actions/setup
356+
with:
357+
browsers: "true"
358+
browser-engine: ${{ matrix.engine }}
359+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
360+
with:
361+
artifact-ids: ${{ needs.browser_fixture.outputs.artifact-id }}
362+
merge-multiple: true
363+
path: target/ci-browser-fixture
364+
- name: Verify native browser fixture
365+
run: |
366+
cd target/ci-browser-fixture
367+
tar -xf browser-fixture.tar
368+
test "$(cat revision)" = "$(git rev-parse HEAD)"
369+
sha256sum --check SHA256SUMS
370+
test -x fixture-bridge
371+
# retries stay 0, so every failed repetition reports as unexpected.
372+
- name: Repeat changed journeys
373+
env:
374+
PLAYWRIGHT_JSON_OUTPUT_FILE: test-results/browser/ci-report.json
375+
SELECTED: ${{ needs.flake_select.outputs.browser }}
376+
run: ./bin/node scripts/ci-test-report.mjs kind=playwright report=test-results/browser/ci-report.json evidence=test-results/browser/ci-timing.json title="Flake check (${{ matrix.engine }})" -- ./bin/pnpm test:browser:ci --project ${{ matrix.engine }} --no-deps --repeat-each=10 --reporter=list,json $SELECTED
377+
- name: Browser repetition evidence
378+
if: always()
379+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
380+
with:
381+
name: flake-browser-${{ matrix.engine }}
382+
path: test-results/browser
383+
retention-days: 7
384+
281385
required:
282386
name: ${{ github.event_name == 'workflow_dispatch' && 'Automatic CI (not requested)' || 'CI required' }}
283387
if: always() && github.event_name != 'workflow_dispatch'

‎.github/workflows/release.yml‎

Lines changed: 90 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
type: boolean
99
default: false
1010
promote_version:
11-
description: Promote a validated version (e.g. 0.0.0-preview.22.1) to the macOS preview updater feed; no build
11+
description: Promote a validated version (e.g. 0.0.0-preview.22.1) to the preview updater feed; no build
1212
type: string
1313
default: ""
1414
schedule:
@@ -17,6 +17,12 @@ on:
1717
permissions:
1818
contents: read
1919

20+
env:
21+
# Public verification inputs; the native build and plugins.updater must match.
22+
# Candidate-only runs build without the updater.
23+
BUZZ_UPDATER_PUBLIC_KEY: ${{ !inputs.candidates && 'dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDJDQjQ2RDZFMUEwOERFMTEKUldRUjNnZ2FibTIwTE10QkVaMzFyYkZlY0R4ajhmbFBjdncvNVRCYnNpSm9kaFNBaHQzemZlZHkK' || '' }}
24+
BUZZ_UPDATER_ENDPOINT: ${{ !inputs.candidates && 'https://github.com/block/buzz-app/releases/download/preview-feed/latest.json' || '' }}
25+
2026
concurrency:
2127
group: desktop-preview-${{ inputs.candidates && github.ref || 'macos-prerelease' }}
2228
cancel-in-progress: false
@@ -35,9 +41,6 @@ jobs:
3541
env:
3642
CI: "true"
3743
CARGO_TERM_COLOR: always
38-
# Public verification inputs; the native build and plugins.updater must match.
39-
BUZZ_UPDATER_PUBLIC_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDJDQjQ2RDZFMUEwOERFMTEKUldRUjNnZ2FibTIwTE10QkVaMzFyYkZlY0R4ajhmbFBjdncvNVRCYnNpSm9kaFNBaHQzemZlZHkK
40-
BUZZ_UPDATER_ENDPOINT: https://github.com/block/buzz-app/releases/download/preview-feed/latest.json
4144
steps:
4245
- name: Require main and signing configuration
4346
env:
@@ -153,7 +156,7 @@ jobs:
153156

154157
publish:
155158
name: Publish GitHub prerelease
156-
needs: [build, windows, linux]
159+
needs: [build, windows, linux, updater_signatures]
157160
runs-on: ubuntu-latest
158161
timeout-minutes: 5
159162
permissions:
@@ -171,6 +174,10 @@ jobs:
171174
with:
172175
name: linux-x64-candidates
173176
path: build-assets/linux
177+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
178+
with:
179+
name: windows-linux-updater-signatures
180+
path: build-assets/signatures
174181
- name: Verify and assemble release assets
175182
env:
176183
VERSION: ${{ needs.build.outputs.version }}
@@ -189,6 +196,9 @@ jobs:
189196
cp "build-assets/windows/Buzz_${VERSION}_x64_unsigned.exe" release-assets/
190197
cp "build-assets/linux/Buzz_${VERSION}_amd64.deb" release-assets/
191198
cp "build-assets/linux/Buzz_${VERSION}_x86_64.AppImage" release-assets/
199+
for installer in x64_unsigned.exe amd64.deb x86_64.AppImage; do
200+
cp "build-assets/signatures/Buzz_${VERSION}_${installer}.sig" release-assets/
201+
done
192202
printf '%s\n' "$SOURCE_SHA" > release-assets/SOURCE_COMMIT
193203
(cd release-assets && sha256sum ./Buzz_* > SHA256SUMS)
194204
- name: Publish desktop previews
@@ -201,10 +211,10 @@ jobs:
201211
gh release create "v$VERSION" release-assets/* \
202212
--target "$SOURCE_SHA" --prerelease --latest=false \
203213
--title "Buzz $VERSION (desktop preview)" \
204-
--notes "Desktop preview from commit $SOURCE_SHA, built by Actions run $GITHUB_RUN_ID. Includes Apple Silicon macOS (signed and notarized), Windows x64 (unsigned NSIS installer), and Linux x64 (Ubuntu 24.04 deb and AppImage). Windows/Linux require manual installation and desktop acceptance; only macOS uses the preview updater feed."
214+
--notes "Desktop preview from commit $SOURCE_SHA, built by Actions run $GITHUB_RUN_ID. Includes Apple Silicon macOS (signed and notarized), Windows x64 (unsigned NSIS installer), and Linux x64 (Ubuntu 24.04 deb and AppImage). Windows/Linux still require desktop acceptance. Updater-enabled installs update from the preview feed."
205215
206216
promote_preview:
207-
name: Promote verified macOS preview
217+
name: Promote verified preview
208218
needs: [build, publish]
209219
# Explicit promotions skip build/publish; automatic promotions require both to succeed.
210220
if: >-
@@ -228,27 +238,27 @@ jobs:
228238
set -euo pipefail
229239
# Validate the version before using it in release asset paths.
230240
[[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-preview\.[0-9]+\.[0-9]+$ ]] || exit 1
231-
export archive="Buzz_${VERSION}_aarch64.app.tar.gz"
241+
archive="Buzz_${VERSION}_aarch64.app.tar.gz"
232242
mkdir -p "$RUNNER_TEMP/candidate" "$RUNNER_TEMP/current" "$RUNNER_TEMP/served"
233-
gh release view "v$VERSION" --json assets,isPrerelease --jq \
234-
'.isPrerelease and (any(.assets[]; .name == env.archive and .size > 0)) and (any(.assets[]; .name == (env.archive + ".sig") and .size > 0))' | grep -qx true
235-
gh release download "v$VERSION" --pattern "$archive" --dir "$RUNNER_TEMP/candidate"
236-
gh release download "v$VERSION" --pattern "$archive.sig" --dir "$RUNNER_TEMP/candidate"
237-
test -s "$RUNNER_TEMP/candidate/$archive" && test -s "$RUNNER_TEMP/candidate/$archive.sig"
243+
gh release view "v$VERSION" --json isPrerelease --jq .isPrerelease | grep -qx true
244+
for asset in "$archive" "Buzz_${VERSION}_x64_unsigned.exe" "Buzz_${VERSION}_amd64.deb" "Buzz_${VERSION}_x86_64.AppImage"; do
245+
gh release download "v$VERSION" --pattern "$asset" --pattern "$asset.sig" --dir "$RUNNER_TEMP/candidate"
246+
[[ -s "$RUNNER_TEMP/candidate/$asset" && -s "$RUNNER_TEMP/candidate/$asset.sig" ]]
247+
done
238248
tar -xOzf "$RUNNER_TEMP/candidate/$archive" 'Buzz Foundation.app/Contents/MacOS/buzz-foundation' > "$RUNNER_TEMP/candidate/buzz-foundation"
239249
test -s "$RUNNER_TEMP/candidate/buzz-foundation"
240250
current=''
241251
if gh release view preview-feed >/dev/null 2>&1; then
242252
gh release download preview-feed --pattern latest.json --dir "$RUNNER_TEMP/current"
243253
current="$RUNNER_TEMP/current/latest.json"
244254
fi
245-
node scripts/preview-feed.mjs generate "$VERSION" "$RUNNER_TEMP/candidate/$archive.sig" "$RUNNER_TEMP/candidate/latest.json" "$RUNNER_TEMP/candidate/$archive" "$RUNNER_TEMP/candidate/buzz-foundation" ${current:+"$current"}
246-
node scripts/preview-feed.mjs verify "$VERSION" "$RUNNER_TEMP/candidate/$archive.sig" "$RUNNER_TEMP/candidate/latest.json" "$RUNNER_TEMP/candidate/$archive" "$RUNNER_TEMP/candidate/buzz-foundation" ${current:+"$current"}
255+
node scripts/preview-feed.mjs generate "$VERSION" "$RUNNER_TEMP/candidate" "$RUNNER_TEMP/candidate/latest.json" "$RUNNER_TEMP/candidate/buzz-foundation" ${current:+"$current"}
256+
node scripts/preview-feed.mjs verify "$VERSION" "$RUNNER_TEMP/candidate" "$RUNNER_TEMP/candidate/latest.json" "$RUNNER_TEMP/candidate/buzz-foundation" ${current:+"$current"}
247257
if [[ -z "$current" ]]; then
248258
gh release create preview-feed "$RUNNER_TEMP/candidate/latest.json" \
249259
--target "$GITHUB_SHA" --prerelease --latest=false \
250-
--title 'Buzz macOS preview updater feed' \
251-
--notes 'Rolling manifest for manually validated macOS previews. Not the stable channel.'
260+
--title 'Buzz preview updater feed' \
261+
--notes 'Rolling manifest for desktop previews. Not the stable channel.'
252262
elif cmp -s "$RUNNER_TEMP/candidate/latest.json" "$current"; then
253263
echo 'Preview feed already points to this candidate.'
254264
else
@@ -308,6 +318,8 @@ jobs:
308318
run: pnpm tauri build --ci --no-sign --bundles nsis --config "$RUNNER_TEMP/candidate.json" -- --locked
309319
- name: Install into disposable runner and verify app executable
310320
shell: pwsh
321+
env:
322+
CANDIDATES: ${{ inputs.candidates }}
311323
run: |
312324
$installers = @(Get-ChildItem target/release/bundle/nsis/*.exe)
313325
if ($installers.Count -ne 1) { throw 'Expected exactly one NSIS installer' }
@@ -316,6 +328,12 @@ jobs:
316328
$process = Start-Process $installers[0].FullName -ArgumentList "/S /D=$destination" -Wait -PassThru
317329
if ($process.ExitCode -ne 0) { throw "Installer failed: $($process.ExitCode)" }
318330
if (!(Test-Path "$destination\buzz-foundation.exe")) { throw 'App executable missing' }
331+
if ($env:CANDIDATES -ne 'true') {
332+
$binary = [Text.Encoding]::ASCII.GetString([IO.File]::ReadAllBytes("$destination\buzz-foundation.exe"))
333+
foreach ($value in @($env:BUZZ_UPDATER_PUBLIC_KEY, $env:BUZZ_UPDATER_ENDPOINT)) {
334+
if (!$value -or !$binary.Contains($value)) { throw 'App executable does not embed the updater configuration' }
335+
}
336+
}
319337
- name: Stage candidate and checksum
320338
run: |
321339
mkdir release-assets
@@ -374,6 +392,8 @@ jobs:
374392
- name: Build deb and AppImage
375393
run: pnpm tauri build --ci --no-sign --bundles deb,appimage --config "$RUNNER_TEMP/candidate.json" -- --locked
376394
- name: Repair AppImage and verify packaged app executables
395+
env:
396+
CANDIDATES: ${{ inputs.candidates }}
377397
run: |
378398
shopt -s nullglob
379399
debs=(target/release/bundle/deb/*.deb)
@@ -387,6 +407,17 @@ jobs:
387407
(cd "$RUNNER_TEMP/appimage" && "$image" --appimage-extract >/dev/null)
388408
test -x "$RUNNER_TEMP/appimage/squashfs-root/usr/bin/buzz-foundation"
389409
test -x "$RUNNER_TEMP/appimage/squashfs-root/usr/bin/buzz-foundation.bin"
410+
# The updater selects each install's feed entry by its embedded bundle type.
411+
binaries=("$RUNNER_TEMP/deb/usr/bin/buzz-foundation" "$RUNNER_TEMP/appimage/squashfs-root/usr/bin/buzz-foundation.bin")
412+
grep -aqF __TAURI_BUNDLE_TYPE_VAR_DEB "${binaries[0]}" || { echo '::error::deb app lacks its bundle type'; exit 1; }
413+
grep -aqF __TAURI_BUNDLE_TYPE_VAR_APP "${binaries[1]}" || { echo '::error::AppImage app lacks its bundle type'; exit 1; }
414+
if [[ "$CANDIDATES" != true ]]; then
415+
for binary in "${binaries[@]}"; do
416+
for value in "$BUZZ_UPDATER_PUBLIC_KEY" "$BUZZ_UPDATER_ENDPOINT"; do
417+
[[ -n "$value" ]] && grep -aqF "$value" "$binary" || { echo "::error::$binary does not embed the updater configuration"; exit 1; }
418+
done
419+
done
420+
fi
390421
mkdir release-assets
391422
cp "${debs[0]}" "release-assets/Buzz_${VERSION}_amd64.deb"
392423
cp "${images[0]}" "release-assets/Buzz_${VERSION}_x86_64.AppImage"
@@ -399,3 +430,45 @@ jobs:
399430
path: release-assets/
400431
if-no-files-found: error
401432
retention-days: 7
433+
434+
updater_signatures:
435+
# Installer jobs never receive the signing key; sign their verified bytes here.
436+
if: github.repository == 'block/buzz-app' && github.ref == 'refs/heads/main' && !inputs.candidates && !inputs.promote_version
437+
name: Sign Windows and Linux updater installers
438+
needs: [windows, linux]
439+
runs-on: ubuntu-latest
440+
timeout-minutes: 15
441+
steps:
442+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
443+
with:
444+
persist-credentials: false
445+
- uses: ./.github/actions/setup
446+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
447+
with:
448+
name: windows-x64-candidate
449+
path: build-assets/windows
450+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
451+
with:
452+
name: linux-x64-candidates
453+
path: build-assets/linux
454+
- name: Sign verified installers
455+
env:
456+
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
457+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
458+
run: |
459+
set -euo pipefail
460+
for platform in windows linux; do
461+
(cd "build-assets/$platform" && sha256sum --check SHA256SUMS)
462+
done
463+
mkdir signatures
464+
for installer in build-assets/windows/*.exe build-assets/linux/*.deb build-assets/linux/*.AppImage; do
465+
pnpm tauri signer sign "$installer"
466+
test -s "$installer.sig" || { echo '::error::Updater signing failed'; exit 1; }
467+
mv "$installer.sig" signatures/
468+
done
469+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
470+
with:
471+
name: windows-linux-updater-signatures
472+
path: signatures/
473+
if-no-files-found: error
474+
retention-days: 7

0 commit comments

Comments
 (0)