-
Notifications
You must be signed in to change notification settings - Fork 1k
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
capture and report job deserialization errors #11179
Merged
Merged
Conversation
This file contains 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
brettfo
commented
Dec 24, 2024
common/lib/dependabot/errors.rb
Outdated
{ | ||
"error-type": "illformed_requirement", | ||
"error-detail": { message: error.message } | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block of code already existed in updater_error_details
but this error occurs during the fetch
phase of a NuGet update so it was simply copied here, too. This is a well-known error with a known shape.
brettfo
force-pushed
the
dev/brettfo/nuget-requirement-parse-error
branch
from
December 26, 2024 18:14
13f3ed2
to
9161873
Compare
brettfo
commented
Dec 26, 2024
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/DiscoverCommand.cs
Show resolved
Hide resolved
JamieMagee
approved these changes
Dec 27, 2024
JamieMagee
force-pushed
the
dev/brettfo/nuget-requirement-parse-error
branch
from
December 27, 2024 21:58
9161873
to
fb9c62d
Compare
ryanbrandenburg
approved these changes
Jan 2, 2025
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Run/SerializationTests.cs
Show resolved
Hide resolved
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/RequirementConverter.cs
Show resolved
Hide resolved
nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/RequirementConverter.cs
Show resolved
Hide resolved
brettfo
force-pushed
the
dev/brettfo/nuget-requirement-parse-error
branch
from
January 7, 2025 17:38
fb9c62d
to
2808ab4
Compare
ryanbrandenburg
approved these changes
Jan 7, 2025
randhircs
approved these changes
Jan 7, 2025
randhircs
force-pushed
the
dev/brettfo/nuget-requirement-parse-error
branch
from
January 7, 2025 18:49
ec7854f
to
9a473f1
Compare
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.
The
job.json
file is passed to all update steps which means we need to be able to report all parsing errors as they occur.Originally this work started because a requirement was specified in the job file that could not be parsed, so part of this PR is to return the well-known error
illformed_requirement
, represented asBadRequirementError
.Most of this PR was to make testing possible, but ultimately it comes down to 2 major changes:
discover
command. All subsequent commands also parse the job file, but any failure to parse is fatal so we only need to actually report it there; all other instances can assume it's acceptable.clone
command is the first time the job file is parsed, so the error handling was expanded there to specifically report the parse error and fail the entire update process.While performing some manual tests, I discovered that the shape of the error objects returned by the end-to-end parser wasn't always correct, so I checked in the
dependabot/cli
repo to ensure the errors had the correct shape and added serialization tests for all error types to ensure this doesn't regress.