Skip to content

fix(web): composer pull request row loads whole, closes, and follows the merge queue #1177

fix(web): composer pull request row loads whole, closes, and follows the merge queue

fix(web): composer pull request row loads whole, closes, and follows the merge queue #1177

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
# Merge queue: GitHub re-runs the required checks on each queued merge result
# before it lands on main. Without this trigger nothing in the queue can pass.
merge_group:
workflow_dispatch:
inputs:
deploy:
description: "Deploy app.threadlines.dev after checks pass. Only applies when dispatched from main."
required: false
default: false
type: boolean
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
quality:
name: Format, Lint, Typecheck, Test, Build
runs-on: ubuntu-latest
# 20 minutes starves dependency-bump branches: a lockfile change cold-starts
# every cache and slow runners then hit the cap mid-pipeline.
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Vite+
uses: voidzero-dev/setup-vp@1b32467adbe183473499fd9d5d372c3ed9641754 # v1.18.0
with:
node-version-file: package.json
cache: true
version: "0.2.4"
run-install: false
- name: Install dependencies
run: vp install --frozen-lockfile
- name: Ensure Electron binary is installed
run: node scripts/ensure-electron-binary.ts
- name: Format
run: vp fmt --check
- name: Lint
run: vp exec vp lint --report-unused-disable-directives
- name: Vendored Playwright injected script is current
run: node scripts/extract-playwright-injected.ts --check
- name: Typecheck
run: vp exec vp run -r --concurrency-limit 2 typecheck
- name: Test
# --parallel drops package ordering: server depends on web, so without it
# the server suite (~2.5 min) waits for the web suite (~3 min) to finish.
run: vp exec vp run --parallel --concurrency-limit 4 test
- name: Build desktop pipeline
run: vp exec vp run build:desktop
- name: Verify preload bundle output
run: |
test -f apps/desktop/dist-electron/preload.cjs
grep -nE "desktopBridge|getLocalEnvironmentBootstrap|PICK_FOLDER_CHANNEL|wsUrl" apps/desktop/dist-electron/preload.cjs
browser:
# Runs beside `quality` rather than after it: the browser suite is the
# second-longest step and shares nothing with the unit suite.
name: Browser Test
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Vite+
uses: voidzero-dev/setup-vp@1b32467adbe183473499fd9d5d372c3ed9641754 # v1.18.0
with:
node-version-file: package.json
cache: true
version: "0.2.4"
run-install: false
- name: Install dependencies
run: vp install --frozen-lockfile
# Hosted runners point apt at azure.archive.ubuntu.com, which
# intermittently stalls for 20+ minutes and starves the job timeout.
# Ubuntu 24.04 keeps the active mirror in apt-mirrors.txt, while older
# images use .list or .sources files, so update every supported format.
- name: Use main Ubuntu mirror for apt
run: sudo find /etc/apt -type f \( -name "*.list" -o -name "*.sources" -o -name "apt-mirrors.txt" \) -exec sed -i 's|azure.archive.ubuntu.com|archive.ubuntu.com|g' {} +
- name: Install browser test runtime
timeout-minutes: 10
run: vp exec vp run --filter @threadlines/web test:browser:install
- name: Browser test
run: vp exec vp run --filter @threadlines/web test:browser
# Browser test failures are timing-sensitive and CI-only more often than
# not; the on-failure screenshot is the only evidence of what rendered.
- name: Upload browser test failure screenshots
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: browser-test-screenshots
path: apps/web/src/**/__screenshots__/**
if-no-files-found: ignore
release_smoke:
name: Release Smoke
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Vite+
uses: voidzero-dev/setup-vp@1b32467adbe183473499fd9d5d372c3ed9641754 # v1.18.0
with:
node-version-file: package.json
cache: true
version: "0.2.4"
run-install: false
- name: Install dependencies
run: vp install --frozen-lockfile
- name: Exercise release-only workflow steps
run: node scripts/release-smoke.ts
deploy_web_app:
name: Deploy app.threadlines.dev
needs:
- quality
- browser
- release_smoke
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' && inputs.deploy == true
uses: ./.github/workflows/deploy-web.yml
secrets: inherit