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
2 changes: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ updates:
- "miniflare"
- "dependencies"
- "skip-pr-description-validation"
- "e2e"
- "every-os"
allow:
- dependency-name: "workerd"
- dependency-name: "@cloudflare/workers-types"
7 changes: 0 additions & 7 deletions .github/pull_request_template.md
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link
Member

Choose a reason for hiding this comment

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

did you mean to remove this checkbox? this change doesn't seem intentional to me? 🤔

(test being the only checkbox without the not-necessary checkbox)
Screenshot 2025-06-25 at 17 12 50

Copy link
Member

Choose a reason for hiding this comment

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

Samuel mentioned in the description that Changing the tests checkbox to only have the option to mark "Tests included". This can be bypassed with the no-tests label.

But I wonder if it's better to keep the no test checkbox as we lost the context on why if we rely on the label.

Copy link
Member

Choose a reason for hiding this comment

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

I see... yeah but the way I would expect it, similarly to how V3 backporting works, is that we do have the check and also the label 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The description had my motivation here: "hopefully removing the visible option for not including tests will encourage people to include tests", but happy to revert this. My thinking was that basically all PRs should have tests, and it should be fairly hidden option to not add tests. It'll also be much more obvious for us when reviewing that a PR has the no-tests label, which should make it easier to spot if something has been inadvertently marked as not requiring tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've reverted this change

Copy link
Member

Choose a reason for hiding this comment

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

It'll also be much more obvious for us when reviewing that a PR has the no-tests label, which should make it easier to spot if something has been inadvertently marked as not requiring tests.

External contributors can't add the label though 😕

Copy link
Member

Choose a reason for hiding this comment

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

My thinking was that basically all PRs should have tests

I agree if we're talking about actual code changes, but often there other types of changes that don't require tests, such as code comments, changeset changes, templates changes, infra changes, md changes (which we do have a comment about in the pr template anyways) 🤔

- 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): <!--e.g. <https://github.com/cloudflare/cloudflare-docs/pull/>...-->
- [ ] Documentation not necessary because:
- Wrangler V3 Backport
- [ ] TODO (before merge)
- [ ] Wrangler PR: <!--e.g. <https://github.com/cloudflare/workers-sdk/pull/>...-->
- [ ] Not necessary because: <!--e.g. not a patch change, not a Wrangler change...-->

Expand Down
87 changes: 18 additions & 69 deletions .github/workflows/c3-e2e.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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'
Expand Down
82 changes: 43 additions & 39 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,127 +1,131 @@
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 }}
turbo-api: ${{ secrets.TURBO_API }}
turbo-team: ${{ secrets.TURBO_TEAM }}
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 }}
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
with:
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 }}
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: 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:
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 }}

- 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
with:
name: turbo-runs-${{ matrix.os }}-${{ matrix.node }}
path: .turbo/runs

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
3 changes: 2 additions & 1 deletion .github/workflows/open-v3-maintenance-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: v3 Maintenance

on:
pull_request:
branches: main
branches:
- main
types: [synchronize, opened, reopened, labeled, unlabeled]
paths:
- ".changeset/**.md"
Expand Down
Loading
Loading