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
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

jobs:
lint:
if: (github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || github.head_ref == 'trunk'
name: Lint
runs-on: ubuntu-latest
steps:
Expand All @@ -27,6 +28,7 @@ jobs:
run: npm run lint

typecheck:
if: (github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || github.head_ref == 'trunk'
name: Type Check
runs-on: ubuntu-latest
steps:
Expand All @@ -46,6 +48,7 @@ jobs:
run: npm run typecheck

test:
if: (github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || github.head_ref == 'trunk'
name: Test (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -75,6 +78,7 @@ jobs:
run: npm run test:run

build:
if: (github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || github.head_ref == 'trunk'
name: Build
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -103,7 +107,9 @@ jobs:
name: CI Success
needs: [lint, typecheck, test, build]
runs-on: ubuntu-latest
if: always()
if: >-
((github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || github.head_ref == 'trunk') &&
(always())

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skipped CI success passes required checks

Medium Severity

The ci-success aggregator, used for branch protection, now skips on non-trunk PRs. GitHub treats a skipped required check as passing, so existing required checks no longer block mis-targeted PRs. trunk-guard fails under a new check name that current protection rules would not require.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6a3e425. Configure here.

steps:
- name: Check all jobs passed
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/compact-on-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ on:
jobs:
compact:
# Only run when PR is actually merged, not just closed
if: github.event.pull_request.merged == true
if: >-
((github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || github.head_ref == 'trunk') &&
(github.event.pull_request.merged == true)
Comment on lines +13 to +14

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Merged PR trajectories remain uncompacted

When a non-trunk PR merges into main, compact skips its trajectory compaction. Merged PRs outside trunk leave no compacted summary.

Learn more

This workflow runs when a PR targeting main closes. Its original merge condition compacted trajectories for every merged PR, independently of the CI workflow. The new head-branch condition skips merged PRs from other branches, so their summaries are never generated by this job. loadTrajectories only processes trajectories when the compact command runs.

Example: A hotfix PR from fix/crash merges into main. The close event reports merged: true, but the branch gate skips compact, leaving the hotfix trajectories without a summary.

Recommended fix: Restore the merged-only job condition. If compaction is also required for feature PRs merged into trunk, add a separate trunk close trigger and handle that target explicitly.

Suggested change
((github.event_name != 'pull_request' && github.event_name != 'pull_request_target') || github.head_ref == 'trunk') &&
(github.event.pull_request.merged == true)
if: github.event.pull_request.merged == true

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

runs-on: ubuntu-latest

permissions:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/trunk-guard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Trunk guard

# Only the `trunk` branch may merge into main. Feature branches merge into
# `trunk` (via the merge train); CI runs only on the trunk -> main PR.
on:
pull_request:
branches: [main]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trunk guard ignores base branch edits

Low Severity

trunk-guard.yml uses default pull_request types, which omit edited. Changing a PR base to main does not start a new run, so a retargeted feature PR can point at main without the failing guard check.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6a3e425. Configure here.


jobs:
only-trunk-merges-to-main:
if: github.head_ref != 'trunk'
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- run: |
echo "::error::Only the 'trunk' branch may merge into main. Retarget this PR to 'trunk'."
exit 1
Loading