Skip to content

Commit ca05273

Browse files
committed
chore(sync): merge upstream desktop-v0.5.17 into main
2 parents f8e7e0c + c3bfd66 commit ca05273

1,639 files changed

Lines changed: 225009 additions & 36734 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.

.env.example

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,10 @@ BUZZ_S3_ADDRESSING_STYLE=path
102102
# BUZZ_MEDIA_MAX_CONCURRENT_UPLOADS=8
103103
# BUZZ_MEDIA_MAX_CONCURRENT_UPLOADS_PER_PUBKEY=2
104104
# BUZZ_MEDIA_UPLOADS_PER_MINUTE=30
105-
# Require Blossom t=get auth and relay membership for GET/HEAD /media/*.
106-
# Keep off until desktop/mobile/CLI clients that attach media read auth are deployed.
107-
# BUZZ_REQUIRE_MEDIA_GET_AUTH=false
108-
# Legacy alias accepted by the relay while rollout docs catch up:
109-
# BUZZ_REQUIRE_MEDIA_READ_AUTH=false
105+
# GET/HEAD /media/* always require Blossom t=get auth and relay membership.
106+
# BUZZ_REQUIRE_MEDIA_GET_AUTH and BUZZ_REQUIRE_MEDIA_READ_AUTH are no longer
107+
# read; setting either (including to false) changes nothing and the relay warns
108+
# about it at startup.
110109

111110
# -----------------------------------------------------------------------------
112111
# Ephemeral Channels (TTL testing)

.github/workflows/auto-tag-on-release-pr-merge.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
echo "enabled=true"
9292
echo "tag=${TAG_PREFIX}${VERSION}"
9393
if [[ "$TAG_PREFIX" == desktop-v ]]; then
94-
echo "target_sha=${{ github.event.pull_request.merge_commit_sha }}"
94+
echo "target_sha=${{ github.event.pull_request.head.sha }}"
9595
echo "desktop=true"
9696
else
9797
echo "target_sha=$GITHUB_SHA"
@@ -112,6 +112,7 @@ jobs:
112112
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
113113
PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
114114
MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha }}
115+
MERGED_AT: ${{ github.event.pull_request.merged_at }}
115116
run: |
116117
VERSION="${VERSION#desktop-v}"
117118
export VERSION
@@ -146,7 +147,17 @@ jobs:
146147
exit 1
147148
fi
148149
fi
149-
gh api --method POST "repos/$GITHUB_REPOSITORY/git/refs" \
150+
if ! gh api --method POST "repos/$GITHUB_REPOSITORY/git/refs" \
150151
-f ref="refs/tags/$TAG" \
151152
-f sha="$TARGET_SHA" \
152-
--silent
153+
--silent; then
154+
# Ref creation is atomic. A concurrent retry may have won the race;
155+
# accept that only when it created the exact immutable ref.
156+
EXISTING_SHA="$(gh api "repos/$GITHUB_REPOSITORY/commits/$TAG" --jq .sha)"
157+
if [ "$EXISTING_SHA" = "$TARGET_SHA" ]; then
158+
echo "Tag $TAG was concurrently created at $TARGET_SHA"
159+
exit 0
160+
fi
161+
echo "::error::Tag creation failed and $TAG resolves to $EXISTING_SHA (expected $TARGET_SHA)"
162+
exit 1
163+
fi

.github/workflows/ci.yml

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ jobs:
3131
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
3232
with:
3333
fetch-depth: 2
34-
- uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
34+
- uses: cashapp/activate-hermit@cea9af7913204a965fd488637a8d1811bba2e616 # v1
35+
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
3536
id: filter
3637
with:
3738
token: ''
@@ -46,32 +47,32 @@ jobs:
4647
- 'deny.toml'
4748
- '.github/workflows/ci.yml'
4849
- 'scripts/run-tests.sh'
50+
- 'scripts/model-capabilities.json'
51+
- 'scripts/normative-corpus.json'
4952
- 'justfile'
5053
desktop:
5154
- 'scripts/check-file-sizes-core.mjs'
5255
- 'scripts/check-file-sizes-core.test.mjs'
56+
- 'scripts/model-capabilities.json'
57+
- 'scripts/normative-corpus.json'
5358
- 'desktop/!(src-tauri)/**'
5459
- 'pnpm-lock.yaml'
5560
desktop-rust:
5661
- 'desktop/src-tauri/**'
62+
- 'pnpm-lock.yaml'
5763
web:
58-
- 'scripts/check-file-sizes-core.mjs'
59-
- 'scripts/check-file-sizes-core.test.mjs'
6064
- 'web/**'
6165
- 'pnpm-lock.yaml'
6266
mobile:
63-
- 'scripts/check-file-sizes-core.mjs'
64-
- 'scripts/check-file-sizes-core.test.mjs'
6567
- 'mobile/**'
66-
- 'scripts/mobile-release.sh'
67-
- 'scripts/mobile-worktree-overrides.sh'
68-
- 'scripts/mobile-worktree-clean.sh'
69-
- 'scripts/publish-mobile-release-candidate.sh'
70-
- 'scripts/release-rulesets.sh'
71-
- 'scripts/test-mobile-release-contract.sh'
72-
- 'scripts/test-mobile-release-candidate-publisher.sh'
73-
- 'scripts/test-mobile-worktree-overrides.sh'
74-
- '.github/workflows/mobile-release-candidate.yml'
68+
relay:
69+
- 'crates/buzz-relay/**'
70+
- 'crates/buzz-core/**'
71+
- 'crates/buzz-db/**'
72+
- 'crates/buzz-backend-kubernetes/**'
73+
- 'Cargo.toml'
74+
- 'Cargo.lock'
75+
- 'deny.toml'
7576
- '.github/workflows/ci.yml'
7677
- name: Release workflow source contract
7778
run: scripts/test-release-ref-contract.sh
@@ -81,12 +82,18 @@ jobs:
8182
run: scripts/test-publish-sprig-rolling-release.sh
8283
- name: Desktop release candidate contract
8384
run: scripts/test-desktop-release-candidate.sh
85+
- name: OSS desktop promotion contract
86+
run: |
87+
scripts/test-oss-desktop-promotion.sh
88+
scripts/test-oss-desktop-promotion-behavior.sh
8489
- name: Mobile release contract
8590
run: |
8691
scripts/test-mobile-release-contract.sh
8792
scripts/test-mobile-release-candidate-publisher.sh
8893
- name: Mobile worktree identity contract
8994
run: scripts/test-mobile-worktree-overrides.sh
95+
- name: File size policy
96+
run: just file-size-check
9097
- name: File size ratchet unit tests
9198
run: node --test scripts/check-file-sizes-core.test.mjs
9299
- name: CI path filter contract
@@ -322,6 +329,9 @@ jobs:
322329
if: github.event_name == 'push' || needs.changes.outputs.desktop == 'true' || needs.changes.outputs.desktop-rust == 'true' || needs.changes.outputs.rust == 'true'
323330
permissions:
324331
contents: read
332+
env:
333+
SCCACHE_GHA_ENABLED: "true"
334+
SCCACHE_GHA_RW_MODE: ${{ (github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.number == 5224)) && 'READ_WRITE' || 'READ_ONLY' }}
325335
steps:
326336
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
327337
- uses: cashapp/activate-hermit@cea9af7913204a965fd488637a8d1811bba2e616 # v1
@@ -346,13 +356,22 @@ jobs:
346356
.
347357
desktop/src-tauri
348358
save-if: ${{ github.event_name != 'pull_request' }}
359+
# Cache rustc outputs for unchanged workspace crates. Trusted pushes write;
360+
# the bounded PR 5224 trial writes only to its isolated merge-ref scope.
361+
- name: Set up sccache
362+
if: steps.relay-artifacts-cache.outputs.cache-hit != 'true'
363+
uses: Mozilla-Actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11 # zizmor: ignore[cache-poisoning] Bounded trial: only PR 5224 writes to its isolated merge-ref scope; trusted pushes retain production writes.
364+
with:
365+
version: v0.16.0
349366
- name: Install cargo-nextest
350367
if: steps.relay-artifacts-cache.outputs.cache-hit != 'true'
351368
uses: taiki-e/install-action@0fd46367812ee04360509b4169d9f659d6892bb2 # v2.79.15
352369
with:
353370
tool: cargo-nextest@0.9.136
354371
- name: Build relay artifacts
355372
if: steps.relay-artifacts-cache.outputs.cache-hit != 'true'
373+
env:
374+
RUSTC_WRAPPER: sccache
356375
run: |
357376
cargo build --profile ci -p buzz-relay -p git-credential-nostr
358377
cargo nextest archive \
@@ -364,7 +383,9 @@ jobs:
364383
--test e2e_event_reminder \
365384
--archive-file target/ci/backend-integration-tests.tar.zst
366385
- name: Save relay artifacts cache
367-
if: steps.relay-artifacts-cache.outputs.cache-hit != 'true'
386+
# PR-scoped exact-source entries cannot warm main or other PRs and churn
387+
# the shared cache pool. sccache provides read-only PR reuse instead.
388+
if: steps.relay-artifacts-cache.outputs.cache-hit != 'true' && github.event_name == 'push'
368389
uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5
369390
with:
370391
path: |
@@ -773,6 +794,19 @@ jobs:
773794
env:
774795
RELAY_URL: ws://localhost:3000
775796
GIT_CREDENTIAL_NOSTR_BIN: ${{ github.workspace }}/target/ci/git-credential-nostr
797+
- name: Media read-auth e2e
798+
# Reads require kind:24242 `t=get` auth, so these binaries are the only
799+
# coverage that a real relay rejects bare reads and honours host- and
800+
# hash-scoped tokens. They were #[ignore]d and selected by no CI job, so
801+
# the lane never ran; select it here, where MinIO and the seeded
802+
# 'localhost:3000' community already exist.
803+
# --no-fail-fast: without it cargo stops after the first failing binary,
804+
# so one broken case hides every later binary's result.
805+
run: |
806+
cargo test -p buzz-test-client --no-fail-fast --test e2e_media --test e2e_media_extended --test e2e_media_video -- --ignored --nocapture
807+
env:
808+
RELAY_URL: ws://localhost:3000
809+
RELAY_HTTP_URL: http://localhost:3000
776810
- name: Upload relay logs
777811
if: failure()
778812
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
@@ -866,8 +900,6 @@ jobs:
866900
with:
867901
path: ~/.pub-cache
868902
key: pub-${{ runner.os }}-${{ hashFiles('mobile/pubspec.lock') }}
869-
- name: File size ratchet
870-
run: node mobile/scripts/check-file-sizes.mjs
871903
- name: Format check
872904
run: cd mobile && dart format --output=none --set-exit-if-changed .
873905
- name: Analyze
@@ -1028,7 +1060,7 @@ jobs:
10281060
git log -1 --format=%s | grep -qx smoke
10291061
echo "Host bash resolved and functional; git commit round-trip passed"
10301062
- name: Check (Tauri crate)
1031-
run: cargo check --manifest-path desktop/src-tauri/Cargo.toml --target $env:TARGET
1063+
run: cargo check --manifest-path desktop/src-tauri/Cargo.toml --workspace --all-targets --target $env:TARGET
10321064
env:
10331065
CMAKE_POLICY_VERSION_MINIMUM: "3.5"
10341066
- name: Test (Tauri crate)
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
name: Desktop release cache tag-scope proof
2+
3+
# Dispatch from a cache-proof-* tag at the same trusted-main SHA warmed by all
4+
# four canaries. Every job restores only and requires an exact cache hit.
5+
on:
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
macos:
13+
name: Prove macOS ${{ matrix.target }} cache visibility
14+
if: github.repository == 'block/buzz'
15+
runs-on: macos-latest
16+
timeout-minutes: 15
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
include:
21+
- target: aarch64-apple-darwin
22+
features: mesh-llm
23+
- target: x86_64-apple-darwin
24+
features: default
25+
steps:
26+
- name: Require cache proof tag
27+
run: '[[ "$GITHUB_REF" == refs/tags/cache-proof-* ]] || { echo "::error::Expected cache-proof-* tag; got $GITHUB_REF"; exit 1; }'
28+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
29+
with:
30+
persist-credentials: false
31+
- uses: cashapp/activate-hermit@cea9af7913204a965fd488637a8d1811bba2e616 # v1
32+
- name: Patch proof dependency graph
33+
run: |
34+
cd desktop && node scripts/set-version-from-tag.mjs "0.0.0-cache-proof"
35+
cd src-tauri && cargo update --workspace
36+
- name: Resolve native toolchain identity
37+
id: native_toolchain
38+
run: echo "id=$(scripts/desktop-native-toolchain-id.sh macos)" >> "$GITHUB_OUTPUT"
39+
- name: Compute exact release cache key
40+
id: rust_cache_key
41+
env:
42+
CACHE_TARGET: ${{ matrix.target }}
43+
CACHE_FEATURES: ${{ matrix.features }}
44+
NATIVE_TOOLCHAIN_ID: ${{ steps.native_toolchain.outputs.id }}
45+
run: |
46+
KEY=$(scripts/desktop-release-cache-key.py --platform "$RUNNER_OS" --target "$CACHE_TARGET" --features "$CACHE_FEATURES" --native-inputs "$NATIVE_TOOLCHAIN_ID")
47+
echo "key=$KEY" >> "$GITHUB_OUTPUT"
48+
- name: Restore exact default-branch cache from tag
49+
id: rust_cache
50+
uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5
51+
with:
52+
path: |
53+
~/.cargo/registry
54+
~/.cargo/git
55+
target
56+
desktop/src-tauri/target
57+
!desktop/src-tauri/target/**/release/bundle
58+
key: ${{ steps.rust_cache_key.outputs.key }}
59+
- name: Require exact cache hit
60+
env:
61+
CACHE_HIT: ${{ steps.rust_cache.outputs.cache-hit }}
62+
CACHE_KEY: ${{ steps.rust_cache.outputs.cache-primary-key }}
63+
EXPECTED_KEY: ${{ steps.rust_cache_key.outputs.key }}
64+
run: '[[ "$CACHE_HIT" == true && "$CACHE_KEY" == "$EXPECTED_KEY" ]] || { echo "::error::Exact tag cache miss (hit=$CACHE_HIT restored=$CACHE_KEY expected=$EXPECTED_KEY)"; exit 1; }'
65+
66+
linux:
67+
name: Prove Linux cache visibility
68+
if: github.repository == 'block/buzz'
69+
runs-on: ubuntu-latest
70+
container: ubuntu:24.04@sha256:4fbb8e6a8395de5a7550b33509421a2bafbc0aab6c06ba2cef9ebffbc7092d90
71+
timeout-minutes: 15
72+
defaults:
73+
run:
74+
shell: bash
75+
steps:
76+
- name: Require cache proof tag and install release native tools
77+
run: |
78+
[[ "$GITHUB_REF" == refs/tags/cache-proof-* ]] || { echo "::error::Expected cache-proof-* tag; got $GITHUB_REF"; exit 1; }
79+
apt-get update
80+
apt-get install -y --no-install-recommends build-essential ca-certificates curl git libasound2-dev libayatana-appindicator3-dev libgtk-3-dev librsvg2-dev libssl-dev libwebkit2gtk-4.1-dev libxdo-dev patchelf pkg-config
81+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
82+
with:
83+
persist-credentials: false
84+
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
85+
- uses: cashapp/activate-hermit@cea9af7913204a965fd488637a8d1811bba2e616 # v1
86+
- name: Patch proof dependency graph
87+
run: |
88+
cd desktop && node scripts/set-version-from-tag.mjs "0.0.0-cache-proof"
89+
cd src-tauri && cargo update --workspace
90+
- name: Resolve native toolchain identity
91+
id: native_toolchain
92+
run: echo "id=$(scripts/desktop-native-toolchain-id.sh linux)" >> "$GITHUB_OUTPUT"
93+
- name: Compute exact release cache key
94+
id: rust_cache_key
95+
env:
96+
NATIVE_TOOLCHAIN_ID: ${{ steps.native_toolchain.outputs.id }}
97+
run: |
98+
KEY=$(scripts/desktop-release-cache-key.py --platform "$RUNNER_OS" --target x86_64-unknown-linux-gnu --features mesh-llm --native-inputs "$NATIVE_TOOLCHAIN_ID")
99+
echo "key=$KEY" >> "$GITHUB_OUTPUT"
100+
- name: Restore exact default-branch cache from tag
101+
id: rust_cache
102+
uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5
103+
with:
104+
path: |
105+
~/.cargo/registry
106+
~/.cargo/git
107+
target
108+
desktop/src-tauri/target
109+
!desktop/src-tauri/target/**/release/bundle
110+
key: ${{ steps.rust_cache_key.outputs.key }}
111+
- name: Require exact cache hit
112+
env:
113+
CACHE_HIT: ${{ steps.rust_cache.outputs.cache-hit }}
114+
CACHE_KEY: ${{ steps.rust_cache.outputs.cache-primary-key }}
115+
EXPECTED_KEY: ${{ steps.rust_cache_key.outputs.key }}
116+
run: '[[ "$CACHE_HIT" == true && "$CACHE_KEY" == "$EXPECTED_KEY" ]] || { echo "::error::Exact tag cache miss (hit=$CACHE_HIT restored=$CACHE_KEY expected=$EXPECTED_KEY)"; exit 1; }'
117+
118+
windows:
119+
name: Prove Windows cache visibility
120+
if: github.repository == 'block/buzz'
121+
runs-on: windows-latest
122+
timeout-minutes: 15
123+
steps:
124+
- name: Require cache proof tag
125+
shell: bash
126+
run: '[[ "$GITHUB_REF" == refs/tags/cache-proof-* ]] || { echo "::error::Expected cache-proof-* tag; got $GITHUB_REF"; exit 1; }'
127+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
128+
with:
129+
persist-credentials: false
130+
- name: Patch proof dependency graph
131+
shell: bash
132+
run: |
133+
cd desktop && node scripts/set-version-from-tag.mjs "0.0.0-cache-proof"
134+
cd src-tauri && cargo update --workspace
135+
- name: Resolve native toolchain identity
136+
id: native_toolchain
137+
shell: bash
138+
run: echo "id=$(scripts/desktop-native-toolchain-id.sh windows)" >> "$GITHUB_OUTPUT"
139+
- name: Compute exact release cache key
140+
id: rust_cache_key
141+
shell: bash
142+
env:
143+
NATIVE_TOOLCHAIN_ID: ${{ steps.native_toolchain.outputs.id }}
144+
run: |
145+
KEY=$(scripts/desktop-release-cache-key.py --platform "$RUNNER_OS" --target x86_64-pc-windows-msvc --features default --native-inputs "$NATIVE_TOOLCHAIN_ID")
146+
echo "key=$KEY" >> "$GITHUB_OUTPUT"
147+
- name: Restore exact default-branch cache from tag
148+
id: rust_cache
149+
uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5
150+
with:
151+
path: |
152+
~/.cargo/registry
153+
~/.cargo/git
154+
target
155+
desktop/src-tauri/target
156+
!desktop/src-tauri/target/**/release/bundle
157+
key: ${{ steps.rust_cache_key.outputs.key }}
158+
- name: Require exact cache hit
159+
shell: bash
160+
env:
161+
CACHE_HIT: ${{ steps.rust_cache.outputs.cache-hit }}
162+
CACHE_KEY: ${{ steps.rust_cache.outputs.cache-primary-key }}
163+
EXPECTED_KEY: ${{ steps.rust_cache_key.outputs.key }}
164+
run: '[[ "$CACHE_HIT" == true && "$CACHE_KEY" == "$EXPECTED_KEY" ]] || { echo "::error::Exact tag cache miss (hit=$CACHE_HIT restored=$CACHE_KEY expected=$EXPECTED_KEY)"; exit 1; }'

.github/workflows/desktop-release-candidate.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
permissions:
88
contents: read
9+
pull-requests: read
910

1011
jobs:
1112
validate:
@@ -20,6 +21,7 @@ jobs:
2021
- name: Validate immutable desktop candidate
2122
if: startsWith(github.event.pull_request.head.ref, 'version-bump/')
2223
env:
24+
GH_TOKEN: ${{ github.token }}
2325
VERSION: ${{ github.event.pull_request.head.ref }}
2426
run: |
2527
VERSION="${VERSION#version-bump/}"

0 commit comments

Comments
 (0)