## Summary - Fixes merge queue PRs blocking each other by changing the concurrency group in `ci-merge-queue.yaml` - The old concurrency group used `merge_group.base_ref` which resolves to `refs/heads/main` for every PR, causing all merge queue entries to serialize behind a single concurrency slot - Now uses `github.ref` (unique per entry: `refs/heads/gh-readonly-queue/main/pr-NUMBER-SHA`), matching what all other CI workflows already do ## Recommended ruleset changes (in GitHub Settings > Rules > Rulesets > "CI Status Checks") - **Grouping strategy**: Switch `ALLGREEN` to `NONE` -- each PR is still tested against the correct base (including all PRs ahead of it in the queue), but failures only affect the failing PR instead of ejecting the entire group. `max_entries_to_build: 5` still allows parallel speculative testing. - **`min_entries_to_merge_wait_minutes`**: Reduce from 5 to 1 -- the 5-minute wait adds unnecessary latency to every merge. ## Test plan - [ ] Enqueue 2+ PRs in the merge queue and verify both trigger e2e tests in parallel instead of one blocking the other
141 lines
4.0 KiB
YAML
141 lines
4.0 KiB
YAML
name: CI Merge Queue
|
|
|
|
on:
|
|
merge_group:
|
|
|
|
pull_request:
|
|
types: [labeled, synchronize, opened, reopened]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
|
|
jobs:
|
|
e2e-test:
|
|
if: >
|
|
github.event_name == 'merge_group' ||
|
|
(github.event_name == 'pull_request' &&
|
|
contains(github.event.pull_request.labels.*.name, 'run-merge-queue'))
|
|
runs-on: ubuntu-latest-8-cores
|
|
timeout-minutes: 30
|
|
env:
|
|
NODE_OPTIONS: "--max-old-space-size=10240"
|
|
services:
|
|
postgres:
|
|
image: twentycrm/twenty-postgres-spilo
|
|
env:
|
|
PGUSER_SUPERUSER: postgres
|
|
PGPASSWORD_SUPERUSER: postgres
|
|
ALLOW_NOSSL: "true"
|
|
SPILO_PROVIDER: "local"
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
redis:
|
|
image: redis
|
|
ports:
|
|
- 6379:6379
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 10
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/*
|
|
|
|
- name: Install dependencies
|
|
uses: ./.github/actions/yarn-install
|
|
|
|
- name: Restore Nx build cache
|
|
uses: actions/cache/restore@v4
|
|
with:
|
|
key: v4-e2e-build-${{ github.ref_name }}-${{ github.sha }}
|
|
restore-keys: |
|
|
v4-e2e-build-${{ github.ref_name }}-
|
|
v4-e2e-build-main-
|
|
path: |
|
|
.nx
|
|
node_modules/.cache
|
|
packages/*/node_modules/.cache
|
|
|
|
- name: Build twenty-shared
|
|
run: npx nx build twenty-shared
|
|
|
|
- name: Install Playwright Browsers
|
|
run: npx nx setup twenty-e2e-testing
|
|
|
|
- name: Setup environment files
|
|
run: |
|
|
cp packages/twenty-front/.env.example packages/twenty-front/.env
|
|
npx nx reset:env:e2e-testing-server twenty-server
|
|
|
|
- name: Build frontend
|
|
run: NODE_ENV=production npx nx build twenty-front
|
|
|
|
- name: Build server
|
|
run: npx nx build twenty-server
|
|
|
|
- name: Save Nx build cache
|
|
if: always()
|
|
uses: actions/cache/save@v4
|
|
with:
|
|
key: v4-e2e-build-${{ github.ref_name }}-${{ github.sha }}
|
|
path: |
|
|
.nx
|
|
node_modules/.cache
|
|
packages/*/node_modules/.cache
|
|
|
|
- name: Create and setup database
|
|
run: |
|
|
PGPASSWORD=postgres psql -h localhost -p 5432 -U postgres -d postgres -c 'CREATE DATABASE "default";'
|
|
PGPASSWORD=postgres psql -h localhost -p 5432 -U postgres -d postgres -c 'CREATE DATABASE "test";'
|
|
npx nx run twenty-server:database:reset
|
|
|
|
- name: Start server
|
|
run: |
|
|
npx nx start twenty-server &
|
|
echo "Waiting for server to be ready..."
|
|
timeout 60 bash -c 'until curl -s http://localhost:3000/health; do sleep 2; done'
|
|
|
|
- name: Start frontend
|
|
run: |
|
|
npm_config_yes=true npx serve -s packages/twenty-front/build -l 3001 &
|
|
echo "Waiting for frontend to be ready..."
|
|
timeout 60 bash -c 'until curl -s http://localhost:3001; do sleep 2; done'
|
|
|
|
- name: Start worker
|
|
run: |
|
|
npx nx run twenty-server:worker &
|
|
echo "Worker started"
|
|
|
|
- name: Run Playwright tests
|
|
run: npx nx test twenty-e2e-testing
|
|
|
|
- name: Upload Playwright results
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: playwright-results
|
|
path: |
|
|
packages/twenty-e2e-testing/run_results/
|
|
packages/twenty-e2e-testing/test-results/
|
|
retention-days: 7
|
|
|
|
ci-merge-queue-status-check:
|
|
if: always() && !cancelled()
|
|
timeout-minutes: 5
|
|
runs-on: ubuntu-latest
|
|
needs: [e2e-test]
|
|
steps:
|
|
- name: Fail job if any needs failed
|
|
if: contains(needs.*.result, 'failure')
|
|
run: exit 1
|