Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 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
67 changes: 22 additions & 45 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,62 +25,39 @@ body:
- type: dropdown
id: package
attributes:
label: Which SDK are you using?
label: Where are you installing the Sentry SDK from?
description:
If you're using the CDN bundles, please specify the exact bundle (e.g. `bundle.tracing.min.js`) in your SDK
setup.
options:
- '@sentry/browser'
- '@sentry/node'
- '@sentry/node - express'
- '@sentry/node - fastify'
- '@sentry/node - koa'
- '@sentry/node - hapi'
- '@sentry/node - connect'
- '@sentry/node-native'
- '@sentry/angular'
- '@sentry/astro'
- '@sentry/aws-serverless'
- '@sentry/bun'
- '@sentry/cloudflare'
- '@sentry/cloudflare - hono'
- '@sentry/deno'
- '@sentry/ember'
- '@sentry/gatsby'
- '@sentry/google-cloud-serverless'
- '@sentry/nestjs'
- '@sentry/nextjs'
- '@sentry/nuxt'
- '@sentry/react'
- '@sentry/react-router'
- '@sentry/remix'
- '@sentry/solid'
- '@sentry/solidstart'
- '@sentry/svelte'
- '@sentry/sveltekit'
- '@sentry/tanstackstart-react'
- '@sentry/vue'
- '@sentry/wasm'
- Sentry NPM package
- Sentry Browser Loader
- Sentry Browser CDN bundle
validations:
Comment thread
sentry[bot] marked this conversation as resolved.
required: true
- type: input
id: sdk-version
- type: textarea
id: system-info
attributes:
label: SDK Version
description: What version of the SDK are you using?
placeholder: ex. 8.10.0
label: System Info
description:
If you are using an NPM package, run `npx envinfo --binaries --npmPackages "@sentry/*"` and paste the output
here.
render: shell
validations:
required: true
- type: input
id: framework-version
required: false
- type: dropdown
id: package-manager
attributes:
label: Framework Version
description:
If you're using one of our framework-specific SDKs (`@sentry/react`, for example), what version of the
_framework_ are you using?
placeholder: ex. React 18.3.0 or Next 14.0.0
label: Package Manager
description: If you are using an NPM package, which package manager are you using?
options:
- npm
- yarn
- pnpm
- bun
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Deno 😢

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll add.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would it make sense to add a "Other"? You'll never know what will come tomorrow

- deno
validations:
required: false
- type: input
id: link-to-sentry
attributes:
Expand Down
204 changes: 79 additions & 125 deletions .github/workflows/issue-package-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,153 +10,107 @@ jobs:
runs-on: ubuntu-latest
if: ${{ !github.event.issue.pull_request }}
steps:
- name: Get used package from issue body
- name: Get SDK source from issue body
# https://github.com/actions-ecosystem/action-regex-match
uses: actions-ecosystem/action-regex-match@v2
id: packageName
id: sdkSource
with:
# Parse used package from issue body
# Parse SDK source from issue body
text: ${{ github.event.issue.body }}
regex: '### Which SDK are you using\?\n\n(.*)\n\n'
regex: '### Where are you installing the Sentry SDK from\?\n\n(.*)\n\n'

- name: Map package to issue label
- name: Map SDK source to issue label
# https://github.com/kanga333/variable-mapper
uses: kanga333/variable-mapper@v0.3.0
id: packageLabel
if: steps.packageName.outputs.match != ''
id: sourceLabel
if: steps.sdkSource.outputs.match != ''
with:
key: '${{ steps.packageName.outputs.group1 }}'
key: '${{ steps.sdkSource.outputs.group1 }}'
# Note: Since this is handled as a regex, and JSON parse wrangles slashes /, we just use `.` instead
map: |
{
"@sentry.angular": {
"label": "Angular"
},
"@sentry.astro": {
"label": "Astro"
},
"@sentry.aws-serverless": {
Comment thread
cursor[bot] marked this conversation as resolved.
"label": "AWS Lambda"
},
"@sentry.browser": {
"label": "Browser"
},
"@sentry.bun": {
"label": "Bun"
},
"@sentry.cloudflare.-.hono": {
"label": "Hono"
},
"@sentry.cloudflare": {
"label": "Cloudflare Workers"
},
"@sentry.deno": {
"label": "Deno"
},
"@sentry.ember": {
"label": "Ember"
},
"@sentry.gatsby": {
"label": "Gatbsy"
},
"@sentry.google-cloud-serverless": {
"label": "Google Cloud Functions"
},
"@sentry.nestjs": {
"label": "Nest.js"
},
"@sentry.nextjs": {
"label": "Next.js"
},
"@sentry.node.-.express": {
"label": "Express"
},
"@sentry.node.-.fastify": {
"label": "Fastify"
},
"@sentry.node.-.koa": {
"label": "Koa"
},
"@sentry.node.-.hapi": {
"label": "Hapi"
},
"@sentry.node.-.connect": {
"label": "Connect"
},
"@sentry.node": {
"label": "Node.js"
},
"@sentry.nuxt": {
"label": "Nuxt"
},
"@sentry.react-router": {
"label": "React Router Framework"
},
"@sentry.react": {
"label": "React"
},
"@sentry.remix": {
"label": "Remix"
},
"@sentry.solid": {
"label": "Solid"
},
"@sentry.solidstart": {
"label": "SolidStart"
},
"@sentry.sveltekit": {
"label": "SvelteKit"
},
"@sentry.svelte": {
"label": "Svelte"
},
"@sentry.vue": {
"label": "Vue"
},
"@sentry.tanstackstart-react": {
"label": "Tanstack Start React"
},
"@sentry.wasm": {
"label": "WASM"
},
"Sentry.Browser.Loader": {
"label": "Browser"
"label": "Loader Script"
},
"Sentry.Browser.CDN.bundle": {
"label": "Browser"
"label": "CDN Bundle"
}
}
export_to: output

- name: Add package label if applicable
# Note: We only add the label if the issue is still open
if: steps.packageLabel.outputs.label != ''
- name: Add SDK source label if applicable
if: steps.sourceLabel.outputs.label != ''
uses: actions-ecosystem/action-add-labels@v1
with:
labels: ${{ steps.packageLabel.outputs.label }}
labels: ${{ steps.sourceLabel.outputs.label }}

- name: Map additional to issue label
# https://github.com/kanga333/variable-mapper
uses: kanga333/variable-mapper@v0.3.0
id: additionalLabel
if: steps.packageName.outputs.match != ''
# Scan System Info section for @sentry/* packages (from envinfo output)
- name: Detect @sentry packages and add labels
uses: actions/github-script@v7
with:
key: '${{ steps.packageName.outputs.group1 }}'
# Note: Since this is handled as a regex, and JSON parse wrangles slashes /, we just use `.` instead
map: |
{
"Sentry.Browser.Loader": {
"label": "Loader Script"
},
"Sentry.Browser.CDN.bundle": {
"label": "CDN Bundle"
script: |
const body = context.payload.issue.body || '';

// Extract only the System Info section to avoid matching free-form text
const systemInfoMatch = body.match(/### System Info\s*\n([\s\S]*?)(?=\n### |\n*$)/);
if (!systemInfoMatch) {
console.log('No System Info section found');
return;
}

const systemInfoSection = systemInfoMatch[1];
console.log('Scanning System Info section for @sentry/* packages');

// Map of package patterns to labels
const packageToLabel = {
'@sentry/angular': 'Angular',
'@sentry/astro': 'Astro',
'@sentry/aws-serverless': 'AWS Lambda',
'@sentry/browser': 'Browser',
'@sentry/bun': 'Bun',
'@sentry/cloudflare': 'Cloudflare Workers',
'@sentry/deno': 'Deno',
'@sentry/ember': 'Ember',
'@sentry/gatsby': 'Gatsby',
'@sentry/google-cloud-serverless': 'Google Cloud Functions',
'@sentry/nestjs': 'Nest.js',
'@sentry/nextjs': 'Next.js',
'@sentry/node': 'Node.js',
'@sentry/nuxt': 'Nuxt',
'@sentry/react-router': 'React Router Framework',
'@sentry/react': 'React',
'@sentry/remix': 'Remix',
'@sentry/solid': 'Solid',
'@sentry/solidstart': 'SolidStart',
'@sentry/svelte': 'Svelte',
'@sentry/sveltekit': 'SvelteKit',
'@sentry/tanstackstart-react': 'Tanstack Start React',
'@sentry/vue': 'Vue',
'@sentry/wasm': 'WASM',
};

const labelsToAdd = new Set();

// Check for each package in the System Info section
for (const [pkg, label] of Object.entries(packageToLabel)) {
// Escape special regex characters in package name
const escapedPkg = pkg.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
// Match package name followed by colon (envinfo format) or version pattern
const regex = new RegExp(escapedPkg + '[:\\s]', 'i');
if (regex.test(systemInfoSection)) {
labelsToAdd.add(label);
}
}
export_to: output

- name: Add additional label if applicable
# Note: We only add the label if the issue is still open
if: steps.additionalLabel.outputs.label != ''
uses: actions-ecosystem/action-add-labels@v1
with:
labels: ${{ steps.additionalLabel.outputs.label }}
if (labelsToAdd.size > 0) {
const labels = Array.from(labelsToAdd);
console.log('Adding labels:', labels);
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: labels
});
} else {
console.log('No @sentry/* packages detected in System Info section');
}
Loading