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

Add Error Handling for YN0082 in YarnErrorHandler #10374

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

kbukum1
Copy link
Contributor

@kbukum1 kbukum1 commented Aug 5, 2024

What are you trying to accomplish?

This PR aims to add error handling for the YN0082 error code in the YarnErrorHandler. The YN0082 error occurs when no candidates are found for a specified package version, and it needs to be captured and handled appropriately to improve the error reporting and user experience.

Anything you want to highlight for special attention from reviewers?

The approach used to handle the YN0082 error is similar to the existing handling of the YN0035 error. It captures the package causing the error and raises a Dependabot::DependencyNotFound error with the relevant package information.

How will you know you've accomplished your goal?

  • The error handling code for YN0082 should correctly capture and raise the Dependabot::DependencyNotFound error.
  • The added tests should pass, demonstrating that the new error handling works as expected.
  • Running the complete test suite should ensure no other functionality is broken by this change.

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@kbukum1 kbukum1 marked this pull request as ready for review August 5, 2024 22:37
@kbukum1 kbukum1 requested a review from a team as a code owner August 5, 2024 22:37
@kbukum1 kbukum1 merged commit 2e1e8fd into main Aug 5, 2024
65 checks passed
@kbukum1 kbukum1 deleted the kamil/catching_yarn_error_YN0082_package_not_found branch August 5, 2024 23:06
@jurre
Copy link
Member

jurre commented Aug 6, 2024

@kbukum1 one thing I am a bit worried about is that we don't have any integration level tests that check against a real yarn instance returning the error, this means that if an update of Yarn makes changes to these error messages, we won't catch it.

This is something that's happened very frequently with this approach of parsing errors from the package manager.

Especially the fact that the regex checks for the copy and not only the error code means we are more susceptible to changes to the message

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

Successfully merging this pull request may close these issues.

3 participants