Skip to content

Conversation

bodom91
Copy link
Contributor

@bodom91 bodom91 commented Aug 1, 2017

Sorry for my delay.

@bodom91 bodom91 force-pushed the Admin_daily_report branch from dbcab17 to 95b68b0 Compare August 1, 2017 11:59
@bodom91 bodom91 requested a review from php-coder August 1, 2017 12:27
Copy link
Owner

@php-coder php-coder left a comment

Choose a reason for hiding this comment

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

Thank you! I've added many comments but they're mostly minor improvements. Overall it looks good!

Could you also rebase your changes against the latest master?

<a th:href="@{${SITE_EVENTS_PAGE}}" th:text="#{t_watch_suspicious_activities}" href="events.html">view suspicious activities</a>
</li>
<li sec:authorize="hasAuthority('VIEW_DAILY_STATS')">
<a th:href="@{${DAILY_STATISTICS}}" th:text="#{t_daily_statistics}" href="../report/daily">view daily statistics</a>
Copy link
Owner

Choose a reason for hiding this comment

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

Because we don't have report/daily page then let's use href="javascript:void(0)" here.

);
report.setMissingCsrfCounter(missingCsrfCounter);

Copy link
Owner

Choose a reason for hiding this comment

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

Could you remove these whitespace-only changes?

private final MailService mailService;
private final CronService cronService;

@RequestMapping(Url.DAILY_STATISTICS)
Copy link
Owner

Choose a reason for hiding this comment

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

@RequestMapping -> @GetMapping

public ReportController getReportController() {
return new ReportController(
servicesConfig.getMailService(),
servicesConfig.getCronService()
Copy link
Owner

Choose a reason for hiding this comment

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

Reduce indentation for this line, please.

public static final String INDEX_PAGE = "/";
public static final String ROBOTS_TXT = "/robots.txt";
public static final String SITEMAP_XML = "/sitemap.xml";

Copy link
Owner

Choose a reason for hiding this comment

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

Avoid white-space only changes where it's possible.

);
printWriter.println(stats);
} catch (IOException e) {
LOG.error("Can't get Daily Reports", e.getMessage());
Copy link
Owner

Choose a reason for hiding this comment

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

s/Daily Reports/daily report/

private final CronService cronService;

@RequestMapping(Url.DAILY_STATISTICS)
public void adminDailyReport(HttpServletResponse response) {
Copy link
Owner

Choose a reason for hiding this comment

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

s/adminDailyReport/showDailyReport/

response.setCharacterEncoding("UTF-8");

try {
PrintWriter printWriter = response.getWriter();
Copy link
Owner

Choose a reason for hiding this comment

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

s/printWriter/writer/

cronService.getDailyStatistics()
);
printWriter.println(stats);
} catch (IOException e) {
Copy link
Owner

Choose a reason for hiding this comment

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

s/e/ex/

private final MailService mailService;
private final CronService cronService;

@RequestMapping(Url.DAILY_STATISTICS)
Copy link
Owner

Choose a reason for hiding this comment

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

Could you test for me the following (inspired by https://stackoverflow.com/a/7672903/352708):

Does it work the same as the current approach?

…d: port to Robot Framework.

Addressed to php-coder#530

No functional changes.
…d: port to Robot Framework.

Addressed to php-coder#530

No functional changes.
I don't want to port it to Robot Framework because
a) it will be hard
b) now I don't think that this check was so useful
php-coder and others added 18 commits August 2, 2017 12:33
Prior this change it was failing with the following error:
/home/travis/.travis/job_stages: line 567: expected `)'
/home/travis/.travis/job_stages: line 567: syntax error near `-a'
/home/travis/.travis/job_stages: line 567: `  if [[ ($TRAVIS_BRANCH = prod) && ("$SPRING_PROFILES_ACTIVE" = "travis" -a "$TRAVIS_PULL_REQUEST" = "false") ]]; then'

Correction for d5289a4 commit.
I don't want to port it to the Robot Framework because I'm trying to make tests to test a behavior
instead of the pages state.

No functional changes.
This reverts commit 08bb9a4.

Reverting this change won't harm but it's possible that it solves
"Cannot find a merge base between danger_base and danger_head" error
from Danger.
…e between danger_base and danger_head" error."

This reverts commit f0db775.
…t modified.

Now the checks will be run only when the files with the following patterns were modified:

- sortpom:    pom.xml
- enforcer:   pom.xml
- checkstyle: pom.xml, *.java, *.properties, checkstyle.xml, checkstyle-suppressions.xml
- findbugs:   pom.xml, *.java, findbugs-filter.xml
- pmd:        pom.xml, *.java, pmd.xml
- unit tests: pom.xml, *.java, *.groovy
- license:    pom.xml, *.java, *.groovy, license_header.txt
- codenarc:   pom.xml, *.groovy
- jasmine:    pom.xml, *.js
- rflint:    .travis.yml, *.robot
- bootlint:  .travis.yml *.html
- html5validator: .travis.yml *.html

Integration tests are executed always.

Fix php-coder#423
…upport.beanvalidation

Addressed to php-coder#591

No functional changes.
Should be in ba82718 commit.

No code changes.
Should be in ba82718 commit.

No code changes.
@php-coder
Copy link
Owner

@bodom91 Looks like you tried to use rebase but did it wrong. Typically it should be about 3 steps to refresh a working branch:

  1. git fetch upstream # fetch new changes from php-coder repo
  2. git checkout master && git merge upstream/master # merge changes from php-coder's master branch into your local master branch
  3. git rebase master your_branch # rebase your_branch on top of master branch

* @author Maxim Shestakov
*/
@Controller
@RestController
Copy link
Owner

Choose a reason for hiding this comment

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

Let's use @Controller.

} catch (IOException ex) {
LOG.error("Can't get daily report", ex.getMessage());
}
@GetMapping(value = Url.DAILY_STATISTICS, produces = {"text/plain; charset=UTF-8"})
Copy link
Owner

Choose a reason for hiding this comment

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

-@GetMapping(value = Url.DAILY_STATISTICS, produces = {"text/plain; charset=UTF-8"})
+@GetMapping(path = Url.DAILY_STATISTICS, produces = "text/plain; charset=UTF-8")

}

private String getTextOfDailyStatisticsMail(AdminDailyReport report) {
public String getTextOfDailyStatisticsMail(AdminDailyReport report) {
Copy link
Owner

Choose a reason for hiding this comment

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

Please, add @Override annotation to this method.

Copy link
Owner

Choose a reason for hiding this comment

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

Also this method should be placed before private methods.

LOG.error("Can't get daily report", ex.getMessage());
}
@GetMapping(value = Url.DAILY_STATISTICS, produces = {"text/plain; charset=UTF-8"})
@ResponseBody
Copy link
Owner

Choose a reason for hiding this comment

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

Just for your information: @RestController is essentially the same as @Controller and @ResponseBody. Having both is superfluous.

@bodom91
Copy link
Contributor Author

bodom91 commented Aug 2, 2017

I did it
git fetch upstream # fetch new changes from php-coder repo
git checkout master && git merge upstream/master # merge changes from php-coder's master branch into your local master branch
git rebase master your_branch # rebase your_branch on top of master branch
But still have problem with PR ....
What's wrong ??

@mystamps-bot
Copy link

3 Errors
🚫 maven-checkstyle-plugin error in src/main/resources/ru/mystamps/i18n/Messages_ru.properties#L0:
Key ‘»»»>’ missing
🚫 license-maven-plugin reported about 1 error:

Please, fix it by executing mvn license:format
See also: https://github.com/php-coder/mystamps/wiki/check-license-header

🚫 danger check: pull request contains merge commits! Please, rebase your branch to get rid of them: git rebase master Admin_daily_report and git push --force-with-lease
2 Warnings
⚠️ danger check: pull request description doesn’t contain a link to original issue.
Consider adding a comment in the following format: Addressed to #XXX where XXX is an issue number
⚠️ danger check: branch Admin_daily_report does not comply with our best practices. Branch name should use the following scheme: ghXXX_meaningful-name where XXX is an issue number. Next time, please, use this scheme :)
1 Message
📖 maven-checkstyle-plugin reported about 1 error. Please, fix it. See also: https://github.com/php-coder/mystamps/wiki/checkstyle

Generated by 🚫 Danger

@bodom91 bodom91 closed this Aug 2, 2017
@bodom91 bodom91 deleted the Admin_daily_report branch August 2, 2017 12:28
@php-coder
Copy link
Owner

But why? You can just push with --force to the existing branch and rewrite its content. Please, avoid creating a new PR and use the existing branch/PR.

@php-coder
Copy link
Owner

php-coder commented Aug 2, 2017

But still have problem with PR .... What's wrong ??

I see that your master is OK. And I can't see what was in the Admin_daily_report branch because you've removed it.

@php-coder
Copy link
Owner

Superseded by #618

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants