-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Ensure we log what the HTTP error message is if we get a failure #78418
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
base: main
Are you sure you want to change the base?
Ensure we log what the HTTP error message is if we get a failure #78418
Conversation
Just because one is missing doesn't mean we should skip validating the rest; that way you can see if there's a single one missing or a bunch missing.
src/RoslynAnalyzers/Tools/GenerateDocumentationAndConfigFiles/Program.cs
Show resolved
Hide resolved
src/RoslynAnalyzers/Tools/GenerateDocumentationAndConfigFiles/Program.cs
Outdated
Show resolved
Hide resolved
await Console.Error.WriteLineAsync($"Missing entry in {fileWithPath}").ConfigureAwait(false); | ||
await Console.Error.WriteLineAsync(line).ConfigureAwait(false); | ||
// The file is missing an entry. Mark it as invalid and break the loop as there is no need to continue validating. |
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.
Stopping further validation seems odd, because it means you might not necessarily know the extent of a potential problem.
{ | ||
try | ||
{ | ||
if (!Uri.TryCreate(helpLink, UriKind.Absolute, out var uri)) | ||
{ | ||
return false; | ||
// TODO: why would we not fail this if the URI is invalid? | ||
return (HttpStatusCode.OK, null); |
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.
I feel like this should definitely fail (it did before as well) and not return ok
{ | ||
// Rule with valid documentation link | ||
if (string.IsNullOrWhiteSpace(helpLinkUri)) | ||
continue; |
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.
unless I am misreading this, we will now pass validation if the help link is missing, which isn't what we did before. seems like a missing link should fail validation
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.
Yep, you're right. Will fix.
No description provided.