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

[MENFORCER-398] show rules processed #175

Merged
merged 1 commit into from Jul 31, 2022

Conversation

raupachz
Copy link
Contributor

Hi there,

this fixes MENFORCER-398. It is a simple one line change. Turning on DEBUG already logs what rules are processed. Since most people probably run Maven in default settings they won't see the rules processed. Changing the log level from DEBUG to INFO allows everyone to see the rule processed.

This is an up-for-grabs issue. Feedback welcome.

  • Make sure there is a JIRA issue filed
    for the change (usually before you start working on it). Trivial changes like typos do not
    require a JIRA issue. Your pull request should address just this issue, without
    pulling in other changes.

  • Each commit in the pull request should have a meaningful subject line and body.

  • Format the pull request title like [MENFORCER-XXX] - Fixes bug in ApproximateQuantiles,
    where you replace MENFORCER-XXX with the appropriate JIRA issue. Best practice
    is to use the JIRA issue title in the pull request title and in the first line of the
    commit message.

  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.

  • Run mvn clean verify to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.

  • You have run the integration tests successfully (mvn -Prun-its clean verify).

  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004

Copy link
Member

@slawekjaranowski slawekjaranowski left a comment

Choose a reason for hiding this comment

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

it will be appreciated to add simple assertion in one of existing it test, to see how it is look

@@ -187,7 +187,7 @@ public void execute()
// store the current rule for
// logging purposes
currentRule = rule.getClass().getName();
log.debug( "Executing rule: " + currentRule );
log.info( "Executing rule: " + currentRule );
Copy link
Member

Choose a reason for hiding this comment

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

Rule is executed in line 199, we will have such message even when rule will not be executed in case of cache.

Is it what we want?

@slawekjaranowski slawekjaranowski self-assigned this Jul 29, 2022
@slawekjaranowski
Copy link
Member

Please also put issue number in square brackets in commit message and PR title

@raupachz raupachz changed the title MENFORCER-398 show rules processed [MENFORCER-398] show rules processed Jul 29, 2022
@raupachz
Copy link
Contributor Author

Thanks for the feedback @slawekjaranowski !

I updated the pull request accordingly.

  • the commit message now has the issue number in square brackets and I added the PR title
  • moved the log.info message right bevor the execute method. (Sorry, I was not aware of cache)
  • Added an assertion in testEnforceMojo

@slawekjaranowski slawekjaranowski merged commit b61b6b8 into apache:master Jul 31, 2022
@slawekjaranowski
Copy link
Member

@raupachz thanks

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