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

Adds handler for YARN :: YN0xx errors #10505

Merged
merged 2 commits into from
Aug 27, 2024

Conversation

sachin-sandhu
Copy link
Contributor

@sachin-sandhu sachin-sandhu commented Aug 26, 2024

What are you trying to accomplish?

Preface: Fixes issues related with YARN Dependabot::DependabotError errors.

Issues: Yarn update response errors handling issues

Fixes: Adds exception handler for following Yarn codes:

YN0001-Libzip
YN0009-Build Failed
YN0041-Invalid authentication
YN0060-Incompatible peer dependency
YN0068-No matching package
YN0086-Peer dependencies incorrectly met

Anything you want to highlight for special attention from reviewers?

How will you know you've accomplished your goal?

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.

@sachin-sandhu sachin-sandhu self-assigned this Aug 26, 2024
@sachin-sandhu sachin-sandhu marked this pull request as ready for review August 26, 2024 19:24
@sachin-sandhu sachin-sandhu requested a review from a team as a code owner August 26, 2024 19:24
@@ -240,6 +254,12 @@ def self.sanitize_resolvability_message(error_message, dependencies, yarn_lock)
Dependabot::MisconfiguredTooling.new("Yarn", message)
}
},
"YN0060" => {
message: "Incompatible peer dependency",
Copy link
Member

Choose a reason for hiding this comment

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

I think :dependabot: shouldbe handling this class of errors

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@abdulapopoola , we can force resolve using --force or user can manually resolve the incompatibility. i wont recommend --force , i'm removing the handler for now and will look as part of this ongoing issue .

MANIFEST_NOT_FOUND: /YN0001: Error: (?<pkg>.*): Manifest not found/
FIND_PACKAGE_LOCATION: /YN0001:(.*?)UsageError: Couldn't find the (?<pkg>.*) state file/,
NO_CANDIDATE_FOUND: /YN0001:(.*?)Error: (?<pkg>.*): No candidates found/,
NO_SUPPORTED_RESOLVER: /YN0001:(.*?)Error: (?<pkg>.*) isn't supported by any available resolver/,
Copy link
Member

Choose a reason for hiding this comment

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

where are these constants used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@abdulapopoola , they are used in YN0001 class of errors , as YN0001 is not a yarn error but application error, once we capture YN0001 , we evaluate it further to whether raise DependencyFileNotResolvable/ PrivateSourceAuthenticationFailure/ parse errors etc. in case we cant find a match , we let it raise Dependabot::DependabotError.

@sachin-sandhu sachin-sandhu merged commit c49de16 into main Aug 27, 2024
65 checks passed
@sachin-sandhu sachin-sandhu deleted the ssandhu/yarn-error-codes-fixes branch August 27, 2024 00:21
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.

2 participants