-
Notifications
You must be signed in to change notification settings - Fork 44
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
[CI] Attempts to avoid break when diff consists of one whitespace only #244
Conversation
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.
clang-tidy
in the new code
clang-format
found formatting issues in the code submitted.:warning:
Make sure to run clang-format and update this pull request.
(1/1)
5ecee06
to
124a174
Compare
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.
clang-tidy
in the new code
clang-format
found formatting issues in the code submitted.:warning:
Make sure to run clang-format and update this pull request.
(1/1)
... diff consists of one whitespace only
124a174
to
8552fcc
Compare
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.
clang-tidy
in the new code
clang-format
found formatting issues in the code submitted.:warning:
Make sure to run clang-format and update this pull request.
(1/1)
DistroLauncher/ini_find_value.cpp
Outdated
|
||
|
||
|
||
|
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.
Clang-format suggestion below:
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.
We had previous crashes due to code changes like that.
DistroLauncher/ini_find_value.cpp
Outdated
} | ||
|
||
return false; | ||
return false; |
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.
Clang-format suggestion below:
return false; | |
return false; |
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.
clang-tidy
in the new code
clang-format
found formatting issues in the code submitted.:warning:
Make sure to run clang-format and update this pull request.
(1/1)
@@ -90,7 +90,7 @@ namespace Oobe | |||
} // namespace. | |||
|
|||
SplashEnabledStrategy::SplashEnabledStrategy() : splashExePath{splashPath()} | |||
{ } | |||
{ } |
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.
Clang-format suggestion below:
{ } | |
{ | |
} |
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 is exactly equal to the source change that caused the last crash.
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.
Great!
btw is this code unique to Ubuntu WSL? If so, no further comments. Otherwise, we should also patch upstream.
That's unique to Ubuntu WSL. I think this piece that generates comments from a diff has a very interesting potential, but for now it's only used here. |
Sometimes we fail to follow the formatting convention due to whitespaces and new lines only. In such cases CI fails to generate GitHub PR comments with the following validation error message:
It seems that the
start_line
andline
fields of a comment object must not be the same otherwise, the invariantstart line must precede the end line
will not hold.This is somewhat an educated guess, because the comment object documentation is not very clear on that.
This PR aims to make sure that invariant holds by not including the
start_line
field when it's equal toline
and further manipulation of the diff hunk target line contents to ensure we always ends with a new line if not empty.Only commit e36ea7f is relevant code wise.
In order to demonstrate that this is behaving as expected, commits 8552fcc and 8c47a0c were created simulating the typical formatting errors that caused crashes before. The results are manifested in the github-actions-bot comments that can be seen below. The last commit just reverts those two.