• Will Chen's avatar
    Use workflow_dispatch to re-trigger CI instead of closing/reopening PR (#2382) · 0e6404c9
    Will Chen 提交于
    ## Summary
    Replace the PR close/reopen mechanism for CI re-triggering with GitHub's
    `workflow_dispatch` event, which is more reliable and avoids potential
    issues with PR state management.
    
    ## Key Changes
    - **ci.yml**: Added `workflow_dispatch` trigger with optional
    `pr_number` input parameter to allow manual CI runs
    - **ci.yml**: Updated test check logic to always run tests when
    triggered via `workflow_dispatch`
    - **ci.yml**: Pass `PR_NUMBER` environment variable to Playwright
    summary script for workflow_dispatch triggers
    - **pr-review-responder.yml**: Replaced PR close/reopen logic with `gh
    workflow run` command to trigger CI via `workflow_dispatch`
    
    ## Implementation Details
    - The `workflow_dispatch` trigger accepts an optional `pr_number` input
    that can be passed by the pr-review-responder workflow
    - When CI is triggered via `workflow_dispatch`, tests always run
    (skipping the file change check)
    - The new approach is more reliable because:
      - Avoids the risk of leaving a PR in a closed state if operations fail
      - Works with `GITHUB_TOKEN` without infinite loop concerns
      - Provides explicit control over when CI re-runs
    - Eliminates retry logic and recovery mechanisms needed with
    close/reopen approach
    
    https://claude.ai/code/session_014TKdhebC3RqZ7yusKuRSJD
    <!-- devin-review-badge-begin -->
    
    ---
    
    <a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2382">
      <picture>
    <source media="(prefers-color-scheme: dark)"
    srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
    <img
    src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
    alt="Open with Devin">
      </picture>
    </a>
    <!-- devin-review-badge-end -->
    
    <!-- CURSOR_SUMMARY -->
    ---
    
    > [!NOTE]
    > **Medium Risk**
    > Medium risk because it changes GitHub Actions triggering, concurrency
    grouping, and checkout behavior (including fork PR handling) for CI and
    AI review bots; misconfiguration could lead to running workflows on the
    wrong ref or not running at all.
    > 
    > **Overview**
    > Switches CI and AI-bot workflows to support manual `workflow_dispatch`
    runs via a required `pr_number`, enabling reliable re-triggers without
    PR close/reopen.
    > 
    > `ci.yml` now derives checkout `repository`/`ref` from the PR head
    (fetched via `gh pr view` for dispatch), updates concurrency grouping to
    key by PR number, always runs tests for dispatch runs, and passes
    `PR_NUMBER` to the Playwright summary script so comments still attach to
    the correct PR.
    > 
    > `pr-review-responder.yml` replaces the close/reopen hack with `gh
    workflow run` calls to dispatch `ci.yml`, `bugbot-trigger.yml`, and
    `claude-pr-review.yml` when Claude pushes commits. `bugbot-trigger.yml`
    and `claude-pr-review.yml` add dispatch support and PR-number fallbacks;
    BugBot additionally validates `pr_number` and re-checks skip tags before
    commenting.
    > 
    > <sup>Written by [Cursor
    Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
    357dddba6b3c3c9144b21f6f400fc0b49e55e244. This will update automatically
    on new commits. Configure
    [here](https://cursor.com/dashboard?tab=bugbot).</sup>
    <!-- /CURSOR_SUMMARY -->
    
    <!-- This is an auto-generated description by cubic. -->
    ---
    ## Summary by cubic
    Switch re-triggers to workflow_dispatch for CI, BugBot, and Claude PR
    Review. This replaces the close/reopen hack, works with GITHUB_TOKEN,
    and ensures tests and reviews run after automated commits.
    
    - **Refactors**
    - Added workflow_dispatch with pr_number input to ci.yml,
    bugbot-trigger.yml, and claude-pr-review.yml.
    - pr-review-responder now calls gh workflow run for all three when it
    pushes commits.
    - CI always runs tests on workflow_dispatch, checks out the PR head
    (supports forks), passes PR_NUMBER to the Playwright summary, and uses
    pr_number in concurrency.
    - Claude PR Review fetches PR head info on dispatch; concurrency keys
    use pr_number when provided.
    - BugBot dispatch uses inputs.pr_number, re-checks skip tags, and
    bypasses author gating for dispatch.
    
    <sup>Written for commit 357dddba6b3c3c9144b21f6f400fc0b49e55e244.
    Summary will update on new commits.</sup>
    
    <!-- End of auto-generated description by cubic. -->
    
    ---------
    Co-authored-by: 's avatarClaude <noreply@anthropic.com>
    0e6404c9
名称
最后提交
最后更新
.claude 正在载入提交数据...
.cursor/rules 正在载入提交数据...
.devcontainer 正在载入提交数据...
.github 正在载入提交数据...
.husky 正在载入提交数据...
assets 正在载入提交数据...
docs 正在载入提交数据...
drizzle 正在载入提交数据...
e2e-tests 正在载入提交数据...
makers 正在载入提交数据...
packages/@dyad-sh 正在载入提交数据...
scaffold 正在载入提交数据...
scripts 正在载入提交数据...
shared 正在载入提交数据...
src 正在载入提交数据...
testing 正在载入提交数据...
tools 正在载入提交数据...
worker 正在载入提交数据...
workers/tsc 正在载入提交数据...
.cursorignore 正在载入提交数据...
.env.example 正在载入提交数据...
.eslintrc.json 正在载入提交数据...
.gitattributes 正在载入提交数据...
.gitignore 正在载入提交数据...
.oxfmtrc.json 正在载入提交数据...
.oxlintrc.json 正在载入提交数据...
.prettierignore 正在载入提交数据...
.prettierrc 正在载入提交数据...
AGENTS.md 正在载入提交数据...
CLA.md 正在载入提交数据...
CLAUDE.md 正在载入提交数据...
CONTRIBUTING.md 正在载入提交数据...
LICENSE 正在载入提交数据...
README.md 正在载入提交数据...
SECURITY.md 正在载入提交数据...
biome.json 正在载入提交数据...
components.json 正在载入提交数据...
drizzle.config.ts 正在载入提交数据...
forge.config.ts 正在载入提交数据...
forge.env.d.ts 正在载入提交数据...
index.html 正在载入提交数据...
lint-staged.config.js 正在载入提交数据...
merge.config.ts 正在载入提交数据...
package-lock.json 正在载入提交数据...
package.json 正在载入提交数据...
playwright.config.ts 正在载入提交数据...
tsconfig.app.json 正在载入提交数据...
tsconfig.json 正在载入提交数据...
tsconfig.node.json 正在载入提交数据...
vite.main.config.mts 正在载入提交数据...
vite.preload.config.mts 正在载入提交数据...
vite.renderer.config.mts 正在载入提交数据...
vite.worker.config.mts 正在载入提交数据...
vitest.config.ts 正在载入提交数据...