Commit graph

625 commits

Author SHA1 Message Date
JJ Kasper
1033a03d86
Update needs for build and deploy (#51731)
These don't need to wait for the build step so we can remove the "needs"
step from them to allow them to start earlier.
2023-06-23 17:14:22 -07:00
Delba de Oliveira
bb38fe5f08
[Docs] Update link validator: use checks, fail on PR from forked repo (#51706) 2023-06-23 14:39:29 +00:00
Delba de Oliveira
82abde8dd9
Revert "[Docs] Fix validator action breaking when PRs originate from … (#51674)
Nvm, it doesn't work.
2023-06-22 19:50:14 +00:00
Delba de Oliveira
487f5d6b6f
[Docs] Fix validator action breaking when PRs originate from forks (#51668) 2023-06-22 19:22:29 +00:00
Delba de Oliveira
0d7412ccc9
Move the Next.js team back to github codeowners (#51657)
Bring back the previous setting so specific team members get tagged on all PRs.
2023-06-22 17:24:09 +00:00
Alex Kirszenberg
c6313606c9
Next Build Turbo POC (2) (#51546)
Another attempt at getting https://github.com/vercel/next.js/pull/49942 in.

This time, the mold install step is gated to Linux.
2023-06-22 08:03:44 +00:00
Delba de Oliveira
a43b9ed601
[Docs] Update broken link validator (#51586)
- Add some basic error handling to the link validator action.
- Avoid unnecessarily creating a new bot comment when the validation is successful.
- Only scan .mdx files modified in the current PR for broken links.
2023-06-21 15:31:20 +00:00
Tobias Koppers
36a7aff6d6
use env var to switch next.js to turbopack mode (#51353)
### What?

this forces all tests to use turbopack independent of the way they invoke next dev

### Why?

some tests were not running turbopack

fixes WEB-1187
2023-06-21 13:52:14 +00:00
Delba de Oliveira
20047fcdbd
Migrate validate links script from next-site and setup GitHub action (#51365)
This PR migrates and adapts the [validate docs links script from `next-site`](https://github.com/vercel/front/pull/23185). This script is triggered by a GitHub action whenever a file in the `/docs` folder is updated. If broken links are found in the docs, the check fails and we post a comment on the PR with a list of broken links.

Co-authored-by: Michael Novotny <446260+manovotny@users.noreply.github.com>
2023-06-20 13:19:06 +00:00
JJ Kasper
056ab7918f
Revert "Fix pnpm ERR_INVALID_THIS on Node 20" (#51539)
Reverts vercel/next.js#51406

This pnpm bump seems to be causing lockfile issues with the react
versions which causes context issues since we need to share the same
react version in the monorepo.
2023-06-19 23:38:15 -07:00
JJ Kasper
41ce805de5
Revert "Next Build Turbo POC (#49942)" (#51538)
This reverts commit 7d0bdab83e.

This is failing all builds blocking releases so this reverts it for now
to allow further investigation async.
2023-06-19 21:54:04 -07:00
Tobias Koppers
4cc5715848
Fix native build (#51522)
CI runs with root, there is no sudo
2023-06-19 21:32:08 +02:00
Alex Kirszenberg
7d0bdab83e
Next Build Turbo POC (#49942)
This contains the original POC for `next build --turbo`. The implementation is _just enough_ to get pages building, and doesn't support the app router yet.

I'll write more details here on the implementation and what the next steps are next week.

Necessary changes on the Turbo side: https://github.com/vercel/turbo/pull/4998
2023-06-19 14:36:05 +00:00
Nick McCurdy
1602c2af25
Fix pnpm ERR_INVALID_THIS on Node 20 (#51406)
### What?

Fixes pnpm/pnpm#6424

### Why?

So users of Node 20 can contribute to Next.js

### How?

Upgrades pnpm with back compatibility to patch `ERR_INVALID_THIS` error.
If Node 14 support isn't necessary, I'd recommend upgrading to pnpm 8
for continued feature support and committing the lockfile.

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-16 05:37:11 -07:00
OJ Kwon
d6952989a8
ci(workflow): upload test trace for deploy e2e (#51389)
### What?

WEB-1193.

context: https://vercel.slack.com/archives/C04DUD7EB1B/p1686873054726149

we want to observe flakyness over deploy e2e tests.
2023-06-16 12:14:43 +00:00
JJ Kasper
bdcca0ccff
Fix CSS deploy id case (#51325)
x-ref: [slack
thread](https://vercel.slack.com/archives/C04MEB9L9RQ/p1686787663510239?thread_ts=1686770561.895939&cid=C04MEB9L9RQ)
2023-06-14 20:28:18 -07:00
JJ Kasper
b4350466c7
Update e2e deploy tests to continue (#51321)
Instead of temporarily disabling flakey or unpatched tests in deploy
mode this continues to run all tests and see all failures at once.

x-ref:
https://github.com/vercel/next.js/actions/runs/5272454654/jobs/9536161644
2023-06-14 17:00:28 -07:00
JJ Kasper
323e335b54
Ensure swc is copied for release stats (#51315)
x-ref:
https://github.com/vercel/next.js/actions/runs/5266469399/jobs/9520655185
2023-06-14 14:48:20 -07:00
JJ Kasper
3ec70a26d3
Skip cargo bench job on release (#51311)
This fails when run during a release since the new version isn't
published yet

x-ref:
https://github.com/vercel/next.js/actions/runs/5266469610/jobs/9520466217
2023-06-14 14:44:23 -07:00
JJ Kasper
99bdad4274
fix trigger release step 2023-06-13 23:45:54 -07:00
JJ Kasper
6dcc4fbc23
Increase remote cache timeout for swc builds (#51270)
These occasionally timeout and start building even when they don't need
to so this increases them a bit from the default.
2023-06-13 21:31:40 -07:00
Delba de Oliveira
3d41ccb916
Update codeowners (#51250)
Tweak code owners after some testing and feedback. 

- Move the Next.js team up to be optional global code owners (so that everyone can review but are not tagged for review). Global individuals should still be tagged if there are no specific `.vercel.approvers` files in subdirectories.
- Adds @vercel/devex to image files so there's coverage on those files for the docs
- Target specific folder and files for Styfle to get notified
- Deletes some rules in the old GitHub codeowners
2023-06-13 17:47:12 +00:00
OJ Kwon
bfbfa872fe
ci(workflow): skip test trace upload when test skips (#51190)
<!-- 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

- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating 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?

Attempt to fix workflow to skip trace upload if test skips.
2023-06-13 08:06:15 -07:00
Delba de Oliveira
e048f4ef03
[Docs] Recommend prettier-fix in PR template and contribution guide (#51237)
Recommend running `prettier-fix` before opening docs PRs to fix formatting issues. I've found that `lint-fix` is currently not fixing formatting issues. Related: https://vercel.slack.com/archives/C03S9JCH2Q5/p1686647582580629
2023-06-13 14:54:06 +00:00
OJ Kwon
bcb63f3250
ci(workflow): enable test trace upload (#51107)
### What?

WEB-1150. 

This PR is an attempt to upload next.js's test results into datadog test trace to track its status. 

Originally it tried to use automatic trace injection (dd-trace/ci/init). However, due to some of custom environments / setup we use it was not compatible out of the box. Instead, this PR injects a new test reportert to generate junit report, then upload it at once at the end of the testing pipeline.

The reporter is configured to run when necessary variables set, local run should not be affected. 

One thing to note is this report will not count retry results, as it'll create duplicated test entry with multiple results since we runts jest per individual test. This'll allow to detect flaky test easier, but also it means we'll get bit of skewed test results compare to the real world as first failure will be accounted as test fail immediately.
2023-06-12 17:14:13 +00:00
Tobias Koppers
6b0a6f0c25
add turbopack integration tests to CI (#50904)
### What?

* enable turbopack tests in new CI
* split pre-build step into native and JS builds to allow to start
native tests faster
* update swc_core to sync with turbo
* update turbopack

### Why?

Running our test suite is still important as long we don't have the full
integration test suite enabled.

### Turbopack updates

* https://github.com/vercel/turbo/pull/5215 <!-- OJ Kwon - ci(workflow):
upload benchmark results to datadog -->
* https://github.com/vercel/turbo/pull/5239 <!-- OJ Kwon -
fix(swc_plugin): use shared runtime -->
* https://github.com/vercel/turbo/pull/3090 <!-- CHEN Yuan - Docs: prior
to run testcases, add guides to install dependencies for testcases. -->
* https://github.com/vercel/turbo/pull/5264 <!-- Tobias Koppers - update
test runner -->

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2023-06-12 07:47:43 -07:00
OJ Kwon
6ba6762d75
ci(workflow): consolidate bytesize upload workflow (#51110)
### What?

context: https://github.com/vercel/next.js/actions/runs/5231928600/jobs/9446394605#step:16:33

For some reason, installing datadog cli on some action runner (Windows) is unexpectedly slow: while other platform takes ~30s, windows only takes more than > 7m.

PR updates workflow logic to consolidate artifacts, and then send metrics at once on a separate ubuntu workflow.
2023-06-11 04:42:22 +00:00
JJ Kasper
d8763ca347
Fix getting last stable release stats (#51106)
Small fix ensuring we use the correct repo for getting the last stable
tag
2023-06-10 16:00:10 -07:00
JJ Kasper
efaddcda60
Fix race condition with publish (#51105)
We publish multiple packages in parallel which can cause issues with the
prepublish only script running as turbo clearing/restoring dist caches
can causing files to be missing if a publish is in progress. We also
don't need to run these as all packages are already built prior to
publishing. This also includes fixes for release stats.
2023-06-10 14:05:27 -07:00
OJ Kwon
9bc73dbc1a
ci(workflow): generate run summary for all build targets (#51057)
### What?

I noticed some deploy job fails at

https://github.com/vercel/next.js/actions/runs/5222848985/jobs/9428961695#step:15:20

when there's no summary exists by missing necessary flags for the few platform targets.
2023-06-10 00:27:44 +00:00
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
45db459fe1
Add corepack env for linkPackages (#50973)
x-ref:
https://github.com/vercel/next.js/pull/50933#discussion_r1222163786
2023-06-08 07:46:19 -07: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
Delba de Oliveira
8c2e5bd072
Update codeowners to use Vercel Spaces (#50841)
Move as much of codeowners as possible to use Vercel Spaces. 

1. Makes `@timneutkens @ijjk @shuding @huozhi @feedthejim` global owners
2. Make the `@vercel/next-js` team _optional_ owners of **/docs**,
**/errors**, and **/contributing**, makes team owners of a few packages
as per old config.
3. Make `@vercel/devex` (docs and devrel) owners of **/docs**,
**/errors**, and **/contributing**
4. Make `@vercel/devrel` (devrel only) owners of **/examples**
5. Make `@vercel/web-tooling` owners of specific files and folders (as
per old config)

Leaves @styfle as owner of **image** files on the old config since this
pattern `/**/*image*/** ` can't be used with Vercel Spaces.

Note: We cannot add * or / at the end of files.
[Docs](https://spaces-docs.vercel.sh/docs/code-owners#:~:text=Code%20Owners%20files%20are%20meant%20to%20encourage%20distributed%20ownership%20definitions%20across%20a%20codebase.)
2023-06-08 12:02:18 +02:00
Delba de Oliveira
f6ff2ef98e
[Next Docs] Update Git Workflow (#50579)
Update our git workflow in preparation for open-sourcing the content of
the docs ([linear
task](https://linear.app/vercel/issue/DX-1579/set-up-github-workflow)).

**Templates:**
- [x] Update docs issue template to encourage contributions
- [x] Update PR template to include link to new contribution guide 

**Code Owners / Reviewers:** 
- https://github.com/vercel/next.js/pull/50841

**Labels:** 
- [x] Add DevEx team to labeler.json so PRs get the "created by: DevEx
team"

**Other:** 
- [x] Remove docs manifest from CI checks as we no longer have one (keep
the manifest for errors as they live under `/pages`)
- [x] Add `unifiedjs.vscode-mdx` to the vscode extension list
2023-06-08 12:01:55 +02: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
Kiko Beats
ecf59365ac
add auto labeling for edge team (#50842) 2023-06-06 14:34:41 +00: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