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

feat: Implement updated pull request comments (HTML and MD) #578

Merged
merged 2 commits into from
Aug 30, 2024

Conversation

o-kopysov
Copy link
Collaborator

Pull Request

Description

The current PR contains significant updates on the pull request comments.
Changes cover HTML and MD comment formats.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code cleanup/refactoring
  • Documentation update
  • This change requires a documentation update
  • CI system update
  • Test Coverage update

Testing

Tested on the local environment.
Test PR: o-kopysov#2

Short view:
image

Full view:
image

Checklist:

  • My code follows the style guidelines of this project
  • My code meets the required code coverage for lines (90% and above)
  • My code meets the required code coverage for branches (80% and above)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@o-kopysov o-kopysov added the enhancement New feature or request label Aug 28, 2024
@o-kopysov o-kopysov added this to the v2.0.0 milestone Aug 28, 2024
@o-kopysov o-kopysov self-assigned this Aug 28, 2024
@codecov-commenter
Copy link

codecov-commenter commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 97.60000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 93.74%. Comparing base (ccc06c1) to head (c391e04).

Files with missing lines Patch % Lines
...java/com/lpvs/entity/report/LPVSReportBuilder.java 98.31% 0 Missing and 2 partials ⚠️
.../main/java/com/lpvs/service/LPVSGitHubService.java 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #578      +/-   ##
============================================
+ Coverage     93.57%   93.74%   +0.16%     
- Complexity      583      602      +19     
============================================
  Files            49       49              
  Lines          2009     2110     +101     
  Branches        234      244      +10     
============================================
+ Hits           1880     1978      +98     
- Misses           59       60       +1     
- Partials         70       72       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -362,7 +338,7 @@ public void commentResults(
webhookConfig.getHeadCommitSHA(),
GHCommitState.SUCCESS,
null,
"No license issue detected",
"No license issue(s) detected",
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the above code, there is message: "No license issue detected" (line 335). With this message, they are a little bit different. But in the above code, there are messages:
"Potential license problem(s) detected" (line 323)
"Potential license problem(s) detected" (line 329)
So maybe it will be more consistency to use the same style for all messages: "No license(s) issue detected"

Also, another question, is it normal that we use "problem" in one case and "issue" in another?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you for the comment. I've updated all messages.

t-naumenko
t-naumenko previously approved these changes Aug 28, 2024
Copy link
Collaborator

@t-naumenko t-naumenko left a comment

Choose a reason for hiding this comment

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

Great improvement!

.append("\n")
.append(generateLicenseTable(detectedLicenseInfo, webhookConfig, vcs))
.append("\n");
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe add else { log.error ("empty scan result"} ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's normal when scanResults = null (no licenses detected: 95% of all scans have such a situation).

@o-kopysov o-kopysov requested a review from m-rudyk August 28, 2024 07:47
@o-kopysov
Copy link
Collaborator Author

@tiokim Do you have any comments regarding this PR?

Copy link
Collaborator

@o-konoval o-konoval left a comment

Choose a reason for hiding this comment

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

Great work, approved!

@o-kopysov o-kopysov merged commit 006047b into main Aug 30, 2024
10 checks passed
@o-kopysov o-kopysov deleted the update-comment-pr branch August 30, 2024 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants