Skip to content

Commit 966cf8f

Browse files
authored
Merge branch 'canary' into add-example
2 parents 60be150 + 5b2102d commit 966cf8f

File tree

596 files changed

+12074
-7351
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

596 files changed

+12074
-7351
lines changed

.github/.react-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19.0.0-rc-187dd6a7-20240806
1+
19.0.0-rc-1eaccd82-20240816

.github/ISSUE_TEMPLATE/1.bug_report.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ body:
2222
description: |
2323
A link to a **public** [GitHub repository](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template) or a [CodeSandbox](https://codesandbox.io/p/sandbox/github/vercel/next.js/tree/canary/examples/reproduction-template) minimal reproduction. Minimal reproductions should be created from our [bug report template with `npx create-next-app -e reproduction-template`](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template) and should include only changes that contribute to the issue. To report a Pages Router related issue, you can use these templates: [`npx create-next-app -e reproduction-template-pages`](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template-pages) or [CodeSandbox](https://codesandbox.io/p/sandbox/github/vercel/next.js/tree/canary/examples/reproduction-template-pages)
2424
25-
**Skipping this/providing an invalid link will result in the issue being closed**
25+
**Skipping this/providing an invalid link will result in the issue being closed.**
2626
placeholder: 'https://github.com/user/my-minimal-nextjs-issue-reproduction'
2727
validations:
2828
required: true
@@ -39,8 +39,11 @@ body:
3939
- type: textarea
4040
attributes:
4141
label: Current vs. Expected behavior
42-
description: A clear and concise description of what the bug is, and what you expected to happen.
43-
placeholder: 'Following the steps from the previous section, I expected A to happen, but I observed B instead'
42+
description: |
43+
A clear and concise description of what the bug is (e.g., screenshots, logs, etc.), and what you expected to happen.
44+
45+
**Skipping this/failure to provide complete information of the bug will result in the issue being closed.**
46+
placeholder: 'Following the steps from the previous section, I expected A to happen, but I observed B instead.'
4447
validations:
4548
required: true
4649
- type: textarea

.github/actions/next-repo-actions/dist/issues/index.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

.github/actions/next-repo-actions/dist/triage-issues-with-ai/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/next-repo-actions/lib/triage_guidelines.txt

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/actions/next-repo-actions/src/popular-issues.mjs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,18 @@ async function run() {
5555

5656
if (data.items.length > 0) {
5757
data.items.forEach(async (item) => {
58+
const labelType = item.labels.some(
59+
(label) => label.name === 'Turbopack'
60+
)
61+
? 'turbopack'
62+
: 'next'
63+
const syncLabel = `linear: ${labelType}`
64+
5865
await octoClient.rest.issues.addLabels({
5966
owner,
6067
repo,
6168
issue_number: item.number,
62-
labels: ['linear: next'],
69+
labels: [syncLabel],
6370
})
6471
})
6572

.github/actions/next-repo-actions/src/triage-issues-with-ai.ts

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import { WebClient } from '@slack/web-api'
2-
import * as path from 'node:path'
3-
import { readFileSync } from 'node:fs'
42
import { info, setFailed } from '@actions/core'
53
import { context } from '@actions/github'
64
import { generateText, tool } from 'ai'
@@ -13,47 +11,60 @@ import { issueSchema } from '../lib/types'
1311
async function main() {
1412
if (!process.env.OPENAI_API_KEY) throw new TypeError('OPENAI_API_KEY not set')
1513
if (!process.env.SLACK_TOKEN) throw new TypeError('SLACK_TOKEN not set')
14+
if (!process.env.VERCEL_PROTECTION_BYPASS)
15+
throw new TypeError('VERCEL_PROTECTION_BYPASS not set')
1616

1717
const slackClient = new WebClient(process.env.SLACK_TOKEN)
1818
const model = 'gpt-4o'
1919
const channel = '#next-info'
2020

2121
const issue = context.payload.issue
22-
const filePath = path.join(
23-
process.cwd(),
24-
'.github/actions/next-repo-actions/lib/triage_guidelines.txt'
25-
)
26-
const fileText = readFileSync(filePath, 'utf8')
22+
const html_url = issue.html_url
23+
const number = issue.number
24+
const title = issue.title
2725

28-
let latestVersion
29-
let latestCanaryVersion
26+
let latestVersion: string
27+
let latestCanaryVersion: string
3028

3129
try {
3230
latestVersion = await getLatestVersion()
3331
latestCanaryVersion = await getLatestCanaryVersion()
3432

33+
const res = await fetch(
34+
'https://next-triage.vercel.sh/api/triage-guidelines',
35+
{
36+
method: 'GET',
37+
headers: {
38+
'x-vercel-protection-bypass': `${process.env.VERCEL_PROTECTION_BYPASS}`,
39+
},
40+
}
41+
)
42+
43+
const guidelines = await res.text()
44+
3545
const result = await generateText({
3646
model: openai(model),
3747
maxAutomaticRoundtrips: 1,
3848
tools: {
3949
report_to_slack: tool({
40-
description: 'Report to Slack if a GitHub issue is severe enough.',
50+
description: 'Report to Slack.',
4151
parameters: issueSchema,
42-
execute: async ({ issue }) => ({
43-
html_url: issue.html_url,
44-
number: issue.number,
45-
title: issue.title,
46-
}),
4752
}),
4853
},
49-
prompt: `${JSON.stringify(issue)}\n${fileText}\nlatestVersion: ${latestVersion}\nlatestCanaryVersion: ${latestCanaryVersion}\nWith the above GitHub issue (JSON), the triage guidelines for determining whether an issue is severe, and the latest versions of Next.js, can you determine whether the given issue is severe enough to report to Slack? If severe enough, report to Slack with an approximately 300 character summary (don't repeat the triage guidelines while doing so) of why you think it is severe enough to report to Slack. If not severe enough, do not report to Slack.`,
54+
system:
55+
'Your job is to determine the severity of a GitHub issue using the triage guidelines and the latest versions of Next.js. Succinctly explain why you chose the severity, without paraphrasing the triage guidelines. Report this explanation to slack only if the severity is considered severe.',
56+
prompt:
57+
`Here are the triage guidelines: ${guidelines}` +
58+
`Here is the latest version of Next.js: ${latestVersion}` +
59+
`Here is the latest canary version of Next.js: ${latestCanaryVersion}` +
60+
`Here is the GitHub issue: ${JSON.stringify(issue)}`,
5061
})
5162

5263
// the ai determined that the issue was severe enough to report on slack
5364
if (result.roundtrips.length > 1) {
5465
const blocks = BlockCollection([
5566
Section({
56-
text: `:github2: <${result.roundtrips[0].toolResults[0].result.html_url}|#${result.roundtrips[0].toolResults[0].result.number}>: ${result.roundtrips[0].toolResults[0].result.title}\n_Note: This issue was summarized and reported on Slack with the *${model}* model._`,
67+
text: `:github2: <${html_url}|#${number}>: ${title}\n_Note: This issue was evaluated and reported on Slack with *${model}*._`,
5768
}),
5869
Divider(),
5970
Section({
@@ -67,10 +78,14 @@ async function main() {
6778
icon_emoji: ':github:',
6879
username: 'GitHub Notifier',
6980
})
70-
} else {
71-
// the ai will also provide a reason why the issue was not severe enough to report on slack
72-
info(`${result.text}`)
81+
82+
info('Posted to Slack!')
7383
}
84+
85+
// the ai will also provide a reason why the issue was not severe enough to report on slack
86+
info(
87+
`result.text: ${result.text}\nhtml_url: ${html_url}\nnumber: ${number}\ntitle: ${title}`
88+
)
7489
} catch (error) {
7590
setFailed(error)
7691
}

.github/workflows/build_and_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ jobs:
168168
- name: ast-grep lint step
169169
uses: ast-grep/[email protected]
170170
with:
171-
version: 0.25.6
171+
version: 0.26.1
172172

173173
devlow-bench:
174174
name: Run devlow benchmarks

.github/workflows/triage_with_ai.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ jobs:
1616
env:
1717
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
1818
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
19+
VERCEL_PROTECTION_BYPASS: ${{ secrets.VERCEL_PROTECTION_BYPASS }}

0 commit comments

Comments
 (0)