Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ jobs:

- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6
with:
bun-version: "1.3.13"
# Load-bearing for `bun audit` exit semantics; do not bump without re-verifying advisory exit codes.
bun-version: "1.3.14"

# Load-bearing: `bun install` runs `trustedDependencies`
# postinstalls from the root package.json (electron, node-pty,
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ jobs:

- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # oven-sh/setup-bun@v2
with:
bun-version: "1.3.13"
# Load-bearing for `bun audit` exit semantics; do not bump without re-verifying advisory exit codes.
bun-version: "1.3.14"

- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # actions/cache@v5
with:
Expand Down Expand Up @@ -169,7 +170,8 @@ jobs:

- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # oven-sh/setup-bun@v2
with:
bun-version: "1.3.13"
# Load-bearing for `bun audit` exit semantics; do not bump without re-verifying advisory exit codes.
bun-version: "1.3.14"

- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # actions/cache@v5
with:
Expand Down Expand Up @@ -256,7 +258,8 @@ jobs:

- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # oven-sh/setup-bun@v2
with:
bun-version: "1.3.13"
# Load-bearing for `bun audit` exit semantics; do not bump without re-verifying advisory exit codes.
bun-version: "1.3.14"

- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # actions/cache@v5
with:
Expand Down Expand Up @@ -300,7 +303,8 @@ jobs:

- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # oven-sh/setup-bun@v2
with:
bun-version: "1.3.13"
# Load-bearing for `bun audit` exit semantics; do not bump without re-verifying advisory exit codes.
bun-version: "1.3.14"

- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # actions/cache@v5
with:
Expand Down Expand Up @@ -371,7 +375,8 @@ jobs:

- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # oven-sh/setup-bun@v2
with:
bun-version: "1.3.13"
# Load-bearing for `bun audit` exit semantics; do not bump without re-verifying advisory exit codes.
bun-version: "1.3.14"

- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # actions/cache@v5
with:
Expand Down Expand Up @@ -442,7 +447,8 @@ jobs:

- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # oven-sh/setup-bun@v2
with:
bun-version: "1.3.13"
# Load-bearing for `bun audit` exit semantics; do not bump without re-verifying advisory exit codes.
bun-version: "1.3.14"

- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # actions/cache@v5
with:
Expand Down Expand Up @@ -513,7 +519,8 @@ jobs:

- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # oven-sh/setup-bun@v2
with:
bun-version: "1.3.13"
# Load-bearing for `bun audit` exit semantics; do not bump without re-verifying advisory exit codes.
bun-version: "1.3.14"

- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # actions/cache@v5
with:
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,16 @@ permissions:
pull-requests: read

jobs:
review:
dependency-review:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # actions/checkout@v6
with:
persist-credentials: false

# Advisory check: `warn-only: true` surfaces CVE/license findings
# in the Actions log but never fails the PR. Paired with `never`
# for comment-summary-in-pr so the action needs no write access
# and runs on fork PRs too (exactly where advisory coverage is
# most useful). Upgrading to fail-on-severity: high is a separate
# decision.
- uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # actions/dependency-review-action@v5.0.0
with:
comment-summary-in-pr: never
warn-only: true
fail-on-severity: high
fail-on-scopes: runtime,unknown
3 changes: 2 additions & 1 deletion .github/workflows/desktop-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ jobs:

- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # oven-sh/setup-bun@v2
with:
bun-version: "1.3.13"
# Load-bearing for `bun audit` exit semantics; do not bump without re-verifying advisory exit codes.
bun-version: "1.3.14"

- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # actions/cache@v5
with:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/dev-dep-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: dev-dep-audit

on:
pull_request:
branches: [dev]

concurrency:
group: dev-dep-audit-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
dev-dep-audit:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # actions/checkout@v6
with:
persist-credentials: false

- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # actions/setup-node@v6.4.0
with:
node-version: "24"

- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # oven-sh/setup-bun@v2
with:
# Load-bearing for `bun audit` exit semantics; do not bump without re-verifying advisory exit codes.
bun-version: "1.3.14"

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Run Bun audit
run: bun audit --audit-level=high
3 changes: 2 additions & 1 deletion .github/workflows/e2e-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ jobs:

- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # oven-sh/setup-bun@v2
with:
bun-version: "1.3.13"
# Load-bearing for `bun audit` exit semantics; do not bump without re-verifying advisory exit codes.
bun-version: "1.3.14"

- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # actions/cache@v5
with:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/officecli-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ jobs:

- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # oven-sh/setup-bun@v2
with:
bun-version: "1.3.13"
# Load-bearing for `bun audit` exit semantics; do not bump without re-verifying advisory exit codes.
bun-version: "1.3.14"

- name: Install dependencies
run: bun install --frozen-lockfile
Expand Down
14 changes: 2 additions & 12 deletions .github/workflows/perf-probe-baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ on:
permissions:
contents: read

env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/.playwright-browsers

jobs:
perf-probe-baseline:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -102,7 +99,8 @@ jobs:
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # oven-sh/setup-bun@v2
if: steps.compute-range.outputs.skipped != 'true'
with:
bun-version: "1.3.13"
# Load-bearing for `bun audit` exit semantics; do not bump without re-verifying advisory exit codes.
bun-version: "1.3.14"

- uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # actions/cache@v5
if: steps.compute-range.outputs.skipped != 'true'
Expand All @@ -112,14 +110,6 @@ jobs:
restore-keys: |
bun-${{ runner.os }}-

- uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # actions/cache@v5
if: steps.compute-range.outputs.skipped != 'true'
with:
path: ${{ github.workspace }}/.playwright-browsers
key: playwright-${{ runner.os }}-${{ hashFiles('head/packages/app/package.json', 'head/bun.lock', 'base/packages/app/package.json', 'base/bun.lock') }}
restore-keys: |
playwright-${{ runner.os }}-

- name: Install head dependencies
if: steps.compute-range.outputs.skipped != 'true'
working-directory: head
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/windows-advisory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ jobs:

- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # oven-sh/setup-bun@v2
with:
bun-version: "1.3.13"
# Load-bearing for `bun audit` exit semantics; do not bump without re-verifying advisory exit codes.
bun-version: "1.3.14"

- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # actions/cache@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Desktop AI workstation for knowledge workers",
"private": true,
"type": "module",
"packageManager": "bun@1.3.13",
"packageManager": "bun@1.3.14",
"scripts": {
"dev": "bun run dev:desktop",
"dev:desktop": "bun --cwd packages/desktop-electron dev",
Expand Down
7 changes: 4 additions & 3 deletions packages/app/src/testing/perf-workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const normalizeLineEndings = (text: string) => text.replace(/\r\n?/g, "\n")

describe("perf workflow contract", () => {
test("matches workflow snippets after Windows line-ending checkout", () => {
const workflow = normalizeLineEndings("restore-keys: |\r\n playwright-${{ runner.os }}-")
const workflow = normalizeLineEndings("restore-keys: |\r\n bun-${{ runner.os }}-")

expect(workflow).toContain("restore-keys: |\n playwright-${{ runner.os }}-")
expect(workflow).toContain("restore-keys: |\n bun-${{ runner.os }}-")
})

test("keeps default gate broad and low-end gate scoped", async () => {
Expand All @@ -28,7 +28,8 @@ describe("perf workflow contract", () => {
expect(workflow).toContain('PLAYWRIGHT_VIDEO: "off"')
expect(workflow).not.toContain("playwright install --with-deps chromium")
expect(workflow).toContain("actions/cache/restore@")
expect(workflow).toContain("restore-keys: |\n playwright-${{ runner.os }}-")
expect(workflow).not.toContain("PLAYWRIGHT_BROWSERS_PATH")
expect(workflow).not.toContain(".playwright-browsers")
expect(workflow).toContain("perf-base-combined.json")
expect(workflow).toContain("perf-head-combined.json")
expect(workflow).toContain("perf-comment.md")
Expand Down
90 changes: 90 additions & 0 deletions packages/opencode/test/github/bun-version-workflow.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import { describe, expect, test } from "bun:test"
import fs from "node:fs"
import path from "node:path"
import { fileURLToPath } from "node:url"
import { parseWorkflow, type Workflow } from "./workflow-parser"

const repoRoot = fileURLToPath(new URL("../../../..", import.meta.url))
const workflowsRoot = path.join(repoRoot, ".github", "workflows")
const expectedBunVersion = "1.3.14"
const auditComment = "Load-bearing for `bun audit` exit semantics"

function collectSetupBunPins(workflow: Workflow, relativePath: string) {
const pins: string[] = []

for (const [jobName, job] of Object.entries(workflow.jobs ?? {})) {
for (const [stepIndex, step] of (job.steps ?? []).entries()) {
if (!step.uses?.startsWith("oven-sh/setup-bun@")) continue

const bunVersion = step.with?.["bun-version"] ?? "<missing>"
pins.push(`${relativePath}:${jobName}:step-${stepIndex + 1}:bun-version: ${JSON.stringify(bunVersion)}`)
}
}

return pins
}

describe("GitHub workflow Bun version pin", () => {
test("detects setup-bun steps that omit bun-version", () => {
const workflow: Workflow = {
jobs: {
unpinned: {
steps: [{ uses: "oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6" }],
},
},
}

expect(collectSetupBunPins(workflow, "synthetic.yml")).toEqual([
"synthetic.yml:unpinned:step-1:bun-version: \"<missing>\"",
])
})

test("keeps every setup-bun runtime on the audit-verified Bun version", () => {
const packageJson = JSON.parse(fs.readFileSync(path.join(repoRoot, "package.json"), "utf8")) as {
packageManager?: string
}
expect(packageJson.packageManager).toBe(`bun@${expectedBunVersion}`)

const workflowFiles = fs
.readdirSync(workflowsRoot)
.filter((name) => name.endsWith(".yml"))
.sort()
.map((name) => path.join(workflowsRoot, name))

const setupBunPins: string[] = []
const missingComments: string[] = []

for (const workflowPath of workflowFiles) {
const relativePath = path.relative(repoRoot, workflowPath)
setupBunPins.push(...collectSetupBunPins(parseWorkflow(workflowPath), relativePath))

const lines = fs.readFileSync(workflowPath, "utf8").split(/\r?\n/)
for (const [index, line] of lines.entries()) {
if (!line.includes("bun-version:")) continue

const previousLines = lines.slice(Math.max(0, index - 3), index).join("\n")
if (!previousLines.includes(auditComment)) {
missingComments.push(`${relativePath}:${index + 1}`)
}
}
}

expect(setupBunPins).toEqual([
".github/workflows/build.yml:build-electron:step-5:bun-version: \"1.3.14\"",
".github/workflows/ci.yml:typecheck:step-3:bun-version: \"1.3.14\"",
".github/workflows/ci.yml:lint:step-3:bun-version: \"1.3.14\"",
".github/workflows/ci.yml:frontend-architecture:step-5:bun-version: \"1.3.14\"",
".github/workflows/ci.yml:unit-app:step-3:bun-version: \"1.3.14\"",
".github/workflows/ci.yml:unit-ui:step-3:bun-version: \"1.3.14\"",
".github/workflows/ci.yml:unit-opencode:step-3:bun-version: \"1.3.14\"",
".github/workflows/ci.yml:unit-desktop:step-3:bun-version: \"1.3.14\"",
".github/workflows/desktop-smoke.yml:smoke-macos-arm64:step-3:bun-version: \"1.3.14\"",
".github/workflows/dev-dep-audit.yml:dev-dep-audit:step-3:bun-version: \"1.3.14\"",
".github/workflows/e2e-artifacts.yml:e2e-artifacts:step-3:bun-version: \"1.3.14\"",
".github/workflows/officecli-bump.yml:officecli-bump:step-3:bun-version: \"1.3.14\"",
".github/workflows/perf-probe-baseline.yml:perf-probe-baseline:step-7:bun-version: \"1.3.14\"",
".github/workflows/windows-advisory.yml:unit-windows:step-3:bun-version: \"1.3.14\"",
])
expect(missingComments).toEqual([])
Comment thread
Astro-Han marked this conversation as resolved.
})
})
Loading
Loading