Commit graph

378 commits

Author SHA1 Message Date
Steven
f1f5734e91
chore: pin to npm@9.6.7 (#51044)
This might fix the npm publish error

```
Error: Command failed with exit code 254 (Unknown system error -254): npm publish /home/runner/work/next.js/next.js/packages/next --access public --tag canary
```


https://github.com/vercel/next.js/actions/runs/5219901558/jobs/9422546478#step:11:9353
2023-06-09 07:58:32 -07:00
JJ Kasper
1be0bdd081
Add max job timeout for build workflow (#50998)
Ensures we don't allow jobs like this one back up the queue indefinitely https://github.com/vercel/next.js/actions/runs/5214838162/jobs/9411777984?pr=50904
2023-06-08 20:58:35 +00:00
JJ Kasper
9a3e76377a
Fix windows build check 2023-06-08 07:38:38 -07:00
JJ Kasper
63d5cf1c1d
Fix workflow check 2023-06-08 07:16:31 -07:00
JJ Kasper
23649623d7
Only upload turbopack metrics on cache miss (#50945)
Currently this is uploading every time the job is run even if it's a
cache hit and this step can take over 3 minutes un-necessarily so this
skips it if a cache hit occurred.
2023-06-08 07:07:49 -07:00
OJ Kwon
534414d54e
ci(workflow): enable test trace again (#50817)
### What?

Another attempt to https://github.com/vercel/next.js/pull/50619 and WEB-1150, trying to apply setup guard more throughly.

I still do not know why original PR passed CI but fails to subsequent PRs after merge, but hope this could be a right guard to prevent unexpected failures.
2023-06-08 10:52:49 +00:00
Leah
f24d0cb030
fix rust install being skipped when it shouldn't be (#50946)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-07 20:32:19 -07:00
JJ Kasper
6ef76195a5
Update next-swc handling for PR stats (#50933)
This fixes the wasm swc build being used for PR stats unexpectedly since
pnpm pack wasn't actually including the swc binary. This also adds a
hard error preventing the wasm swc binary from being leveraged in the
future for PR stats.

x-ref:
[vercel/next.js/actions/runs/5193512579/jobs/9364168639](https://github.com/vercel/next.js/actions/runs/5193512579/jobs/9364168639)
x-ref:
https://github.com/vercel/next.js/pull/50853#issuecomment-1579055731

---------

Co-authored-by: Steven <steven@ceriously.com>
2023-06-07 14:31:57 -07:00
Leah
ded54923a0
better rust setup in CI (#50905)
### Description

Set some environment variables that reduce size on disk and make the
build a little faster.

Also, read the toolchain from the `rust-toolchain` file, so it's not
duplicated in every workflow.

Ported over from the `turbo` repo.
2023-06-07 09:53:50 -07:00
OJ Kwon
115f927b9b
ci(workflow): loosen condtions for uploading turbopack bytesize (#50820)
### What?

It turned out the recommendation https://github.com/vercel/next.js/pull/50600/files#r1212902688 is overly strict, even if it's valid build work we skips to upload data and only triggers for the release.  This is an example workflow https://github.com/vercel/next.js/actions/runs/5182537384/jobs/9339461369 that build ran but upload skipped.

We are fine with same bytesize numbers with cache hit actually, and can filter it out in worst cases - so loosening conditions for now.
2023-06-06 18:44:39 +00:00
JJ Kasper
65e996b70f
Optimize cloning for PR stats (#50859)
Follow-up to https://github.com/vercel/next.js/pull/50853 this optimizes
how we clone the branches for generating stats.

Before:
https://github.com/vercel/next.js/actions/runs/5191059058/jobs/9358459062
21min

After:
https://github.com/vercel/next.js/actions/runs/5191282140/jobs/9358934393?pr=50859
11min
2023-06-06 10:17:47 -07:00
JJ Kasper
ea74ad0431
Update PR stats workflow (#50853)
Updates to re-use our build workflow so turbo remote cache is leveraged
and updates re-usable workflow reference to be the same branch instead
of main.
2023-06-06 09:57:09 -07:00
JJ Kasper
43fb7249b6
Add turbo summary artifact for swc builds (#50857)
This adds uploading the turbo run summaries for our publish builds so we
can debug cache misses there easier the same as the new build_reusable
workflow.
2023-06-06 09:06:12 -07:00
JJ Kasper
44d453f77c
Update PR stats next-swc build (#50824)
This is still using the dev build of `next-swc` which uses up more disk
space so adds the free-up disk space step from previous workflow.

x-ref:
https://github.com/vercel/next.js/actions/runs/5183623872/jobs/9341729073?pr=50820
x-ref:
https://github.com/vercel/next.js/actions/runs/5179335311/jobs/9332066554?pr=50615
2023-06-05 22:23:06 -07:00
OJ Kwon
419246c71e
ci(workflow): upload Turbopack bytesize to datadog pipeline (#50600)
### What?

This PR updates existing CI worfklow for building Turbopack (`@next/swc`), and report its bytesize per target triple as additional metrics. It will be included in datadog's pipeline execution traces.

It would be better to track this per-PR, or per-commits but building all native binaries per each commit is too expensive. For now, tracking it when we deploy and actually build new release binaries.
2023-06-05 22:34:16 +00:00
OJ Kwon
38f7c3bd1b
Revert "ci(workflow): enable datadog traces for the tests" (#50815)
Reverts vercel/next.js#50619

Seeing some weird failure supposed to not occur since we never enabled this 

https://github.com/vercel/next.js/actions/runs/5181685987/jobs/9337538270?pr=50600

Investigating after reverting.
2023-06-05 22:13:06 +00:00
OJ Kwon
2b1f0d9351
ci(workflow): enable datadog traces for the tests (#50619)
### What?

This PR attempts to enable datadog trace integrations to the next.js integration tests if env is configured. With this, datadog can observe each test suite's results and detect some meaningful information (i.e flaky) for us.

However, I wasn't able to verify this works with next.js repo since for some reason CI worker does not pick up the api key in the env (https://vercel.slack.com/archives/C04KC8A53T7/p1685597124894539). Still this won't affect existing workflow, and once enabled I can test it over vercel/turbo repo instead.

Partially resolved WEB-1150.
2023-06-05 20:28:22 +00:00
OJ Kwon
18d112fb5c
ci(workflow): allow to trigger native builds manually (#50703)
### What?

This PR allows to trigger subset of build-and-deploy workflow manually via gh actions UI.

### Why?

Turbopack time to time requires to validate its changes against all of the platforms we build. Adding manual workflow allows to test it easier.

It tries to guard release check `isRelease` only if it comes from normal event (non manual dispatch) to avoid accidental publish workflow.
2023-06-02 19:56:10 +00:00
JJ Kasper
38d9d2efee
Ensure swc builds are triggered eagerly (#50632)
Ensures we continue pre-building binaries on merge to canary and ensures
we are testing against the maintenance Node.js version also adds turbo
summarize for all swc builds.
2023-06-01 03:43:09 -07:00
JJ Kasper
fa076a3a69
Fix required check job (#50620)
x-ref:
https://github.com/vercel/next.js/actions/runs/5138467619/attempts/1
2023-05-31 18:38:53 -07:00
JJ Kasper
a89d58af06
Ensure final workflow job always runs (#50589)
Makes sure we either fail or succeed the single required job correctly
2023-05-31 06:51:13 -07:00
JJ Kasper
ecd4ba0836
Update test concurrency (#50588) 2023-05-31 13:15:18 +00:00
JJ Kasper
56f09a56c7
Remove old CI workflow (#50584)
x-ref: https://github.com/vercel/next.js/pull/50436
2023-05-31 11:46:47 +00:00
JJ Kasper
29c2e89bd1
Break up large test suites (#50458)
This breaks up some of our longest running tests which allows more
parallelizing of the tests. This also moves turbopack tests filtering
back to an allow list as it is running a lot of unrelated tests
currently which isn't ideal. We should only be running against tests
that are explicitly testing turbopack e.g. build tests should not be
duplicated in the turbopack group.

```sh
test/integration/css/test/group-1.test.js: 762.655
test/integration/edge-runtime-module-errors/test/index.test.js: 695.309
test/integration/css/test/group-2.test.js: 671.848
test/integration/i18n-support/test/index.test.js: 518.173
test/integration/scss-modules/test/index.test.js: 451.704
test/integration/css-features/test/index.test.js: 417.318
test/integration/css-modules/test/index.test.js: 403.405
test/integration/eslint/test/index.test.js: 381.563
test/integration/500-page/test/index.test.js: 371.134
test/integration/telemetry/test/index.test.js: 367.691
test/development/acceptance-app/ReactRefreshLogBox.test.ts: 335.878
test/integration/create-next-app/templates.test.ts: 334.01
test/integration/scss/test/group-2.test.js: 327.255
test/integration/scss/test/group-1.test.js: 318.574
test/integration/edge-runtime-configurable-guards/test/index.test.js: 313.834
test/e2e/instrumentation-hook/instrumentation-hook.test.ts: 294.618
test/development/acceptance-app/error-recovery.test.ts: 283.355
test/e2e/app-dir/app/vercel-speed-insights.test.ts: 278.242
test/integration/create-next-app/index.test.ts: 272.442
```
2023-05-28 13:59:41 -07:00
JJ Kasper
5d8d18161a
Update env in new workflow 2023-05-27 23:29:08 -07:00
JJ Kasper
105ac170b8
Update workflow cancel handling (#50442)
The built-in cancel handling doesn't have our desired behavior so this
disables it
2023-05-27 22:57:45 -07:00
JJ Kasper
d0c1edd9b0
Update build and test workflow branch 2023-05-27 21:04:05 -07:00
JJ Kasper
a3ab542630
Add new build and test workflow (#50436)
This adds new `build and test` and `build and deploy` workflows in favor
of the existing massive `build, test, and deploy` workflow. Since the
new workflows will use `pull_request_target` this waits to remove the
existing workflow until the new one is tested.

While testing this new workflow flakey behavior in tests have also been
addressed. Along with the new workflow we will also be leveraging new
runners which allow us to run tests against the production binary of
`next-swc` so this avoids slight differences in tests we've seen due to
running against the dev binary.

Furthermore we will have a new flow for allowing workflow runs on PRs
from external forks which will either require a comment be checking a
box approving the run after each change or a label added by the team.

The new flow also no longer relies on `actions/cache` or similar which
have proven to be pretty unreliable.

Tests runs with the new workflow can be seen here
https://github.com/vercel/next.js/actions/runs/5100673508/jobs/9169416949
2023-05-27 21:02:31 -07:00
Tobias Koppers
187d1bff40
remove allowlist, only use denylist, enable newly passing tests (#50325)
### What?

* remove allowlist
* add script to print enabled test cases
* enable test suites that turbopack is newly passing
2023-05-25 15:37:28 +02:00
Tobias Koppers
06f505c78b
Parallelize Turbopack CI tests (#50292)
### What?

Parallel jobs

### Why?

Timeouts otherwise


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-05-25 07:46:02 +00:00
Tobias Koppers
bf7a556204
enable more test cases for turbopack (#50154)
### What?

Enable more test cases to run with turbopack

### Why?

These test suites are passing and are not flaky.
2023-05-23 20:21:56 +02:00
Jiachi Liu
ad79fed1a2
ci: update github token (#50216)
[slack-thread](https://vercel.slack.com/archives/C01LN7C5QR5/p1684849596794369?thread_ts=1684428058.764599&cid=C01LN7C5QR5)
2023-05-23 07:29:58 -07:00
OJ Kwon
2fc0160a26
test(turbopack): run next.js integration tests with denylist (#50172)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation or adding/fixing Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md



## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change



### Why?

### How?

Closes NEXT-
Fixes #

-->

### What?

WEB-1086.

This PR flips the way running next.js integration test with Turbopack,
instead of using allowlist to run selectively enabled test now uses
denylists. The immediate effect is now any new test being added (as a
new file) will be executed with Turbopack by default, and should be
manually excluded if it fails.

Still, the number of tests we run remains same.
2023-05-23 10:55:33 +02:00
OJ Kwon
dd85daaf4e
test(turbopack): script to sync latest test lists (#50008)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation or adding/fixing Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md



## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

This PR adjusts manifests for the next.js test with Turbopack, as I
found upstream test keep changing and need to sync its latests state
into the manifest.

Manifest is now .js file contains 2 arrays, one for the enabled, and
others for the disabled. Disabled doesn't mean it's always failing
though.
2023-05-19 09:10:29 +02:00
Donny/강동윤
5aaa6ff65e
fix: Disable tracing/release_max_level_off for wasm, too (#49639)
### What?

Along with https://github.com/swc-project/plugins/pull/182, this PR will
allow using trace-level logging for debugging turboapck.

### Why?

Requested by @sokra 

x-ref: https://vercel.slack.com/archives/C03EWR7LGEN/p1683738076476839

### How?

Closes WEB-1035
2023-05-15 16:16:12 +02:00
Donny/강동윤
54ea0d95a0
feat: Allow trace-level logging for non-published release builds (#49564)
### What?

Disable `tracing/release_max_level_info` for non-published release
builds. I modified CI script to strip out logging for published
binaries.

### Why?

x-ref: https://vercel.slack.com/archives/C03EWR7LGEN/p1683621374204959

It's required to print logging for turbopack.

### How?

Closes WEB-1032

---------

Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
2023-05-10 14:50:36 +02:00
Tobias Koppers
f55359ffb6
Avoid skipping the required Test Codemods job (#49589)
A required CI check can't be skipped. Otherwise this leads to kodiak
stalling forever on these PRs:

<img width="515" alt="image"
src="https://github.com/vercel/next.js/assets/1365881/142f0f77-1fe1-445c-bdff-1cf7957ebe3e">
2023-05-10 13:19:39 +02:00
OJ Kwon
0dce75f642
ci(test): enable turbopack test (#49466)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation or adding/fixing Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md



## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change



### Why?

### How?

Closes NEXT-
Fixes #

-->

### What?

closees WEB-1019.

As discussed, this PR enables running a set of next.js integration tests
with turbopack as blocking CI check. The tests listed as `enabled` is
considered as stable, that should not fail in any case except upstream
test flakyness.

Current approach is simple as we have only small set of tests and does
not consider it becomes a bottleneck. Adding a test under
https://github.com/vercel/next.js/pull/49466/files#diff-fdc68d6039dbe36607cda253b318cd3598a09a94ccb8994f3695aa1d9e1e404bR2
will makes run with turbopack in the CI. in the future, I'll revise test
suite itself so runner, or test case can mark & execute test with
existing test group / scheduling.
2023-05-09 10:46:54 -07:00
JJ Kasper
7a1bc235f5
Update start release workflow inputs (#49492)
Uses the choice input type instead of requiring manually typing the
values.
2023-05-08 17:26:33 -07:00
Steven
b3afc46e1c
fix: npm publish provenance permissions (#48757)
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2023-04-24 14:08:55 +00:00
Tim Neutkens
e631ab9853 Revert "Add npm package provenance on publish (#48693)"
This reverts commit 1c007cee2f.
2023-04-24 11:19:18 +02:00
Steven
1c007cee2f
Add npm package provenance on publish (#48693)
https://github.blog/2023-04-19-introducing-npm-package-provenance/
2023-04-23 02:12:53 +00:00
JJ Kasper
3a83c6b313
Update start release flow (#48634)
x-ref: [slack
thread](https://vercel.slack.com/archives/C01LN7C5QR5/p1681914697254659)
2023-04-20 15:58:36 +00:00
OJ Kwon
9f5463dc9a
build(cargo): move workspaces manifest to top level (#48198)
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation or adding/fixing Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md



## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change


### How?

Closes NEXT-
Fixes #

-->

### What?
This PR changes to the `root` of the cargo workspace to the root of repo
itself, allows next-swc and other rust codebase can use repo root as
workspace root.

### Why?
Currently cargo manifest for the next-swc is not placed under the root
of the repo, which makes invocation to the tool requires to change cwd /
or set cwd. Similarly needs to open editor to the root of the cargo
manifest separately to able to utilize language server kicks in. Moving
manifest to the root consolidates those, so can invoke either cli / or
editor to the same root of the repo.
2023-04-19 18:38:36 +02:00
Tobias Koppers
d4d779145c
refactor shared logic for turbopack-cli (#48307)
### What?

* move some shared runtime logic to turbopack
* use relative imports from internal code when possible
* move react-refresh logic to turbopack
* move benchmark code logic to turobpack

see https://github.com/vercel/turbo/pull/4553

### Why?

We want to have benchmarking again for turbopack PRs
We want to have a standalone turbopack cli (eventually)
We want to avoid duplicating the runtime code

### How?

refactoring, moving code
2023-04-13 14:54:34 +02:00
Tobias Koppers
bd8d7c61f7
Speed up native dev build (#48028)
### What?

More power for the CI to build the native binary for testing

### Why?

Waiting 1 hour for the tests is just too slow

### How?

More Cores
2023-04-06 18:50:27 +02:00
Tobias Koppers
9b0af04649
update turbopack (#48006)
see #47994
2023-04-06 09:50:04 +00:00
Tobias Koppers
e643d52eb3
Run bench tests as part of CI (#47849)
### What?

enables the benchmark tests from turbopack again

### Why?

It tests common scenarios like HMR

fixes WEB-792

---------

Co-authored-by: Alex Kirszenberg <alex.kirszenberg@vercel.com>
2023-04-05 14:54:08 +00:00
JJ Kasper
29ed52b01c
Add merge_group actions trigger 2023-04-04 20:52:39 -07:00
JJ Kasper
c05514079b
Ensure GH actions tests run for trunk branches (#47883)
We need to run for all branches for trunk to test correctly
2023-04-03 16:45:55 -07:00