diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f0cb19890fc5..484ede7b56f7 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -42,8 +42,6 @@ updates: - "miniflare" - "dependencies" - "skip-pr-description-validation" - - "e2e" - - "every-os" allow: - dependency-name: "workerd" - dependency-name: "@cloudflare/workers-types" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 5a088feb4972..732a30f4e2f0 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -10,19 +10,12 @@ The following selections do not need to be completed if this PR only contains ch --> - Tests - - [ ] TODO (before merge) - [ ] Tests included - [ ] Tests not necessary because: -- Wrangler / Vite E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately) - - [ ] I don't know - - [ ] Required - - [ ] Not required because: - Public documentation - - [ ] TODO (before merge) - [ ] Cloudflare docs PR(s): - [ ] Documentation not necessary because: - Wrangler V3 Backport - - [ ] TODO (before merge) - [ ] Wrangler PR: - [ ] Not necessary because: diff --git a/.github/workflows/c3-e2e.yml b/.github/workflows/c3-e2e.yml index bdb703b947a4..6526548ce9f0 100644 --- a/.github/workflows/c3-e2e.yml +++ b/.github/workflows/c3-e2e.yml @@ -1,30 +1,36 @@ -name: C3 E2E Tests +name: E2E on: + merge_group: pull_request: - types: [synchronize, opened, reopened, labeled, unlabeled] env: # TODO: switch back to 20.x onces node@20.x includes a fix for https://github.com/nodejs/node/issues/57869 NODE_VERSION: 22 jobs: - e2e-vp: + e2e: # Note: please keep this job in sync with the e2e-only-dependabot-bumped-framework one #  in .github/workflows/c3-e2e-dependabot.yml - if: github.head_ref == 'changeset-release/main' || (contains(github.event.*.labels.*.name, 'c3-e2e' ) && contains(github.event.*.labels.*.name, 'every-os' )) timeout-minutes: 45 concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.pm.name }}-${{ matrix.pm.version }} cancel-in-progress: true - name: ${{ format('Run tests for {0}@{1} on {2}', matrix.pm.name, matrix.pm.version, matrix.os) }} + name: ${{ format('C3 ({0})', matrix.description) }} strategy: fail-fast: false matrix: - os: [ubuntu-latest] - pm: [{ name: npm, version: "0.0.0" }, { name: yarn, version: "1.0.0" }] - # include a single windows test with pnpm include: - os: windows-latest + description: pnpm, Windows + pm: { name: pnpm, version: "9.12.0" } + - os: ubuntu-latest + description: npm, Linux + pm: { name: npm, version: "0.0.0" } + - os: ubuntu-latest + description: yarn, Linux + pm: { name: yarn, version: "1.0.0" } + - os: ubuntu-latest + description: pnpm, Linux pm: { name: pnpm, version: "9.12.0" } runs-on: ${{ matrix.os }} steps: @@ -49,67 +55,10 @@ jobs: turbo-token: ${{ secrets.TURBO_TOKEN }} turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} - - name: E2E Tests (experimental) - if: steps.changes.outputs.everything_but_markdown == 'true' - uses: ./.github/actions/run-c3-e2e - with: - node-version: ${{ env.NODE_VERSION }} - packageManager: ${{ matrix.pm.name }} - packageManagerVersion: ${{ matrix.pm.version }} - quarantine: false - experimental: true - accountId: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} - apiToken: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} - - - name: E2E Tests (non-experimental) - if: steps.changes.outputs.everything_but_markdown == 'true' - uses: ./.github/actions/run-c3-e2e - with: - node-version: ${{ env.NODE_VERSION }} - packageManager: ${{ matrix.pm.name }} - packageManagerVersion: ${{ matrix.pm.version }} - quarantine: false - experimental: false - accountId: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} - apiToken: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} - - e2e: - # Note: please keep this job in sync with the e2e-only-dependabot-bumped-framework one - #  in .github/workflows/c3-e2e-dependabot.yml - if: contains(github.event.*.labels.*.name, 'c3-e2e' ) - timeout-minutes: 45 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.pm.name }}-${{ matrix.pm.version }} - cancel-in-progress: true - name: ${{ format('Run tests for {0}@{1} on {2}', matrix.pm.name, matrix.pm.version, matrix.os) }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - pm: [{ name: pnpm, version: "9.12.0" }] - - runs-on: ${{ matrix.os }} - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: dorny/paths-filter@v3 - id: changes - with: - filters: | - everything_but_markdown: - - '!**/*.md' - - name: Install Dependencies - if: steps.changes.outputs.everything_but_markdown == 'true' - uses: ./.github/actions/install-dependencies - with: - node-version: ${{ env.NODE_VERSION }} - turbo-api: ${{ secrets.TURBO_API }} - turbo-team: ${{ secrets.TURBO_TEAM }} - turbo-token: ${{ secrets.TURBO_TOKEN }} - turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + - name: Bump package versions + run: node .github/changeset-version.js + env: + GITHUB_TOKEN: ${{ github.token }} - name: E2E Tests (experimental) if: steps.changes.outputs.everything_but_markdown == 'true' diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 0fa91a923114..edd1a6c9a0f9 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,31 +1,40 @@ -name: E2E tests +name: E2E on: + merge_group: pull_request: - types: [synchronize, opened, reopened, labeled, unlabeled] - repository_dispatch: jobs: - e2e-test-vp: - name: "E2E tests" + e2e-wrangler-test: + name: ${{ format('Wrangler ({0})', matrix.description) }} concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.node }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.node }}-wrangler cancel-in-progress: true timeout-minutes: 60 - if: github.event_name == 'pull_request' && contains(github.event.*.labels.*.name, 'e2e' ) && github.event.pull_request.head.repo.owner.login == 'cloudflare' && (github.head_ref == 'changeset-release/main' || contains(github.event.*.labels.*.name, 'every-os' )) strategy: fail-fast: false matrix: - os: [macos-13, windows-2022] - node: ["20.19.1"] + include: + - os: macos-13 + description: v20, macOS + node: 20.19.1 + - os: windows-2022 + description: v20, Windows + node: 20.19.1 + - os: ubuntu-22.04-arm + description: v20, Linux + node: 20.19.1 + runs-on: ${{ matrix.os }} steps: - name: Checkout Repo + if: github.event.pull_request.head.repo.owner.login == 'cloudflare' uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install Dependencies + if: github.event.pull_request.head.repo.owner.login == 'cloudflare' uses: ./.github/actions/install-dependencies with: node-version: ${{ matrix.node }} @@ -34,18 +43,13 @@ jobs: turbo-token: ${{ secrets.TURBO_TOKEN }} turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} - - name: Run Vite E2E tests - run: pnpm test:e2e -F @cloudflare/vite-plugin --log-order=stream - timeout-minutes: 15 + - name: Bump package versions + run: node .github/changeset-version.js env: - NODE_DEBUG: "vite-plugin:test" - # The AI tests need to connect to Cloudflare - CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} - NODE_OPTIONS: "--max_old_space_size=8192" - CI_OS: ${{ matrix.os }} + GITHUB_TOKEN: ${{ github.token }} - name: Run Wrangler E2E tests + if: github.event.pull_request.head.repo.owner.login == 'cloudflare' run: pnpm run test:e2e:wrangler env: CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} @@ -66,26 +70,34 @@ jobs: name: turbo-runs-${{ matrix.os }}-${{ matrix.node }} path: .turbo/runs - e2e-test: - name: "E2E tests" + e2e-vite-test: + name: ${{ format('Vite ({0})', matrix.description) }} concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.node }} + group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.node }}-vite cancel-in-progress: true timeout-minutes: 60 - if: github.event_name == 'pull_request' && contains(github.event.*.labels.*.name, 'e2e' ) && github.event.pull_request.head.repo.owner.login == 'cloudflare' strategy: - fail-fast: false matrix: - os: [ubuntu-22.04-arm] - node: ["20.19.1"] + include: + - os: macos-13 + description: v20, macOS + node: 20.19.1 + - os: windows-2022 + description: v20, Windows + node: 20.19.1 + - os: ubuntu-22.04-arm + description: v20, Linux + node: 20.19.1 runs-on: ${{ matrix.os }} steps: - name: Checkout Repo + if: github.event.pull_request.head.repo.owner.login == 'cloudflare' uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install Dependencies + if: github.event.pull_request.head.repo.owner.login == 'cloudflare' uses: ./.github/actions/install-dependencies with: node-version: ${{ matrix.node }} @@ -94,7 +106,13 @@ jobs: turbo-token: ${{ secrets.TURBO_TOKEN }} turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + - name: Bump package versions + run: node .github/changeset-version.js + env: + GITHUB_TOKEN: ${{ github.token }} + - name: Run Vite E2E tests + if: github.event.pull_request.head.repo.owner.login == 'cloudflare' run: pnpm test:e2e -F @cloudflare/vite-plugin --log-order=stream timeout-minutes: 15 env: @@ -105,20 +123,6 @@ jobs: NODE_OPTIONS: "--max_old_space_size=8192" CI_OS: ${{ matrix.os }} - - name: Run Wrangler E2E tests - run: pnpm run test:e2e:wrangler - env: - CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} - HYPERDRIVE_DATABASE_URL: ${{ secrets.TEST_HYPERDRIVE_DATABASE_URL}} - WRANGLER: node --no-warnings ${{ github.workspace}}/packages/wrangler/bin/wrangler.js - WRANGLER_IMPORT: ${{ github.workspace}}/packages/wrangler/wrangler-dist/cli.js - MINIFLARE_IMPORT: ${{ github.workspace}}/packages/miniflare/dist/src/index.js - NODE_OPTIONS: "--max_old_space_size=8192" - WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/ - TEST_REPORT_PATH: ${{ runner.temp }}/test-report/index.html - CI_OS: ${{ matrix.os }} - - name: Upload turbo logs if: always() uses: actions/upload-artifact@v4 diff --git a/.github/workflows/open-v3-maintenance-prs.yml b/.github/workflows/open-v3-maintenance-prs.yml index 2a86036b899d..10da8de47a1d 100644 --- a/.github/workflows/open-v3-maintenance-prs.yml +++ b/.github/workflows/open-v3-maintenance-prs.yml @@ -2,7 +2,8 @@ name: v3 Maintenance on: pull_request: - branches: main + branches: + - main types: [synchronize, opened, reopened, labeled, unlabeled] paths: - ".changeset/**.md" diff --git a/.github/workflows/test-and-check.yml b/.github/workflows/test-and-check.yml index 0ff59e0b2a4f..e615b811611d 100644 --- a/.github/workflows/test-and-check.yml +++ b/.github/workflows/test-and-check.yml @@ -3,7 +3,6 @@ name: CI on: merge_group: pull_request: - types: [synchronize, opened, reopened, labeled, unlabeled] jobs: add-to-project: @@ -17,19 +16,14 @@ jobs: steps: - run: curl -X POST https://devprod-status-bot.devprod.workers.dev/pr-project/workers-sdk/${{ github.event.number }} - check-vp: - if: github.head_ref == 'changeset-release/main' || contains(github.event.*.labels.*.name, 'every-os' ) + check: timeout-minutes: 30 concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-checks cancel-in-progress: true name: "Checks" - strategy: - fail-fast: false - matrix: - os: [ubuntu-24.04-arm, windows-latest] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-24.04-arm steps: - name: Checkout Repo uses: actions/checkout@v4 @@ -44,42 +38,16 @@ jobs: turbo-token: ${{ secrets.TURBO_TOKEN }} turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} - - name: Check for errors - run: pnpm run check --summarize + - name: Bump package versions + run: node .github/changeset-version.js env: - CI_OS: ${{ runner.os }} - NODE_OPTIONS: "--max_old_space_size=8192" - - - name: Check the changesets - run: node -r esbuild-register tools/deployments/validate-changesets.ts - - check: - timeout-minutes: 30 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-pr-checks - cancel-in-progress: true - - name: "Checks" - runs-on: macos-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Install Dependencies - uses: ./.github/actions/install-dependencies - with: - turbo-api: ${{ secrets.TURBO_API }} - turbo-team: ${{ secrets.TURBO_TEAM }} - turbo-token: ${{ secrets.TURBO_TOKEN }} - turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} + GITHUB_TOKEN: ${{ github.token }} - name: Check for errors run: pnpm run check --summarize env: - NODE_OPTIONS: "--max_old_space_size=8192" CI_OS: ${{ runner.os }} + NODE_OPTIONS: "--max_old_space_size=8192" - name: Check the changesets run: node -r esbuild-register tools/deployments/validate-changesets.ts @@ -108,30 +76,40 @@ jobs: - name: Check for error message on Node.js < v20 run: node packages/wrangler/src/__tests__/test-old-node-version.js error - test-vp: - if: github.head_ref == 'changeset-release/main' || contains(github.event.*.labels.*.name, 'every-os' ) + test: timeout-minutes: 30 concurrency: group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.filter }}-${{ matrix.node_version }}-test cancel-in-progress: true - name: ${{ format('Tests ({0})', matrix.os_name) }} + name: ${{ format('Tests ({0})', matrix.description) }} strategy: fail-fast: false matrix: include: + - os: macos-latest + description: macOS + node_version: 20.19.1 + filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --summarize' - os: ubuntu-24.04-arm - os_name: Linux + description: Linux node_version: 20.19.1 + # ./tools _only_ runs here because they're only intended to run in CI filter: '--filter="./tools" --filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground"' - os: windows-latest - os_name: Windows + description: Windows node_version: 20.19.1 filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground"' - os: ubuntu-24.04-arm - os_name: v22, Linux + description: v22, Linux node_version: 22 - filter: '--filter="./packages/*" --filter="!./packages/kv-asset-handler"' + filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --filter="!./packages/kv-asset-handler" --filter="!./fixtures/interactive-dev-tests"' + # Skipped until we upgrade to undici v7, because of https://github.com/nodejs/undici/issues/4285 + # - os: ubuntu-24.04-arm + # label: v24, Linux + # node_version: 24 + # filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --filter="!./packages/kv-asset-handler" --filter="!./fixtures/interactive-dev-tests"' + runs-on: ${{ matrix.os }} steps: - name: Checkout Repo @@ -156,73 +134,21 @@ jobs: turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} node-version: ${{ matrix.node_version }} - - name: Run tests - if: steps.changes.outputs.everything_but_markdown == 'true' - run: pnpm run test:ci --concurrency 1 ${{ matrix.filter }} --log-order=stream + - name: Bump package versions + run: node .github/changeset-version.js env: - TEST_CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} - TEST_CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} - NODE_OPTIONS: "--max_old_space_size=8192" - WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/ - TEST_REPORT_PATH: ${{ runner.temp }}/test-report/index.html - CI_OS: ${{ matrix.os_name }} - - - name: Upload turbo logs - if: always() - uses: actions/upload-artifact@v4 - with: - name: turbo-runs-${{ matrix.os }}-${{ matrix.node }} - path: .turbo/runs - - test: - timeout-minutes: 30 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.filter }}-${{ matrix.node_version }}-test - cancel-in-progress: true - - name: ${{ format('Tests ({0})', matrix.os_name) }} - strategy: - fail-fast: false - matrix: - include: - - os: macos-latest - os_name: macOS - node_version: 20.19.1 - filter: '--filter="./packages/*" --filter="./fixtures/*" --filter="./packages/vite-plugin-cloudflare/playground" --summarize' - runs-on: ${{ matrix.os }} - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: dorny/paths-filter@v3 - id: changes - with: - filters: | - everything_but_markdown: - - '!**/*.md' - - - name: Install Dependencies - if: steps.changes.outputs.everything_but_markdown == 'true' - uses: ./.github/actions/install-dependencies - with: - turbo-api: ${{ secrets.TURBO_API }} - turbo-team: ${{ secrets.TURBO_TEAM }} - turbo-token: ${{ secrets.TURBO_TOKEN }} - turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }} - node-version: ${{ matrix.node_version }} + GITHUB_TOKEN: ${{ github.token }} - name: Run tests if: steps.changes.outputs.everything_but_markdown == 'true' - run: pnpm run test:ci --concurrency 1 ${{ matrix.filter }} + run: pnpm run test:ci --concurrency 1 ${{ matrix.filter }} --log-order=stream env: TEST_CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} TEST_CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} NODE_OPTIONS: "--max_old_space_size=8192" WRANGLER_LOG_PATH: ${{ runner.temp }}/wrangler-debug-logs/ TEST_REPORT_PATH: ${{ runner.temp }}/test-report/index.html - CI_OS: ${{ matrix.os_name }} + CI_OS: ${{ matrix.description }} - name: Upload turbo logs if: always() diff --git a/fixtures/interactive-dev-tests/package.json b/fixtures/interactive-dev-tests/package.json index e59457630e62..d48fa99c9f10 100644 --- a/fixtures/interactive-dev-tests/package.json +++ b/fixtures/interactive-dev-tests/package.json @@ -12,7 +12,7 @@ "vitest": "catalog:default" }, "optionalDependencies": { - "@cdktf/node-pty-prebuilt-multiarch": "0.10.1-pre.11" + "@cdktf/node-pty-prebuilt-multiarch": "0.10.2" }, "volta": { "extends": "../../package.json" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 87d83266b633..94e853ecea34 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -370,8 +370,8 @@ importers: fixtures/interactive-dev-tests: optionalDependencies: '@cdktf/node-pty-prebuilt-multiarch': - specifier: 0.10.1-pre.11 - version: 0.10.1-pre.11 + specifier: 0.10.2 + version: 0.10.2 devDependencies: '@fixture/shared': specifier: workspace:* @@ -3950,8 +3950,8 @@ packages: '@bundled-es-modules/tough-cookie@0.1.6': resolution: {integrity: sha512-dvMHbL464C0zI+Yqxbz6kZ5TOEp7GLW+pry/RWndAR8MJQAXZ2rPmIs8tziTZjeIyhSNZgZbCePtfSbdWqStJw==} - '@cdktf/node-pty-prebuilt-multiarch@0.10.1-pre.11': - resolution: {integrity: sha512-qvga/nzEtdCJMu/6jJfDqpzbRejvXtNhWFnbubfuYyN5nMNORNXX+POT4j+mQSDQar5bIQ1a812szw/zr47cfw==} + '@cdktf/node-pty-prebuilt-multiarch@0.10.2': + resolution: {integrity: sha512-Bpb0v9bzejJUAGmn8HfDFH6pYxFVHokiWV4mHvTao2XoYcEvETFVrniYIXlIg0e4yLlKB/U/z5WsC5PBsi3xEQ==} '@changesets/apply-release-plan@7.0.9': resolution: {integrity: sha512-xB1shQP6WhflnAN+rV8eJ7j4oBgka/K62+pHuEv6jmUtSqlx2ZvJSnCGzyNfkiQmSfVsqXoI3pbAuyVpTbsKzA==} @@ -10428,6 +10428,9 @@ packages: napi-build-utils@1.0.2: resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} + napi-build-utils@2.0.0: + resolution: {integrity: sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==} + natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -11197,6 +11200,11 @@ packages: engines: {node: '>=10'} hasBin: true + prebuild-install@7.1.3: + resolution: {integrity: sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==} + engines: {node: '>=10'} + hasBin: true + prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -13831,10 +13839,10 @@ snapshots: '@types/tough-cookie': 4.0.5 tough-cookie: 4.1.4 - '@cdktf/node-pty-prebuilt-multiarch@0.10.1-pre.11': + '@cdktf/node-pty-prebuilt-multiarch@0.10.2': dependencies: nan: 2.18.0 - prebuild-install: 7.1.2 + prebuild-install: 7.1.3 optional: true '@changesets/apply-release-plan@7.0.9': @@ -13851,7 +13859,7 @@ snapshots: outdent: 0.5.0 prettier: 2.7.1 resolve-from: 5.0.0 - semver: 7.7.1 + semver: 7.7.2 '@changesets/assemble-release-plan@6.0.6': dependencies: @@ -13860,7 +13868,7 @@ snapshots: '@changesets/should-skip-package': 0.1.2 '@changesets/types': 6.1.0 '@manypkg/get-packages': 1.1.3 - semver: 7.7.1 + semver: 7.7.2 '@changesets/changelog-git@0.2.1': dependencies: @@ -13924,7 +13932,7 @@ snapshots: '@changesets/types': 6.1.0 '@manypkg/get-packages': 1.1.3 picocolors: 1.1.1 - semver: 7.7.1 + semver: 7.7.2 '@changesets/get-github-info@0.6.0(encoding@0.1.13)': dependencies: @@ -15211,7 +15219,7 @@ snapshots: nopt: 5.0.0 npmlog: 5.0.1 rimraf: 3.0.2 - semver: 7.7.1 + semver: 7.7.2 tar: 6.2.1 transitivePeerDependencies: - encoding @@ -20882,6 +20890,9 @@ snapshots: napi-build-utils@1.0.2: {} + napi-build-utils@2.0.0: + optional: true + natural-compare@1.4.0: {} negotiator@0.6.3: {} @@ -21120,7 +21131,7 @@ snapshots: ky: 1.7.5 registry-auth-token: 5.0.2 registry-url: 6.0.1 - semver: 7.7.1 + semver: 7.7.2 package-manager-detector@0.2.9: {} @@ -21588,6 +21599,22 @@ snapshots: tar-fs: 2.1.1 tunnel-agent: 0.6.0 + prebuild-install@7.1.3: + dependencies: + detect-libc: 2.0.3 + expand-template: 2.0.3 + github-from-package: 0.0.0 + minimist: 1.2.6 + mkdirp-classic: 0.5.3 + napi-build-utils: 2.0.0 + node-abi: 3.62.0 + pump: 3.0.0 + rc: 1.2.8 + simple-get: 4.0.1 + tar-fs: 2.1.1 + tunnel-agent: 0.6.0 + optional: true + prelude-ls@1.2.1: {} prettier-linter-helpers@1.0.0: @@ -21866,7 +21893,7 @@ snapshots: readable-stream@3.6.0: dependencies: inherits: 2.0.4 - string_decoder: 1.1.1 + string_decoder: 1.3.0 util-deprecate: 1.0.2 readable-stream@4.7.0: @@ -22111,7 +22138,7 @@ snapshots: sembear@0.7.0: dependencies: - semver: 7.7.1 + semver: 7.7.2 semiver@1.1.0: {} diff --git a/tools/deployments/__tests__/validate-pr-description.test.ts b/tools/deployments/__tests__/validate-pr-description.test.ts index f83daae70993..9ddb9cac0e05 100644 --- a/tools/deployments/__tests__/validate-pr-description.test.ts +++ b/tools/deployments/__tests__/validate-pr-description.test.ts @@ -12,37 +12,38 @@ describe("validateDescription()", () => { expect( validateDescription( "", - `## What this PR solves / how to test + `Fixes #[insert GH or internal issue link(s)]. -Fixes #[insert GH or internal issue number(s)]. +_Describe your change..._ -## Author has addressed the following +--- + + - Tests - - [ ] TODO (before merge) - [ ] Tests included - [ ] Tests not necessary because: -- E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately) - - [ ] I don't know - - [ ] Required - - [ ] Not required because: - Public documentation - - [x] TODO (before merge) - [ ] Cloudflare docs PR(s): - [ ] Documentation not necessary because: - Wrangler V3 Backport - - [x] TODO (before merge) - - [ ] Wrangler PR: https://github.com/cloudflare/workers-sdk/pull/123 - - [ ] Not necessary because: + - [ ] Wrangler PR: + - [ ] Not necessary because: + + `, "[]", "[]" ) ).toMatchInlineSnapshot(` [ - "All TODO checkboxes in your PR description must be unchecked before merging", - "Your PR must include tests, or provide justification for why no tests are required", - "Your PR must run E2E tests, or provide justification for why running them is not required", + "Your PR must include tests, or provide justification for why no tests are required in the PR description and apply the \`no-tests\` label", "Your PR doesn't include a changeset. Either include one (following the instructions in CONTRIBUTING.md) or add the 'no-changeset-required' label to bypass this check. Most PRs should have a changeset, so only bypass this check if you're sure that your change doesn't need one: see https://github.com/cloudflare/workers-sdk/blob/main/CONTRIBUTING.md#changesets for more details.", "Your PR must include documentation (in the form of a link to a Cloudflare Docs issue or PR), or provide justification for why no documentation is required", "Your PR must include a v3 back-port (in the form of a link to a workers-sdk PR), or provide justification for why this is not required. A PR should automatically be opened up for you if this is required - this is only needed for patch changes to Wrangler (excluding experimental features labelled as \`patch\`).", @@ -54,61 +55,66 @@ Fixes #[insert GH or internal issue number(s)]. expect( validateDescription( "", - `## What this PR solves / how to test + `Fixes #[insert GH or internal issue link(s)]. -Fixes #[insert GH or internal issue number(s)]. +_Describe your change..._ -## Author has addressed the following +--- + + - Tests - - [ ] TODO (before merge) - - [x] Tests included - - [ ] Tests not necessary because: -- E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately) - - [ ] I don't know - - [ ] Required - - [x] Not required because: test + - [ ] Tests included + - [x] Tests not necessary because: test - Public documentation - - [ ] TODO (before merge) - [ ] Cloudflare docs PR(s): - [x] Documentation not necessary because: test - Wrangler V3 Backport - - [ ] TODO (before merge) - - [ ] Wrangler PR: https://github.com/cloudflare/workers-sdk/pull/123 + - [ ] Wrangler PR: - [x] Not necessary because: test -`, + +`, '["no-changeset-required"]', "[]" ) - ).toHaveLength(0); + ).toMatchInlineSnapshot(`[]`); }); it("should accept everything included", () => { expect( validateDescription( "", - `## What this PR solves / how to test + `Fixes #[insert GH or internal issue link(s)]. -Fixes [AA-000](https://jira.cfdata.org/browse/AA-000). +_Describe your change..._ -## Author has addressed the following +--- + + - Tests - - [ ] TODO (before merge) - [x] Tests included - [ ] Tests not necessary because: -- E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately) - - [ ] I don't know - - [ ] Required - - [x] Not required because: test - Public documentation - - [ ] TODO (before merge) - - [x] Cloudflare docs PR(s): https://github.com/cloudflare/cloudflare-docs/pull/123 - - [ ] Documentation not necessary because: + - [x] Cloudflare docs PR(s): https://github.com/cloudflare/cloudflare-docs/pull/100 + - [ ] Documentation not necessary because: test - Wrangler V3 Backport - - [ ] TODO (before merge) - - [x] Wrangler PR: https://github.com/cloudflare/workers-sdk/pull/123 - - [ ] Not necessary because: + - [x] Wrangler PR: https://github.com/cloudflare/workers-sdk/pull/100 + - [ ] Not necessary because: test + + `, "[]", '[".changeset/hello-world.md"]' @@ -149,147 +155,6 @@ Fixes [AA-000](https://jira.cfdata.org/browse/AA-000). ).toHaveLength(0); }); - it("should not accept e2e unknown", () => { - expect( - validateDescription( - "", - `## What this PR solves / how to test - -Fixes [AA-000](https://jira.cfdata.org/browse/AA-000). - -## Author has addressed the following - -- Tests - - [ ] TODO (before merge) - - [x] Tests included - - [ ] Tests not necessary because: -- E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately) - - [x] I don't know - - [ ] Required - - [ ] Not required because: test -- Public documentation - - [ ] TODO (before merge) - - [x] Cloudflare docs PR(s): https://github.com/cloudflare/cloudflare-docs/pull/123 - - [ ] Documentation not necessary because: -- Wrangler V3 Backport - - [ ] TODO (before merge) - - [ ] Wrangler PR: https://github.com/cloudflare/workers-sdk/pull/123 - - [x] Not necessary because: test -`, - "[]", - '[".changeset/hello-world.md"]' - ) - ).toMatchInlineSnapshot(` - [ - "Your PR cannot be merged with a status of \`I don't know\` for e2e tests. When your PR is reviewed by the Wrangler team they'll decide whether e2e tests need to be run", - "Your PR must run E2E tests, or provide justification for why running them is not required", - ] - `); - }); - - it("should not accept e2e without e2e label", () => { - expect( - validateDescription( - "", - `## What this PR solves / how to test - -Fixes [AA-000](https://jira.cfdata.org/browse/AA-000). - -## Author has addressed the following - -- Tests - - [ ] TODO (before merge) - - [x] Tests included - - [ ] Tests not necessary because: -- E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately) - - [ ] I don't know - - [x] Required - - [ ] Not required because: test -- Public documentation - - [ ] TODO (before merge) - - [x] Cloudflare docs PR(s): https://github.com/cloudflare/cloudflare-docs/pull/123 - - [ ] Documentation not necessary because: -- Wrangler V3 Backport - - [ ] TODO (before merge) - - [ ] Wrangler PR: https://github.com/cloudflare/workers-sdk/pull/123 - - [x] Not necessary because: test -`, - "[]", - '[".changeset/hello-world.md"]' - ) - ).toMatchInlineSnapshot(` - [ - "Since your PR requires E2E tests to be run, it needs to have the \`e2e\` label applied on GitHub", - ] - `); - }); - - it("should accept e2e with e2e label", () => { - expect( - validateDescription( - "", - `## What this PR solves / how to test - -Fixes [AA-000](https://jira.cfdata.org/browse/AA-000). - -## Author has addressed the following - -- Tests - - [ ] TODO (before merge) - - [x] Tests included - - [ ] Tests not necessary because: -- E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately) - - [ ] I don't know - - [x] Required - - [ ] Not required because: test -- Public documentation - - [ ] TODO (before merge) - - [x] Cloudflare docs PR(s): https://github.com/cloudflare/cloudflare-docs/pull/123 - - [ ] Documentation not necessary because: -- Wrangler V3 Backport - - [ ] TODO (before merge) - - [ ] Wrangler PR: https://github.com/cloudflare/workers-sdk/pull/123 - - [x] Not necessary because: test -`, - '["e2e"]', - '[".changeset/hello-world.md"]' - ) - ).toHaveLength(0); - }); - - it("should accept e2e with e2e label - uppercase X", () => { - expect( - validateDescription( - "", - `## What this PR solves / how to test - -Fixes [AA-000](https://jira.cfdata.org/browse/AA-000). - -## Author has addressed the following - -- Tests - - [ ] TODO (before merge) - - [X] Tests included - - [ ] Tests not necessary because: -- E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately) - - [ ] I don't know - - [X] Required - - [ ] Not required because: test -- Public documentation - - [ ] TODO (before merge) - - [X] Cloudflare docs PR(s): https://github.com/cloudflare/cloudflare-docs/pull/123 - - [ ] Documentation not necessary because: -- Wrangler V3 Backport - - [ ] TODO (before merge) - - [ ] Wrangler PR: https://github.com/cloudflare/workers-sdk/pull/123 - - [x] Not necessary because: test -`, - '["e2e"]', - '[".changeset/hello-world.md"]' - ) - ).toHaveLength(0); - }); - it("should not accept v3 back port none", () => { expect( validateDescription( diff --git a/tools/deployments/validate-pr-description.ts b/tools/deployments/validate-pr-description.ts index 9391e245f93d..9daf07f4659f 100644 --- a/tools/deployments/validate-pr-description.ts +++ b/tools/deployments/validate-pr-description.ts @@ -41,12 +41,6 @@ export function validateDescription( return []; } - if (/- \[x\] TODO \(before merge\)/i.test(body)) { - errors.push( - "All TODO checkboxes in your PR description must be unchecked before merging" - ); - } - if ( !( /- \[x\] Tests included/i.test(body) || @@ -54,30 +48,7 @@ export function validateDescription( ) ) { errors.push( - "Your PR must include tests, or provide justification for why no tests are required" - ); - } - - if (/- \[x\] I don't know/i.test(body)) { - errors.push( - "Your PR cannot be merged with a status of `I don't know` for e2e tests. When your PR is reviewed by the Wrangler team they'll decide whether e2e tests need to be run" - ); - } - - if ( - !( - /- \[x\] Required/i.test(body) || - /- \[x\] Not required because: .+/i.test(body) - ) - ) { - errors.push( - "Your PR must run E2E tests, or provide justification for why running them is not required" - ); - } - - if (/- \[x\] Required/i.test(body) && !parsedLabels.includes("e2e")) { - errors.push( - "Since your PR requires E2E tests to be run, it needs to have the `e2e` label applied on GitHub" + "Your PR must include tests, or provide justification for why no tests are required in the PR description and apply the `no-tests` label" ); }