diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index c09984de5c3b..c6aa8e7b0b4e 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -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: 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 + - deno + validations: + required: false - type: input id: link-to-sentry attributes: diff --git a/.github/workflows/issue-package-label.yml b/.github/workflows/issue-package-label.yml index ef0f0344b8fc..f76bfea0918e 100644 --- a/.github/workflows/issue-package-label.yml +++ b/.github/workflows/issue-package-label.yml @@ -10,115 +10,25 @@ 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 Browser label # https://github.com/kanga333/variable-mapper uses: kanga333/variable-mapper@v0.3.0 - id: packageLabel - if: steps.packageName.outputs.match != '' + id: browserLabel + 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": { - "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" }, @@ -128,20 +38,19 @@ jobs: } 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 Browser label if applicable + if: steps.browserLabel.outputs.label != '' uses: actions-ecosystem/action-add-labels@v1 with: - labels: ${{ steps.packageLabel.outputs.label }} + labels: ${{ steps.browserLabel.outputs.label }} - - name: Map additional to issue label + - name: Map SDK source to delivery method label # https://github.com/kanga333/variable-mapper uses: kanga333/variable-mapper@v0.3.0 - id: additionalLabel - if: steps.packageName.outputs.match != '' + id: deliveryLabel + 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: | { @@ -154,9 +63,78 @@ jobs: } 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 != '' + - name: Add delivery method label if applicable + if: steps.deliveryLabel.outputs.label != '' + uses: actions-ecosystem/action-add-labels@v1 + with: + labels: ${{ steps.deliveryLabel.outputs.label }} + + # Scan System Info section for @sentry/* packages (from envinfo output) + - name: Detect @sentry packages in System Info + id: packageLabels + uses: actions/github-script@v7 + with: + 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'); + core.setOutput('labels', ''); + 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); + } + } + + const labels = Array.from(labelsToAdd).join('\n'); + console.log('Detected labels:', labels); + core.setOutput('labels', labels); + + - name: Add package labels if applicable + if: steps.packageLabels.outputs.labels != '' uses: actions-ecosystem/action-add-labels@v1 with: - labels: ${{ steps.additionalLabel.outputs.label }} + labels: ${{ steps.packageLabels.outputs.labels }}