Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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:
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
Member

Choose a reason for hiding this comment

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

Deno 😢

Copy link
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
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
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
198 changes: 88 additions & 110 deletions .github/workflows/issue-package-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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: |
{
Expand All @@ -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 }}
Comment on lines +132 to +140
Copy link

Choose a reason for hiding this comment

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

Bug: The action-add-labels step incorrectly consumes multiline label output from a script because the YAML syntax is missing the required pipe operator (|) for multiline strings.
Severity: MEDIUM

Suggested Fix

Modify the action-add-labels step to use the YAML pipe operator for the labels input. This ensures the newline-separated string from the previous step is correctly interpreted as a list of labels.

- name: Add Package Labels
  uses: actions/add-to-project@v1
  with:
    labels: |
      ${{ steps.packageLabels.outputs.labels }}
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: .github/workflows/issue-package-label.yml#L132-L140

Potential issue: A `github-script` step generates a newline-separated string of labels
and sets it as an output. This output is then passed to the `action-add-labels` action
at line 140. However, the YAML syntax `labels: ${{ steps.packageLabels.outputs.labels
}}` does not use the pipe operator (`|`), which is required to correctly interpret a
multiline string in YAML. This will likely cause the action to fail when attempting to
add multiple labels, such as when an issue report contains multiple `@sentry/*`
packages, defeating the purpose of the automation.

Loading