Skip to content

ref(examples): migrate to context scope API - #1406

Open
giortzisg wants to merge 1 commit into
scopes/outbound-client-integrationsfrom
scopes/examples-scopes
Open

ref(examples): migrate to context scope API#1406
giortzisg wants to merge 1 commit into
scopes/outbound-client-integrationsfrom
scopes/examples-scopes

Conversation

@giortzisg

Copy link
Copy Markdown
Contributor

Description

Refactor all examples to use the new scopes API.

Issues

Changelog Entry Instructions

To add a custom changelog entry, uncomment the section above. Supports:

  • Single entry: just write text
  • Multiple entries: use bullet points
  • Nested bullets: indent 4+ spaces

For more details: custom changelog entries

Reminders

Stack created with GitHub Stacks CLIGive Feedback 💬

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2cae626. Configure here.

}

sentry.CaptureException(errWithExtra)
sentry.CaptureException(context.Background(), errWithExtra)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ConfigureScope data ignored by captures

Medium Severity

ConfigureScope still writes to the hub scope, but the migrated capture helpers now apply GlobalScope or a context scope. Tags, user data, and event processors set this way are no longer attached to the captured events.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2cae626. Configure here.

Comment on lines 73 to 75
func addBreadcrumbs() {
sentry.AddBreadcrumb(&sentry.Breadcrumb{
sentry.AddBreadcrumb(context.Background(), &sentry.Breadcrumb{
Message: "Random breadcrumb 1",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The call to sentry.AddBreadcrumb in the example code provides two arguments, but the function signature only expects one, causing a compilation error.
Severity: MEDIUM

Suggested Fix

Update the calls to sentry.AddBreadcrumb in _examples/feature-showcase/main.go to match the function's signature by removing the first argument, context.Background(). The call should only pass the *sentry.Breadcrumb struct.

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: _examples/feature-showcase/main.go#L73-L75

Potential issue: The example code in `_examples/feature-showcase/main.go` calls
`sentry.AddBreadcrumb` with two arguments, `context.Background()` and a
`*sentry.Breadcrumb`. However, the actual function signature for `sentry.AddBreadcrumb`
in `sentry.go` only accepts a single argument: `breadcrumb *Breadcrumb`. This mismatch
between the function call and its definition will cause a compilation error, preventing
the example from being built.

Also affects:

  • _examples/feature-showcase/main.go:78~80
  • _examples/feature-showcase/main.go:82~84

Did we get this right? 👍 / 👎 to inform future reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant