Repository navigation
Add error-context to unknown errors from common error producers - #16844
Merged
v-abhishekbhaskar merged 1 commit intoNov 10, 2026
Merged
Conversation
v-abhishekbhaskar
force-pushed
the
abhishekbhaskar/common-error-producers-context
branch
2 times, most recently
from
November 6, 2026 07:28
65959ab to
400aeea
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved merge-conflict markers make the updater spec invalid Ruby and prevent it from loading; the resolution must retain the randomized dependency matcher and add the helper-error-class expectation to avoid order-dependent failures.
1 open issue
What changed in this PR
Extends the error-context reporting introduced in #16801 to common error sources shared across ecosystems, adding diagnostic details without changing error grouping.
Changes:
- Extracts HTTP, socket, helper, allowlisted Sentry extras, and cause details.
- Attaches request method and host to registry failures while preserving cached errors’ original context.
- Expands specs for context extraction, sensitive-data exclusion, and reporting.
| File | Description |
|---|---|
common/lib/dependabot/error_report_context.rb |
Extracts diagnostic context from common error types. |
common/lib/dependabot/registry_client.rb |
Attaches method and host to registry failures. |
common/spec/dependabot/error_report_context_spec.rb |
Covers extraction, allowlisting, and cause precedence. |
common/spec/dependabot/registry_client_spec.rb |
Tests host-only context and cached-error preservation. |
updater/spec/dependabot/service_spec.rb |
Verifies allowlisted helper context is reported. |
updater/spec/dependabot/updater/error_handler_spec.rb |
Adds helper error-class expectations. |
updater/spec/dependabot/updater_spec.rb |
Updates grouped-update error-context expectations. |
Review effort: Balanced
v-robaiken
previously approved these changes
Nov 6, 2026
Base automatically changed from
abhishekbhaskar/send-sentry-error-context
to
main
November 10, 2026 00:34
v-abhishekbhaskar
dismissed
v-robaiken’s stale review
November 10, 2026 00:34
The base branch was changed.
- Excon HTTP status errors: http-method, host, http-status - Excon socket errors: socket-error-class - RegistryClient attaches http-method and host on timeouts and socket errors, keeping the original context when a cached error is replayed - HasSentryContext errors forward allowlisted extra keys (SENTRY_EXTRA_KEYS), plus helper-error-class for HelperSubprocessFailed - cause-class when the error has a cause Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bb20e6a7-5851-4547-8b46-0307512d7a1a
v-abhishekbhaskar
force-pushed
the
abhishekbhaskar/common-error-producers-context
branch
from
November 10, 2026 00:38
400aeea to
d7915da
Compare
v-sachin-sandhu
approved these changes
Nov 10, 2026
v-abhishekbhaskar
deleted the
abhishekbhaskar/common-error-producers-context
branch
November 10, 2026 01:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What are you trying to accomplish?
#16801 adds an
error-contextfield to unknown-error reports, plusDependabot::ErrorReportContext.attach/buildso code can attach debugging context to an exception. This PR fills that field from the error sources incommonthat every ecosystem uses. The most frequent unknown errors then arrive with enough detail to debug them without reproducing the job.The context is diagnostic only. It is never part of the fingerprint, so error grouping is unchanged.
Context now added:
Excon::Error::HTTPStatushttp-method,host,http-status(from anExcon::Responseor a raw response hash)Excon::Error::Socketsocket-error-class(e.g.EOFError)Dependabot::RegistryClientget/headtimeouts and socket errorshttp-method,hostDependabot::HasSentryContextsentry_context[:extra]keys:helper-function,helper-exit-status,helper-termsig,helper-time-taken,package-manager-name,updated-files,dependency-files,dependency-namesSharedHelpers::HelperSubprocessFailedhelper-error-classcause-classExample payload for a registry timeout during an npm update:
Anything you want to highlight for special attention from reviewers?
mainonce Pass error-context from core to api for forwarding to sentry #16801 merges.sentry_context[:extra]is only forwarded throughSENTRY_EXTRA_KEYS. Helperargs,commandandstderr_outputare always dropped because they can contain credentials or private registry URLs.dependenciesis reduced to names only, and the pid is stripped fromprocess_exit_value.RegistryClientusesErrorReportContext.host_for(url), so paths, query strings and userinfo are never sent.RegistryClientreplays a cached error for later requests to the same host. A replayed error keeps the context of the request that originally failed, so a cached GET timeout isn't relabelled as a HEAD request.Adding context from a package manager (follow-up PRs):
Dependabot::ErrorReportContext.attach(error, { host: ErrorReportContext.host_for(url), manifest_file: "Cargo.toml" })and re-raise. This works on any exception and needs no change tocommon.sentry_context, add the safe key toSENTRY_EXTRA_KEYSincommon/lib/dependabot/error_report_context.rb.How will you know you've accomplished your goal?
New specs cover:
HelperSubprocessFailedallowlist (secrets dropped, pid stripped).NoChangeError-stylesentry_context.RegistryClientattaching method and host, and keeping the original context on a replayed cached error.Validation (host Ruby):
cd common && bundle exec rspec spec/dependabot/error_report_context_spec.rb spec/dependabot/registry_client_spec.rb: 74 examples, 0 failurescd updater && bundle exec rspec spec/dependabot/updater/error_handler_spec.rb spec/dependabot/service_spec.rb: 66 examples, 0 failuresbundle exec rubocopon the changed files: no offensesbundle exec srb tc: no errorsOnce deployed, unknown errors in Sentry such as Excon read timeouts and
EOFErrorshould show the registry host and HTTP method inerror-context.Checklist