-
Notifications
You must be signed in to change notification settings - Fork 34
Gh897 refactoring extract change status class #1003
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
Gh897 refactoring extract change status class #1003
Conversation
Generated by 🚫 Danger |
@KrivenkoAlexander #1004 has been fixed but it doesn't take an action here because your branch doesn't contain this fix. Could you fetch new changes from my master and rebase your branch on top of updated master? Let me know if you need help with that, but typically these commands work: $ git checkout master
$ git fetch upstream
$ git merge upstream/master
$ git rebase master gh897_refactoring_extract_changeStatus_class
$ git push --force-with-lease |
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.
Thank you for the pull request!
I left my comments. Also, after rebase, a bot will complain on small issues. Please, take a look and fix them.
src/main/java/ru/mystamps/web/feature/series/importing/JdbcSeriesImportDao.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/mystamps/web/feature/series/importing/SeriesImportServiceImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/mystamps/web/feature/series/importing/UpdateImportRequestStatusDbDto.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/mystamps/web/feature/series/importing/UpdateImportRequestStatusDbDto.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/mystamps/web/feature/series/importing/UpdateImportRequestStatusDbDto.java
Outdated
Show resolved
Hide resolved
src/test/groovy/ru/mystamps/web/feature/series/importing/SeriesImportServiceImplTest.groovy
Outdated
Show resolved
Hide resolved
src/test/groovy/ru/mystamps/web/feature/series/importing/SeriesImportServiceImplTest.groovy
Outdated
Show resolved
Hide resolved
src/test/groovy/ru/mystamps/web/feature/series/importing/SeriesImportServiceImplTest.groovy
Outdated
Show resolved
Hide resolved
src/test/groovy/ru/mystamps/web/feature/series/importing/SeriesImportServiceImplTest.groovy
Outdated
Show resolved
Hide resolved
Complains from FindBugs you can exclude for now. See example: mystamps/src/main/config/findbugs-filter.xml Lines 81 to 84 in c4eed77
|
a7c1130
to
dfee630
Compare
@KrivenkoAlexander Could you update master and rebase your branch again, please? I've edited this file also and this change produces a conflict. :-| |
*/ | ||
package ru.mystamps.web.feature.series.importing; | ||
|
||
|
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.
Please, remove one extra line here.
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.
done
47c0b8d
to
7b28a38
Compare
src/main/java/ru/mystamps/web/feature/series/importing/SeriesImportServiceImpl.java
Show resolved
Hide resolved
src/test/groovy/ru/mystamps/web/feature/series/importing/SeriesImportServiceImplTest.groovy
Outdated
Show resolved
Hide resolved
src/test/groovy/ru/mystamps/web/feature/series/importing/SeriesImportServiceImplTest.groovy
Outdated
Show resolved
Hide resolved
src/test/groovy/ru/mystamps/web/feature/series/importing/SeriesImportServiceImplTest.groovy
Outdated
Show resolved
Hide resolved
src/test/groovy/ru/mystamps/web/feature/series/importing/SeriesImportServiceImplTest.groovy
Outdated
Show resolved
Hide resolved
src/test/groovy/ru/mystamps/web/feature/series/importing/SeriesImportServiceImplTest.groovy
Outdated
Show resolved
Hide resolved
src/test/groovy/ru/mystamps/web/feature/series/importing/SeriesImportServiceImplTest.groovy
Outdated
Show resolved
Hide resolved
See errors from codenarc, plus my comments, plus squash all the commits into one (see a link in the message from a bot). |
P.S. Please, ping me when it will be ready for review/merge. |
7b28a38
to
192187c
Compare
Codecov Report
@@ Coverage Diff @@
## master #1003 +/- ##
============================================
+ Coverage 75.95% 75.97% +0.01%
Complexity 487 487
============================================
Files 37 37
Lines 1539 1540 +1
Branches 197 197
============================================
+ Hits 1169 1170 +1
Misses 354 354
Partials 16 16
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #1003 +/- ##
============================================
+ Coverage 75.95% 75.97% +0.01%
Complexity 487 487
============================================
Files 37 37
Lines 1539 1540 +1
Branches 197 197
============================================
+ Hits 1169 1170 +1
Misses 354 354
Partials 16 16
Continue to review full report at Codecov.
|
@@ -101,7 +101,7 @@ class SeriesImportServiceImplTest extends Specification { | |||
ex.message == 'User id must be non null' | |||
} | |||
|
|||
def 'addRequest() should throw exception if url is incorrect'() { | |||
def 'addRequest() should throw exception if url is incorrect'() { |
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.
Could you revert the change in this line? Indentation should stay intact.
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.
done
@@ -367,7 +366,7 @@ class SeriesImportServiceImplTest extends Specification { | |||
IllegalArgumentException ex = thrown() | |||
ex.message == 'Request id must be non 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.
Please, don't change anything unrelated to your fix.
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.
done
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.
Still see it there btw.
expectedRequestId, | ||
{ Date date -> | ||
assert DateUtils.roughlyEqual(date, new Date()) | ||
1 * seriesImportDao.changeStatus { UpdateImportRequestStatusDbDto status -> |
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.
status ->
Could you remove double space here?
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.
done
expectedOldStatus, | ||
expectedNewStatus | ||
) | ||
1 * seriesImportDao.changeStatus { UpdateImportRequestStatusDbDto status -> |
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.
In order to be consistent with other code, could you use brackets so the invocation will look close to the function invocation? It should be fixed in this case and others that you've modified. In other words, please, replace
1 * class.method { Dto dto ->
...
}
by
1 * class.method({ Dto dto ->
...
})
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 did so just to resolve the codenarch violations. Take a look at
CodeNarcRunner [main] DEBUG - results=DirectoryResults(null) [DirectoryResults() [DirectoryResults(ru) [DirectoryResults(ru/mystamps) [DirectoryResults(ru/mystamps/web) [DirectoryResults(ru/mystamps/web/util) [], DirectoryResults(ru/mystamps/web/feature) [DirectoryResults(ru/mystamps/web/feature/series) [DirectoryResults(ru/mystamps/web/feature/series/sale) [], DirectoryResults(ru/mystamps/web/feature/series/importing) [DirectoryResults(ru/mystamps/web/feature/series/importing/sale) [], FileResults(ru/mystamps/web/feature/series/importing/SeriesImportServiceImplTest.groovy) [Violation[rule=ClosureAsLastMethodParameterRule[name=ClosureAsLastMethodParameter, priority=3], lineNumber=321, sourceLine=1 * seriesImportDao.changeStatus ({ UpdateImportRequestStatusDbDto status ->, message=Violation in class ru.mystamps.web.feature.series.importing.SeriesImportServiceImplTest. The last parameter to the 'changeStatus' method call is a closure an can appear outside the parenthesis], Violation[rule=ClosureAsLastMethodParameterRule[name=ClosureAsLastMethodParameter, priority=3], lineNumber=412, sourceLine=1 * seriesImportDao.changeStatus ({ UpdateImportRequestStatusDbDto status ->, message=Violation in class ru.mystamps.web.feature.series.importing.SeriesImportServiceImplTest. The last parameter to the 'changeStatus' method call is a closure an can appear outside the parenthesis], Violation[rule=ClosureAsLastMethodParameterRule[name=ClosureAsLastMethodParameter, priority=3], lineNumber=568, sourceLine=1 * seriesImportDao.changeStatus ({ UpdateImportRequestStatusDbDto status ->, message=Violation in class ru.mystamps.web.feature.series.importing.SeriesImportServiceImplTest. The last parameter to the 'changeStatus' method call is a closure an can appear outside the parenthesis]]]], DirectoryResults(ru/mystamps/web/feature/collection) [], DirectoryResults(ru/mystamps/web/feature/category) [], DirectoryResults(ru/mystamps/web/feature/participant) [], DirectoryResults(ru/mystamps/web/feature/image) [], DirectoryResults(ru/mystamps/web/feature/account) [], DirectoryResults(ru/mystamps/web/feature/country) []], DirectoryResults(ru/mystamps/web/service) []]]]]]
it is saying to me that we have 3 violation .
[INFO] totalPriority1Violations is 0 [INFO] totalPriority2Violations is 0 [INFO] totalPriority3Violations is 3
I am afraid that build won't pass because of it . Am i wrong?
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.
Thank you, I got it now.
Yes, we have to turn off this warnings with an annotation. See example:
mystamps/src/test/groovy/ru/mystamps/web/feature/series/importing/SeriesImportServiceImplTest.groovy
Line 115 in 5cbd398
@SuppressWarnings(['ClosureAsLastMethodParameter', 'UnnecessaryReturnKeyword']) |
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 see, i've done. Thanks
SeriesImportRequestStatus.PARSING_SUCCEEDED | ||
) | ||
} | ||
|
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.
One more extra line should be removed.
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.
done
Some minor formatting issues and I think we I will merge it :) Thank you for your patience! |
192187c
to
248b985
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.
Looks good to me, thank you! I'll merge it tonight (with or without 2 tiny whitespace-related changes).
Sounds good to me :) It is worth to celebrate it , definitely . Thanks
you. If you don't mind i will continue to work :) I need learn groovy a
little bit and spock frame work . I haven't worked with them before.
ср, 13 февр. 2019 г. в 15:58, Slava Semushin <[email protected]>:
… ***@***.**** approved this pull request.
Looks good to me, thank you! I'll merge it tonight (with or without 2 tiny
whitespaced-related changes).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1003 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKy3b_eJVQRmOC4AGG575SWQGDYMhbhjks5vNAv-gaJpZM4ays29>
.
--
С уважением, Кривенко Александр!
[email protected]
skype wyrik88
|
Yes, sure. Let me know when you will be ready for the next task then.
Only if it's interested to you because in this project we don't have code that is more complicated than you have seen already. |
P.S. These links could be useful to you: |
Hi.Thank you for link that you sent me. I will look at them. You can send me tasks as soon as possible. I will familiarise with it. Understanding and clarification the tasks can take time. That why it better ti start as soon as possible.
About groovy: yes, i want to clarify some basics for myself to save time in future work.
Thanks.
--
Отправлено из myMail для Android среда, 13 февраля 2019г., 17:12 +03:00 от Slava Semushin [email protected] :
…>If you don't mind i will continue to work :)
Yes, sure. Let me know when you will be ready for the next task then.
>I need learn groovy a little bit and spock frame work .
Only if it's interested to you because in this project we don't have code that is more complicated than you have seen already.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub , or mute the thread .
|
Merged in e32b74c commit. |
@KrivenkoAlexander Thank you one more time for the contribution! 🥇 I've added you to the board: https://github.com/php-coder/mystamps/wiki/team-members :) Also here is the steps to follow after merging PRs: https://github.com/php-coder/mystamps/wiki/after_merge_steps See you in the next tasks! ;-) |
Addressed to #897