fix: Use FromContext(any) for multi-context retrieval in paseto, newrelic, and sentry#1724
Conversation
…eto, newrelic, sentry Co-authored-by: gaby <835733+gaby@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot we only want to support FromContext with any, you do not need to add another helper. |
Co-authored-by: gaby <835733+gaby@users.noreply.github.com>
Done in commit 23c5b92. Removed all Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
This PR updates context-retrieval helper APIs in the paseto, newrelic, and sentry middlewares to accept any, enabling value retrieval from multiple context types (e.g., fiber.Ctx vs c.Context() when PassLocalsToContext is enabled), and adjusts README/docs accordingly.
Changes:
- Document/clarify
GetHubFromContext/MustGetHubFromContextbehavior insentry(panic semantics). - Document
newrelic.FromContext(ctx any)as supporting multiple context types. - Disambiguate README “Signature” sections using package aliases to avoid confusion with upstream SDK packages.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| v3/sentry/sentry.go | Adds explicit doc note that MustGetHubFromContext panics when hub is missing. |
| v3/sentry/README.md | Updates signature docs to disambiguate middleware package vs Sentry SDK types. |
| v3/newrelic/fiber.go | Updates FromContext doc comment to note supported context types. |
| v3/newrelic/README.md | Updates signature docs/examples with aliases; clarifies PassLocalsToContext retrieval. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot double check all the docs again. |
…alias Co-authored-by: gaby <835733+gaby@users.noreply.github.com>
|
@copilot make sure every model using FromContext had their docs updated |
…n for FromContext Co-authored-by: gaby <835733+gaby@users.noreply.github.com>
Done in commit 90953bf. The |
|
@copilot also check the docs for otel and jwt. |
Checked both:
All modules that expose a |
|
@copilot in each readme, be consistent about this part: You have the same messages in different ways across README files; it should be the same as above instead. |
Co-authored-by: gaby <835733+gaby@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
673ec1a
into
update-contrib-modules-to-use-fromcontext
*AnyContexthelpers —FromContext,GetHubFromContext,MustGetHubFromContexteach acceptanyc.Context()(ctx any)signatures*nr.Transactionconsistently with the alias in the signature blockFromContextdescription phrasing across all READMEs (paseto, newrelic, sentry, jwt)🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.