Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track unknown errors #7534

Merged
merged 22 commits into from
Sep 21, 2023
Merged

Track unknown errors #7534

merged 22 commits into from
Sep 21, 2023

Conversation

Nishnha
Copy link
Member

@Nishnha Nishnha commented Jul 8, 2023

Dependabot currently treats unknown_errors the same as any other error type.

However, unknown_errors are a bit of a special case because they are mostly caused by a HelperSubprocessFailure when Dependabot shells out to native package managers. The helper subprocess failures are harder to debug because they can be specific to a dependency set or some combination of a package manager version and project file features.

In order to better investigate unknown errors, we should send the error details to the backend service so we can look for trends.

This PR makes a few changes to the way unknown errors are logged:

  1. unknown errors can only be generated from a few sources:
    a. helper subprocess failures
    b. file fetcher command errors
    c. update files command errors
  2. helper subprocess failure commands are now logged to the Dependabot job log so users can investigate issues themselves (Improve error when native helper gives empty output #6521)
  3. octokit 500 errors are treated as a new error type, server_error, since they are well-known
  4. unknown errors also increment an updater.unknown_error metric with tags for the package manager

Still needs a feature flag for GHES support and tests for the new endpoint.

EDIT: Check has been added in Dependabot-api to to return immediately if in GHES or Proxima environment

@Nishnha Nishnha self-assigned this Jul 8, 2023
@Nishnha Nishnha added the EE Engineering Efficiency label Jul 8, 2023
@Nishnha Nishnha force-pushed the nishnha/track-unknown-errors branch from b7e69cb to 4013395 Compare August 4, 2023 15:05
@Nishnha Nishnha force-pushed the nishnha/track-unknown-errors branch 2 times, most recently from f954f81 to fc67509 Compare August 28, 2023 15:07
@honeyankit honeyankit self-assigned this Sep 5, 2023
@github-actions github-actions bot added the L: php:composer Issues and code for Composer label Sep 15, 2023
@honeyankit honeyankit marked this pull request as ready for review September 15, 2023 15:29
@honeyankit honeyankit requested a review from a team as a code owner September 15, 2023 15:29
Copy link
Member

@jurre jurre left a comment

Choose a reason for hiding this comment

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

The changes look good to me, but I am slightly worried we could be loggin PII when logging the commands we're running natively, so it might be good to have a look at that. Going to approve as to unblock this once we're confident about that, though 👍

@honeyankit honeyankit merged commit 0997935 into main Sep 21, 2023
80 checks passed
@honeyankit honeyankit deleted the nishnha/track-unknown-errors branch September 21, 2023 21:23
brettfo pushed a commit to brettfo/dependabot-core that referenced this pull request Oct 11, 2023
* Refactored error handling and metrics in Dependabot to improve debugging and reporting. This includes enhancing the "unknown_error" metric with package manager tags, passing detailed error information to "record_unknown_error," and updating tests and lint issues for better code quality.

---------

Co-authored-by: Ankit Honey <honeyankit@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EE Engineering Efficiency L: php:composer Issues and code for Composer L: python
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants