Commit ef7c9a40 authored by Balázs Orbán's avatar Balázs Orbán

chore: improve issue validator logs

parent 8a2bb49d
...@@ -8708,11 +8708,14 @@ ...@@ -8708,11 +8708,14 @@
} = e.context } = e.context
if (d || !p?.body) return if (d || !p?.body) return
const { body: n, labels: l, number: m } = p const { body: n, labels: l, number: m } = p
a.info(
`Validating issue ${m}:\n Label(s): ${l.join(', ')}\n Body: ${n}`
)
const u = l.some((e) => e.name === r) const u = l.some((e) => e.name === r)
const c = l.some((e) => e.name === t) const c = l.some((e) => e.name === t)
if (!u || !c) { if (!u || !c) {
return a.info( return a.info(
`issue ${m} is ignored, because it is not a bug report or is not manually labeled` 'Issue is ignored, because it is not a bug report or is not manually labeled'
) )
} }
if (!process.env.GITHUB_TOKEN) { if (!process.env.GITHUB_TOKEN) {
...@@ -8740,7 +8743,7 @@ ...@@ -8740,7 +8743,7 @@
'Please verify your issue reproduces with `next@canary`. The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces by running `npm install next@canary`. If the issue does not reproduce with the canary version, then it has already been fixed and this issue can be closed.' 'Please verify your issue reproduces with `next@canary`. The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces by running `npm install next@canary`. If the issue does not reproduce with the canary version, then it has already been fixed and this issue can be closed.'
) )
return a.info( return a.info(
`Commented on issue ${m}, because it was ${ `Commented on issue, because it was ${
c ? 'manually labeled' : 'not verified against canary' c ? 'manually labeled' : 'not verified against canary'
}` }`
) )
...@@ -8754,7 +8757,7 @@ ...@@ -8754,7 +8757,7 @@
'The link to the reproduction appears to be incorrect/unreachable. Please add a link to the reproduction of the issue. This is a required field. If your project is private, you can invite @balazsorban44 to the repository so the Next.js team can investigate further.' 'The link to the reproduction appears to be incorrect/unreachable. Please add a link to the reproduction of the issue. This is a required field. If your project is private, you can invite @balazsorban44 to the repository so the Next.js team can investigate further.'
) )
return a.info( return a.info(
`Commented on issue ${m}, because it the reproduction url (${g}) was not reachable.` `Commented on issue, because the reproduction url (${g}) was not reachable`
) )
} }
const w = [ const w = [
...@@ -8782,7 +8785,7 @@ ...@@ -8782,7 +8785,7 @@
`The reported Next.js version did not match the latest \`next@canary\` version (${T}). The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces by running \`npm install next@canary\`. If the issue does not reproduce with the canary version, then it has already been fixed and this issue can be closed.` `The reported Next.js version did not match the latest \`next@canary\` version (${T}). The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces by running \`npm install next@canary\`. If the issue does not reproduce with the canary version, then it has already been fixed and this issue can be closed.`
) )
return a.info( return a.info(
`Commented on issue ${m}, because it was not verified against canary.` `Commented on issue, because it was not verified against canary`
) )
} }
} catch (e) { } catch (e) {
......
...@@ -18,6 +18,12 @@ async function run() { ...@@ -18,6 +18,12 @@ async function run() {
const { body, labels, number: issueNumber } = issue const { body, labels, number: issueNumber } = issue
core.info(
`Validating issue ${issueNumber}:
Label(s): ${labels.join(', ')}
Body: ${body}`
)
const isBugReport = labels.some((label) => label.name === bugReportLabel) const isBugReport = labels.some((label) => label.name === bugReportLabel)
const isManuallyLabeled = labels.some( const isManuallyLabeled = labels.some(
...@@ -26,7 +32,7 @@ async function run() { ...@@ -26,7 +32,7 @@ async function run() {
if (!isBugReport || !isManuallyLabeled) { if (!isBugReport || !isManuallyLabeled) {
return core.info( return core.info(
`issue ${issueNumber} is ignored, because it is not a bug report or is not manually labeled` 'Issue is ignored, because it is not a bug report or is not manually labeled'
) )
} }
...@@ -65,7 +71,7 @@ async function run() { ...@@ -65,7 +71,7 @@ async function run() {
'Please verify your issue reproduces with `next@canary`. The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces by running `npm install next@canary`. If the issue does not reproduce with the canary version, then it has already been fixed and this issue can be closed.' 'Please verify your issue reproduces with `next@canary`. The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces by running `npm install next@canary`. If the issue does not reproduce with the canary version, then it has already been fixed and this issue can be closed.'
) )
return core.info( return core.info(
`Commented on issue ${issueNumber}, because it was ${ `Commented on issue, because it was ${
isManuallyLabeled ? 'manually labeled' : 'not verified against canary' isManuallyLabeled ? 'manually labeled' : 'not verified against canary'
}` }`
) )
...@@ -81,7 +87,7 @@ async function run() { ...@@ -81,7 +87,7 @@ async function run() {
'The link to the reproduction appears to be incorrect/unreachable. Please add a link to the reproduction of the issue. This is a required field. If your project is private, you can invite @balazsorban44 to the repository so the Next.js team can investigate further.' 'The link to the reproduction appears to be incorrect/unreachable. Please add a link to the reproduction of the issue. This is a required field. If your project is private, you can invite @balazsorban44 to the repository so the Next.js team can investigate further.'
) )
return core.info( return core.info(
`Commented on issue ${issueNumber}, because it the reproduction url (${reproductionUrl}) was not reachable.` `Commented on issue, because the reproduction url (${reproductionUrl}) was not reachable`
) )
} }
...@@ -120,7 +126,7 @@ async function run() { ...@@ -120,7 +126,7 @@ async function run() {
`The reported Next.js version did not match the latest \`next@canary\` version (${lastVersion}). The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces by running \`npm install next@canary\`. If the issue does not reproduce with the canary version, then it has already been fixed and this issue can be closed.` `The reported Next.js version did not match the latest \`next@canary\` version (${lastVersion}). The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces by running \`npm install next@canary\`. If the issue does not reproduce with the canary version, then it has already been fixed and this issue can be closed.`
) )
return core.info( return core.info(
`Commented on issue ${issueNumber}, because it was not verified against canary.` `Commented on issue, because it was not verified against canary`
) )
} }
} catch (error) { } catch (error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment