deploy-release-test

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Deploy Release Test

部署发布测试

Use this skill only when manually running the entire Next.js deployment test suite for a pull request. Treat package validation as a hard gate: never dispatch the workflow until the exact commit's redirected tarball responds successfully.
仅在为拉取请求(PR)手动运行完整的Next.js部署测试套件时使用此技能。将包验证视为硬性门槛:在确切提交的重定向tarball响应成功之前,切勿触发工作流。

Scope

适用范围

Do not use this workflow to sanity-check one deployment test or a focused group of tests. Follow Running Deploy Tests Locally instead:
bash
NEXT_TEST_VERSION=https://vercel-packages.vercel.app/next/commits/<commit-sha>/next pnpm test-deploy <path-to-test>
If a request to "run deploy tests" does not explicitly call for the entire suite, prefer the focused local workflow and scope it to the affected tests.
请勿使用此工作流对单个部署测试或一组针对性测试进行sanity检查。请改用本地运行部署测试
bash
NEXT_TEST_VERSION=https://vercel-packages.vercel.app/next/commits/<commit-sha>/next pnpm test-deploy <path-to-test>
如果“运行部署测试”的请求未明确要求运行整个套件,请优先选择本地针对性工作流,并将范围限定在受影响的测试上。

Inputs

输入要求

  • Accept a PR number or determine the PR from the current branch.
  • Use repository
    vercel/next.js
    and workflow
    .github/workflows/test_e2e_deploy_release.yml
    .
  • Require the PR head branch to exist in
    vercel/next.js
    . A fork branch cannot run this secret-bearing workflow; use the repository's PR adoption process first when appropriate.
  • 接受PR编号,或从当前分支确定PR。
  • 使用仓库
    vercel/next.js
    和工作流
    .github/workflows/test_e2e_deploy_release.yml
  • 要求PR头部分支存在于
    vercel/next.js
    中。fork分支无法运行此包含敏感信息的工作流;必要时请先使用仓库的PR采纳流程。

Workflow

工作流程

  1. Resolve the PR branch and its latest commit from GitHub, not merely from the local checkout:
    bash
    gh pr view <pr-number> --repo vercel/next.js \
      --json number,url,headRefName,headRefOid,isCrossRepository
    If no PR number was supplied, omit
    <pr-number>
    to detect the PR from the current branch. Stop if
    isCrossRepository
    is
    true
    . Record
    headRefName
    as the branch and
    headRefOid
    as the commit SHA.
  2. Construct the exact package URL:
    text
    https://vercel-packages.vercel.app/next/commits/<commit-sha>/next
  3. Wait for the package to become downloadable before dispatching anything:
    bash
    node scripts/wait-for-preview-tarball.mjs --commit-sha <commit-sha>
    Keep the wait in an ongoing terminal session and poll it so the user still receives progress updates. The helper uses
    HEAD
    , follows the redirect to Vercel Blob, and only succeeds when the final artifact is available. Do not substitute a check that accepts the initial redirect: that endpoint can redirect even while the blob still returns 404.
    If the helper times out or reports an authorization or build failure, do not dispatch the workflow. Report the failure and inspect the commit's
    build-and-deploy
    /
    upload-preview-tarballs
    checks if useful.
  4. Resolve the PR again immediately after validation. Compare the current
    headRefName
    and
    headRefOid
    with the recorded values. If either changed, return to step 2 and validate the new commit-specific URL. Never reuse the old package URL for a moved branch.
  5. Trigger the workflow from the PR branch and pass only
    nextVersion
    :
    bash
    gh workflow run test_e2e_deploy_release.yml \
      --repo vercel/next.js \
      --ref <pr-branch> \
      -f nextVersion=https://vercel-packages.vercel.app/next/commits/<commit-sha>/next
    Do not pass any other
    -f
    values. Leaving them unspecified preserves the workflow defaults, including
    vercelCliVersion: vercel@latest
    and empty optional overrides.
  6. Find and verify the newly created run:
    bash
    gh run list --repo vercel/next.js \
      --workflow test_e2e_deploy_release.yml \
      --branch <pr-branch> \
      --event workflow_dispatch \
      --limit 5 \
      --json databaseId,url,status,conclusion,headBranch,headSha,displayTitle,createdAt
    Confirm that the newest matching run has:
    • headBranch
      equal to the PR branch
    • headSha
      equal to the validated commit SHA
    • displayTitle
      containing the exact commit-specific package URL
    A race can still move the branch between the final check and dispatch. If the run's
    headSha
    differs, report the mismatch and do not trigger another run until the new SHA's package has been validated.
  1. 从GitHub而非本地检出内容解析PR分支及其最新提交:
    bash
    gh pr view <pr-number> --repo vercel/next.js \
      --json number,url,headRefName,headRefOid,isCrossRepository
    如果未提供PR编号,请省略
    <pr-number>
    以从当前分支检测PR。如果
    isCrossRepository
    true
    ,则停止操作。记录
    headRefName
    为分支名称,
    headRefOid
    为提交SHA。
  2. 构造确切的包URL:
    text
    https://vercel-packages.vercel.app/next/commits/<commit-sha>/next
  3. 在触发任何操作之前,等待包可下载:
    bash
    node scripts/wait-for-preview-tarball.mjs --commit-sha <commit-sha>
    在持续的终端会话中等待并轮询,以便用户仍能收到进度更新。该辅助工具使用
    HEAD
    请求,跟随重定向到Vercel Blob,仅当最终工件可用时才会成功。请勿替代为接受初始重定向的检查:该端点可能在blob仍返回404时就进行重定向。
    如果辅助工具超时或报告授权或构建失败,请不要触发工作流。报告失败情况,如有需要可检查提交的
    build-and-deploy
    /
    upload-preview-tarballs
    检查状态。
  4. 验证完成后立即重新解析PR。将当前的
    headRefName
    headRefOid
    与记录的值进行比较。如果其中任何一个发生变化,请返回步骤2并验证新提交对应的URL。切勿为已更新的分支重用旧的包URL。
  5. 从PR分支触发工作流,仅传递
    nextVersion
    参数:
    bash
    gh workflow run test_e2e_deploy_release.yml \
      --repo vercel/next.js \
      --ref <pr-branch> \
      -f nextVersion=https://vercel-packages.vercel.app/next/commits/<commit-sha>/next
    请勿传递任何其他
    -f
    参数。留空这些参数将保留工作流默认值,包括
    vercelCliVersion: vercel@latest
    以及空的可选覆盖参数。
  6. 查找并验证新创建的运行:
    bash
    gh run list --repo vercel/next.js \
      --workflow test_e2e_deploy_release.yml \
      --branch <pr-branch> \
      --event workflow_dispatch \
      --limit 5 \
      --json databaseId,url,status,conclusion,headBranch,headSha,displayTitle,createdAt
    确认最新的匹配运行满足以下条件:
    • headBranch
      等于PR分支
    • headSha
      等于已验证的提交SHA
    • displayTitle
      包含确切的特定提交包URL
    在最终检查和触发之间,分支仍可能被更新。如果运行的
    headSha
    不一致,请报告不匹配情况,直到新SHA对应的包已验证完成后再触发新的运行。

Completion Report

完成报告

Report the PR branch, validated SHA and package URL, workflow run URL, and its current status. Do not wait for the full deployment suite unless the user asks you to monitor it.
报告PR分支、已验证的SHA和包URL、工作流运行URL及其当前状态。除非用户要求监控,否则无需等待完整部署套件运行完成。

Related Skills

相关技能

  • $pr-status-triage
    - Inspect failures if the deployment workflow does not pass.
  • $create-pr
    - Create or update the internal PR branch before deployment testing.
  • $pr-status-triage
    - 如果部署工作流未通过,检查失败原因。
  • $create-pr
    - 在部署测试之前创建或更新内部PR分支。