Skip to content

Commit a173939

Browse files
committed
Merge main into fix/web-sidecar-supervision
2 parents db1e6fa + dceac12 commit a173939

512 files changed

Lines changed: 50526 additions & 10942 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/AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Before changing GitHub automation, read the current versions of:
1212
- `.github/workflows/report.atom.yml`
1313
- `.github/scripts/handoff.py`
1414
- `scripts/scopes.ts`
15+
- `specs/current/ci.md` when changing scope rules, confidence tiers, or guards
1516
- `e2e/tests/packaged-smoke-workflow.test.ts`
1617
- `scripts/approve-fork-pr-workflows.ts` and `e2e/tests/scripts/approve-fork-pr-workflows.test.ts` when touching fork PR approval behavior
1718

.github/actions/setup-workspace/action.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ inputs:
1414
description: JSON array of labels selected for this job's runs-on value
1515
required: false
1616
default: '[]'
17+
save-pnpm-cache:
18+
description: Save a missing pnpm cache after install; trusted main seed jobs only
19+
required: false
20+
default: 'false'
1721

1822
runs:
1923
using: composite
@@ -62,13 +66,21 @@ runs:
6266
shell: bash
6367
run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
6468

65-
- name: Cache pnpm store
69+
- name: Restore pnpm store
70+
id: pnpm-cache-restore
6671
if: ${{ steps.persistent-pnpm-store.outputs.enabled != 'true' }}
67-
uses: actions/cache@v5.0.5
72+
uses: actions/cache/restore@v5
6873
with:
6974
path: ${{ steps.pnpm-store.outputs.path }}
7075
key: pnpm-store-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
7176

7277
- name: Install dependencies
7378
shell: bash
7479
run: pnpm install --frozen-lockfile
80+
81+
- name: Save pnpm store
82+
if: ${{ inputs.save-pnpm-cache == 'true' && steps.persistent-pnpm-store.outputs.enabled != 'true' && steps.pnpm-cache-restore.outputs.cache-hit != 'true' && github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule') }}
83+
uses: actions/cache/save@v5
84+
with:
85+
path: ${{ steps.pnpm-store.outputs.path }}
86+
key: pnpm-store-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Fixes #
3131

3232
- [ ] **UI** — new page / dialog / panel / menu item / setting / empty state in `apps/web` or `apps/desktop` (including Electron menu bar)
3333
- [ ] **Keyboard shortcut** — new or changed
34-
- [ ] **CLI / env var** — new `od` subcommand or flag, new `tools-dev` / `tools-pack` / `tools-pr` flag, or new `OD_*` env var
34+
- [ ] **CLI / env var** — new `od` subcommand or flag, new `tools-dev` / `tools-pack` flag, or new `OD_*` env var
3535
- [ ] **API / contract** — new `/api/*` endpoint, new SSE event, or changed shape in `packages/contracts`
3636
- [ ] **Extension point** — new entry under `skills/`, `design-systems/`, `design-templates/`, or `craft/`, or change to the skills protocol
3737
- [ ] **i18n keys** — added new translation keys (see `TRANSLATIONS.md` for the locale workflow)
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: cache-maintenance
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- pnpm-lock.yaml
8+
- .github/actions/setup-workspace/action.yml
9+
- .github/workflows/cache-maintenance.yml
10+
pull_request_target:
11+
types: [closed]
12+
workflow_dispatch:
13+
14+
permissions:
15+
actions: write
16+
contents: read
17+
18+
jobs:
19+
seed-pnpm-windows:
20+
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
21+
runs-on: windows-latest
22+
timeout-minutes: 15
23+
steps:
24+
- name: Checkout main
25+
uses: actions/checkout@v6.0.2
26+
27+
- name: Seed Windows pnpm cache
28+
uses: ./.github/actions/setup-workspace
29+
with:
30+
save-pnpm-cache: 'true'
31+
32+
clean-closed-pr-buildkit:
33+
if: github.event_name == 'pull_request_target' && github.repository == 'nexu-io/open-design'
34+
runs-on: ubuntu-24.04
35+
timeout-minutes: 5
36+
steps:
37+
- name: Delete closed PR BuildKit caches
38+
env:
39+
CACHE_REF: refs/pull/${{ github.event.pull_request.number }}/merge
40+
GH_TOKEN: ${{ github.token }}
41+
run: |
42+
set -euo pipefail
43+
44+
cache_rows="$(
45+
gh cache list \
46+
--repo "$GITHUB_REPOSITORY" \
47+
--ref "$CACHE_REF" \
48+
--limit 10000 \
49+
--json id,key,sizeInBytes \
50+
--jq '.[] | select((.key | startswith("buildkit-blob-")) or (.key | startswith("index-buildkit-"))) | [.id, .key, .sizeInBytes] | @tsv'
51+
)"
52+
53+
if [ -z "$cache_rows" ]; then
54+
echo "No closed-PR BuildKit caches found for $CACHE_REF"
55+
exit 0
56+
fi
57+
58+
count=0
59+
bytes=0
60+
while IFS=$'\t' read -r cache_id cache_key cache_size; do
61+
[ -n "$cache_id" ] || continue
62+
echo "Deleting cache id=$cache_id key=$cache_key bytes=$cache_size ref=$CACHE_REF"
63+
gh cache delete "$cache_id" --repo "$GITHUB_REPOSITORY"
64+
count=$((count + 1))
65+
bytes=$((bytes + cache_size))
66+
done <<< "$cache_rows"
67+
68+
echo "Deleted $count closed-PR BuildKit caches ($bytes bytes) for $CACHE_REF"

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363
run_playwright_critical: ${{ steps.detect.outputs.run_playwright_critical }}
6464
run_playwright_visual: ${{ steps.detect.outputs.run_playwright_visual }}
6565
run_preflight: ${{ steps.detect.outputs.run_preflight }}
66+
run_preflight_typecheck: ${{ steps.detect.outputs.run_preflight_typecheck }}
6667
run_ui_p0: ${{ steps.detect.outputs.run_ui_p0 }}
6768
run_web_workspace_tests: ${{ steps.detect.outputs.run_web_workspace_tests }}
6869
run_windows_tools_pack_payload_tests: ${{ steps.detect.outputs.run_windows_tools_pack_payload_tests }}
@@ -255,12 +256,14 @@ jobs:
255256
# If postinstall grows a targeted app type-generation phase covering these
256257
# three exports without broad app builds, this CI prebuild can be removed.
257258
- name: Prebuild workspace type declarations
259+
if: ${{ needs.scopes.outputs.run_preflight_typecheck == 'true' }}
258260
run: |
259261
pnpm --filter @open-design/daemon build
260262
pnpm --filter @open-design/desktop build
261263
pnpm --filter @open-design/web build:sidecar
262264
263265
- name: Typecheck workspaces
266+
if: ${{ needs.scopes.outputs.run_preflight_typecheck == 'true' }}
264267
run: |
265268
pnpm -r --filter '!open-design' --filter '!@open-design/landing-page' --workspace-concurrency="${OPEN_DESIGN_WORKSPACE_CONCURRENCY:-1}" --if-present run typecheck
266269
pnpm exec tsc -p scripts/tsconfig.json --noEmit
@@ -301,7 +304,13 @@ jobs:
301304
pnpm --filter @open-design/tools-dev test
302305
fi
303306
if [ "${{ needs.scopes.outputs.tools_pack_tests_required }}" = "true" ]; then
307+
pnpm --filter @open-design/desktop build
308+
pnpm --filter @open-design/desktop test
309+
pnpm --filter @open-design/packaged test
304310
pnpm --filter @open-design/tools-pack test
311+
if [ "${{ needs.scopes.outputs.run_e2e_vitest }}" != "true" ]; then
312+
pnpm --filter @open-design/e2e test tests/packaged-launcher-update-loop.test.ts
313+
fi
305314
fi
306315
307316
- name: Probe watcher environment

.github/workflows/landing-page-ci.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ jobs:
8181
- name: Setup workspace
8282
uses: ./.github/actions/setup-workspace
8383

84-
- name: Cache generated previews
84+
- name: Restore generated previews
8585
id: previews-cache
86-
uses: actions/cache@v5.0.5
86+
uses: actions/cache/restore@v5
8787
with:
8888
path: apps/landing-page/public/previews
8989
key: landing-page-previews-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'package.json', 'apps/landing-page/package.json', 'apps/landing-page/scripts/generate-previews.ts', 'apps/landing-page/scripts/fallback-preview-card.ts', 'skills/**', 'design-templates/**', 'templates/live-artifacts/**', 'plugins/_official/**') }}
@@ -125,6 +125,13 @@ jobs:
125125
OD_LANDING_NOINDEX: '1'
126126
run: pnpm --filter @open-design/landing-page build:static
127127

128+
- name: Save generated previews
129+
if: ${{ steps.previews-cache.outputs.cache-hit != 'true' && github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
130+
uses: actions/cache/save@v5
131+
with:
132+
path: apps/landing-page/public/previews
133+
key: landing-page-previews-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'package.json', 'apps/landing-page/package.json', 'apps/landing-page/scripts/generate-previews.ts', 'apps/landing-page/scripts/fallback-preview-card.ts', 'skills/**', 'design-templates/**', 'templates/live-artifacts/**', 'plugins/_official/**') }}
134+
128135
- name: Lint changed blog SEO
129136
# The build above sets OD_LANDING_NOINDEX=1, so every rendered page in
130137
# `out/` carries `noindex`. Pass the same flag through so the SEO linter

.github/workflows/release-beta-s.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,8 @@ jobs:
754754
-BuildJsonPath "C:\.tmp\runner\od-beta\win_x64\build\build.json" `
755755
-IndexPath "C:\.tmp\runner\od-beta\win_x64\build\index.json" `
756756
-ReportRoot "C:\.tmp\runner\od-beta\win_x64\release-report\win_x64" `
757-
-OutputsPath "C:\.tmp\runner\od-beta\win_x64\build\outputs.json"
757+
-OutputsPath "C:\.tmp\runner\od-beta\win_x64\build\outputs.json" `
758+
-RequireVelaCli
758759
759760
- name: Write win_x64 release report
760761
if: ${{ always() }}

.github/workflows/release-beta.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ jobs:
580580
--app-version "$update_version" \
581581
--mac-compression normal \
582582
--to dmg \
583+
--require-vela-cli \
583584
--json)"
584585
printf '%s\n' "$update_output" > "$update_build_json_path"
585586
{
@@ -647,7 +648,7 @@ jobs:
647648
run: |
648649
set -euo pipefail
649650
prefix="${{ steps.mac_arm64_tools_pack_cache_key.outputs.prefix }}"
650-
keep=3
651+
keep=1
651652
cache_ids="$(gh cache list --key "$prefix" --sort created_at --order desc --limit 100 --json id,key,createdAt --jq ".[$keep:] | .[].id")"
652653
count=0
653654
while IFS= read -r cache_id; do
@@ -795,6 +796,7 @@ jobs:
795796
--mac-compression normal
796797
--to "${{ inputs.mac_x64_target }}"
797798
--json
799+
--require-vela-cli
798800
)
799801
case "${{ inputs.mac_x64_sign_mode }}" in
800802
no) ;;
@@ -828,6 +830,7 @@ jobs:
828830
--mac-compression normal
829831
--to "${{ inputs.mac_x64_target }}"
830832
--json
833+
--require-vela-cli
831834
)
832835
case "${{ inputs.mac_x64_sign_mode }}" in
833836
no) ;;
@@ -917,7 +920,7 @@ jobs:
917920
run: |
918921
set -euo pipefail
919922
prefix="${{ steps.mac_x64_tools_pack_cache_key.outputs.prefix }}"
920-
keep=3
923+
keep=1
921924
cache_ids="$(gh cache list --key "$prefix" --sort created_at --order desc --limit 100 --json id,key,createdAt --jq ".[$keep:] | .[].id")"
922925
count=0
923926
while IFS= read -r cache_id; do
@@ -1055,7 +1058,7 @@ jobs:
10551058
$ErrorActionPreference = "Stop"
10561059
New-Item -ItemType Directory -Force -Path "${{ runner.temp }}\release-build\win_x64" | Out-Null
10571060
pnpm.cmd exec tools-pack win cleanup --dir "${{ runner.temp }}\tools-pack" --namespace release-beta-win --json
1058-
$buildArgs = @("exec", "tools-pack", "win", "build", "--dir", "${{ runner.temp }}\tools-pack", "--cache-dir", "${{ runner.temp }}\tools-pack-cache", "--namespace", "release-beta-win", "--portable", "--app-version", "${{ needs.metadata.outputs.beta_version }}", "--to", "${{ inputs.win_x64_target }}", "--json")
1061+
$buildArgs = @("exec", "tools-pack", "win", "build", "--dir", "${{ runner.temp }}\tools-pack", "--cache-dir", "${{ runner.temp }}\tools-pack-cache", "--namespace", "release-beta-win", "--portable", "--app-version", "${{ needs.metadata.outputs.beta_version }}", "--to", "${{ inputs.win_x64_target }}", "--require-vela-cli", "--json")
10591062
if ("${{ inputs.win_x64_sign_mode }}" -eq "on") { $buildArgs += "--signed" }
10601063
$buildOutput = pnpm.cmd @buildArgs
10611064
if ($LASTEXITCODE -ne 0) { throw "tools-pack win build failed with exit code $LASTEXITCODE" }
@@ -1072,7 +1075,7 @@ jobs:
10721075
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "${{ runner.temp }}\tools-pack-cache"
10731076
New-Item -ItemType Directory -Force -Path "${{ runner.temp }}\release-build\win_x64" | Out-Null
10741077
pnpm.cmd exec tools-pack win cleanup --dir "${{ runner.temp }}\tools-pack" --namespace release-beta-win --json
1075-
$buildArgs = @("exec", "tools-pack", "win", "build", "--dir", "${{ runner.temp }}\tools-pack", "--cache-dir", "${{ runner.temp }}\tools-pack-cache", "--namespace", "release-beta-win", "--portable", "--app-version", "${{ needs.metadata.outputs.beta_version }}", "--to", "${{ inputs.win_x64_target }}", "--json")
1078+
$buildArgs = @("exec", "tools-pack", "win", "build", "--dir", "${{ runner.temp }}\tools-pack", "--cache-dir", "${{ runner.temp }}\tools-pack-cache", "--namespace", "release-beta-win", "--portable", "--app-version", "${{ needs.metadata.outputs.beta_version }}", "--to", "${{ inputs.win_x64_target }}", "--require-vela-cli", "--json")
10761079
if ("${{ inputs.win_x64_sign_mode }}" -eq "on") { $buildArgs += "--signed" }
10771080
$buildOutput = pnpm.cmd @buildArgs
10781081
if ($LASTEXITCODE -ne 0) { throw "tools-pack win fallback build failed with exit code $LASTEXITCODE" }
@@ -1100,7 +1103,7 @@ jobs:
11001103
$match = [regex]::Match("${{ needs.metadata.outputs.beta_version }}", "^(?<base>\d+\.\d+\.\d+)-beta\.(?<number>\d+)$")
11011104
if (-not $match.Success) { throw "full Windows smoke requires a counted beta version; got ${{ needs.metadata.outputs.beta_version }}" }
11021105
$updateVersion = "{0}-beta.{1}" -f $match.Groups["base"].Value, ([int]$match.Groups["number"].Value + 1)
1103-
$buildArgs = @("exec", "tools-pack", "win", "build", "--dir", "${{ runner.temp }}\release-work\win_x64\tools-pack-update-fixture", "--cache-dir", "${{ runner.temp }}\tools-pack-cache", "--namespace", "release-beta-win", "--app-version", $updateVersion, "--to", "nsis", "--json")
1106+
$buildArgs = @("exec", "tools-pack", "win", "build", "--dir", "${{ runner.temp }}\release-work\win_x64\tools-pack-update-fixture", "--cache-dir", "${{ runner.temp }}\tools-pack-cache", "--namespace", "release-beta-win", "--app-version", $updateVersion, "--to", "nsis", "--require-vela-cli", "--json")
11041107
if ("${{ inputs.win_x64_sign_mode }}" -eq "on") { $buildArgs += "--signed" }
11051108
$updateOutput = pnpm.cmd @buildArgs
11061109
if ($LASTEXITCODE -ne 0) { throw "tools-pack win update fixture failed with exit code $LASTEXITCODE" }
@@ -1167,7 +1170,7 @@ jobs:
11671170
GH_TOKEN: ${{ github.token }}
11681171
run: |
11691172
$prefix = "${{ steps.win_tools_pack_cache_key.outputs.prefix }}"
1170-
$keep = 3
1173+
$keep = 1
11711174
$caches = @(gh cache list --key $prefix --sort created_at --order desc --limit 100 --json id,key,createdAt | ConvertFrom-Json)
11721175
$stale = @($caches | Select-Object -Skip $keep)
11731176
foreach ($cache in $stale) { gh cache delete $cache.id }

.github/workflows/release-prerelease.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ jobs:
538538
run: |
539539
set -euo pipefail
540540
prefix="${{ steps.mac_arm64_tools_pack_cache_key.outputs.prefix }}"
541-
keep=3
541+
keep=1
542542
cache_ids="$(gh cache list --key "$prefix" --sort created_at --order desc --limit 100 --json id,key,createdAt --jq ".[$keep:] | .[].id")"
543543
count=0
544544
while IFS= read -r cache_id; do
@@ -805,7 +805,7 @@ jobs:
805805
run: |
806806
set -euo pipefail
807807
prefix="${{ steps.mac_x64_tools_pack_cache_key.outputs.prefix }}"
808-
keep=3
808+
keep=1
809809
cache_ids="$(gh cache list --key "$prefix" --sort created_at --order desc --limit 100 --json id,key,createdAt --jq ".[$keep:] | .[].id")"
810810
count=0
811811
while IFS= read -r cache_id; do
@@ -1051,7 +1051,7 @@ jobs:
10511051
GH_TOKEN: ${{ github.token }}
10521052
run: |
10531053
$prefix = "${{ steps.win_tools_pack_cache_key.outputs.prefix }}"
1054-
$keep = 3
1054+
$keep = 1
10551055
$caches = @(gh cache list --key $prefix --sort created_at --order desc --limit 100 --json id,key,createdAt | ConvertFrom-Json)
10561056
$stale = @($caches | Select-Object -Skip $keep)
10571057
foreach ($cache in $stale) {

.github/workflows/release-preview.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ jobs:
530530
run: |
531531
set -euo pipefail
532532
prefix="${{ steps.mac_arm64_tools_pack_cache_key.outputs.prefix }}"
533-
keep=3
533+
keep=1
534534
cache_ids="$(gh cache list --key "$prefix" --sort created_at --order desc --limit 100 --json id,key,createdAt --jq ".[$keep:] | .[].id")"
535535
count=0
536536
while IFS= read -r cache_id; do
@@ -771,7 +771,7 @@ jobs:
771771
run: |
772772
set -euo pipefail
773773
prefix="${{ steps.mac_x64_tools_pack_cache_key.outputs.prefix }}"
774-
keep=3
774+
keep=1
775775
cache_ids="$(gh cache list --key "$prefix" --sort created_at --order desc --limit 100 --json id,key,createdAt --jq ".[$keep:] | .[].id")"
776776
count=0
777777
while IFS= read -r cache_id; do
@@ -1033,7 +1033,7 @@ jobs:
10331033
GH_TOKEN: ${{ github.token }}
10341034
run: |
10351035
$prefix = "${{ steps.win_tools_pack_cache_key.outputs.prefix }}"
1036-
$keep = 3
1036+
$keep = 1
10371037
$caches = @(gh cache list --key $prefix --sort created_at --order desc --limit 100 --json id,key,createdAt | ConvertFrom-Json)
10381038
$stale = @($caches | Select-Object -Skip $keep)
10391039
foreach ($cache in $stale) {

0 commit comments

Comments
 (0)