-
Notifications
You must be signed in to change notification settings - Fork 26
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
fix: remove PR if max attempt reached #430
fix: remove PR if max attempt reached #430
Conversation
Signed-off-by: Mykola Rudyk <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #430 +/- ##
============================================
- Coverage 90.93% 90.81% -0.13%
Complexity 489 489
============================================
Files 47 47
Lines 1743 1731 -12
Branches 209 207 -2
============================================
- Hits 1585 1572 -13
- Misses 94 97 +3
+ Partials 64 62 -2 ☔ View full report in Codecov by Sentry. |
f5e3ecd
to
a778ef6
Compare
Signed-off-by: Mykola Rudyk <[email protected]>
a778ef6
to
c9ce786
Compare
345fda7
to
d755b30
Compare
for (LPVSQueue webhook : webhookConfigList) { | ||
log.info("PROCESSING WebHook id = " + webhook.getId()); | ||
if (webhook.getAttempts() > maxAttempts) { | ||
if (webhook.getAttempts() < maxAttempts) { |
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.
Why "<"?
This is the processing of the case when webhook.getAttempts() > maxAttempts.
And I think we don't need this code here.
LPVSPullRequest pullRequest = new LPVSPullRequest(); | ||
pullRequest.setPullRequestUrl(webhook.getPullRequestUrl()); | ||
pullRequest.setUser(webhook.getUserId()); |
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 webhook processing should be added to exception processing before delete().
d755b30
to
c1b015d
Compare
delete(webhookConfig); | ||
int currentAttempts = webhookConfig.getAttempts(); | ||
if (currentAttempts < maxAttempts) { | ||
webhookConfig.setAttempts(currentAttempts++); |
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.
currentAttempts++ increases value after execution setAttempts.
Please use currentAttempts+1 instead.
4887195
to
bb9f086
Compare
@@ -258,20 +225,36 @@ public void processWebHook(LPVSQueue webhookConfig) { | |||
log.debug("Creating comment"); | |||
gitHubService.commentResults(webhookConfig, files, detectedConflicts, pullRequest); | |||
log.debug("Results posted on GitHub"); | |||
delete(webhookConfig); | |||
} else { | |||
log.warn("Files are not found. Probably pull request is not exists."); | |||
gitHubService.commentResults(webhookConfig, null, null, pullRequest); | |||
delete(webhookConfig); |
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 delete is incorrect. Please remove it.
f283360
to
bf7fd83
Compare
88ec88d
to
3da70e6
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.
LGTM
Signed-off-by: Mykola Rudyk <[email protected]>
3da70e6
to
97d15c0
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.
Verified.
Pull Request
Description
Add increment to Queue processing, when PR processing interrupted, it should be kept in queue until max scanning attempts reached.
Type of change
Please delete options that are not relevant.
Testing
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
Test Configuration:
Checklist: