schemacrawler / SchemaCrawler

Free database schema discovery and comprehension tool
http://www.schemacrawler.com/
Other
1.6k stars 199 forks source link

[Continuous build] Summary improvment #41

Closed mbarre closed 8 years ago

mbarre commented 8 years ago

Hi Sualeh

It tested the 14.07.03 today, it works nice and the result pretty cool.

So we have some new ideas regarding the summary, here is the result we have now:

mars 14, 2016 2:06:07 PM io.github.mbarre.schemacrawler.tool.linter.LinterColumnSize lint
mars 14, 2016 2:06:07 PM io.github.mbarre.schemacrawler.tool.linter.LinterColumnSize lint
mars 14, 2016 2:06:07 PM schemacrawler.tools.iosource.FileOutputResource openNewOutputWriter
INFOS: Opened output writer to file, /media/barmi83/Data/projets/pdc-liquibase/pdc_lints.html
mars 14, 2016 2:06:08 PM schemacrawler.tools.iosource.OutputWriter close
INFOS: Closing output writer
mars 14, 2016 2:06:08 PM schemacrawler.tools.lint.Linters dispatch
INFOS: Too many schema lints were found:
[medium] column with same name but different data types - 4
[medium] foreign key with no index - 87
[high] all data columns are nullable - 25
[medium] incrementing columns - 9
[critical] no primary key - 2
[medium] should have remarks - 75
[medium] spaces in name, or reserved word - 42
[medium] useless surrogate key - 3
[high]  should not have so many duplicates. - 14600
[high] Should be boolean type. - 76
[high] column is oversized regarding its content. - 56
mars 14, 2016 2:06:08 PM schemacrawler.tools.lint.LintDispatch$4 dispatch
GRAVE: Too many schema lints were found
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.886 s
[INFO] Finished at: 2016-03-14T14:06:08+11:00
[INFO] Final Memory: 9M/150M
[INFO] ------------------------------------------------------------------------

Could It be possible to have this :

[INFO] ------------------------------------------------------------------------ 
INFOS: Too many schema lints were found:
[INFO] ------------------------------------------------------------------------
[medium] 4 - column with same name but different data types
[medium] 87 - foreign key with no index
[medium] 9 - incrementing columns
[medium] 75 - should have remarks
[medium] 42 - spaces in name, or reserved word
[medium] 3 - useless surrogate key
[high] 14600 - should not have so many duplicates.
[high] 76 - Should be boolean type.
[high] 56 - column is oversized regarding its content.
[high] 25 - all data columns are nullable
[critical] 2/1 - no primary key
[critical] : 2, [high] : 14757, [medium] : 220
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.886 s
[INFO] Finished at: 2016-03-14T14:06:08+11:00
[INFO] Final Memory: 9M/150M
[INFO] ------------------------------------------------------------------------
  1. Ascendant sort on severity, in order to have the higher severity at the end of the summary and near BUILD FAILURE status
  2. Add a separator at the begining of the summary
  3. Display the threshold when severity is critical
  4. Move the hit number after the severity
  5. Add a summary to the summary displaying the count per severity
  6. Remove some logs like :
mars 14, 2016 2:06:08 PM schemacrawler.tools.lint.LintDispatch$4 dispatch

I have also some others questions :

I was thinking that the summary will be activated for all the linters, but I realized that only linter with

<config>
    <dispatch>terminate_system</dispatch>
    <dispatch-threshold>1</dispatch-threshold>
</config>

appears in the summary.

Is it possible to have it actived for all linter ? And only put severity level to critical and add the <config></config> if we need the build to fail.

If I don't set the loglevel the summary doesn't appears. I have to set loglevel to INFO, but a lot of other logs appears. Is there a loglevel for which only the summary appears ?

Thanks for what you've done, it really rocks :) I am looking forward your responses.

schemacrawler commented 8 years ago

Thanks for the feedback, Michele. I will take a look, and make some changes. I may not make all of the changes, though - we can discuss.

schemacrawler commented 8 years ago

The following line is printed by Maven, not SchemaCrawler.

[INFO] ------------------------------------------------------------------------ 
adriens commented 8 years ago

I may not make all of the changes, though - we can discuss

sure ;-p

schemacrawler commented 8 years ago

Please use SchemaCrawler 14.07.04. Follow the instructions on the website, since the configuration and command-line have changed.

mbarre commented 8 years ago

Great news ! I'll test it tomorrow and let you know :)

Thanks :+1:

adriens commented 8 years ago

@mbarre : ou have the deb waiting for you for the R&D day tomorrow ;-D

mbarre commented 8 years ago

perfect ! Thanks ;)

adriens commented 8 years ago

Sharingsome inspiration about the lint summary :+1:

https://junit-team.github.io/junit5/#console-runner

Test execution started. Number of static tests: 2
Engine started: junit5
Test started:     My 1st JUnit 5 test! 😎 [junit5:com.example.project.FirstTest#myFirstTest(java.lang.String)]
Test succeeded:   My 1st JUnit 5 test! 😎 [junit5:com.example.project.FirstTest#myFirstTest(java.lang.String)]
Test skipped:     mySecondTest [junit5:com.example.project.SecondTest#mySecondTest()]
                  => Exception:   Skipped test method [void com.example.project.SecondTest.mySecondTest()] due to failed condition
Engine finished: junit5
Test execution finished.

Test run finished after 29 ms
[         2 tests found     ]
[         1 tests started   ]
[         1 tests skipped   ]
[         0 tests aborted   ]
[         1 tests successful]
[         0 tests failed    ]
adriens commented 8 years ago

What's interesting is the left padding to keep comments and datas alignment to make them more readable

schemacrawler commented 8 years ago

Adrien, Michele - did you get a chance to try out the new lint summary?

mbarre commented 8 years ago

@sualeh I tried the lint summary this morning, the result is really fine !

We still have some suggestions we have to discuss with Adrien before going back to you. Maybe we'll do a PR to avoid to annoy with very little things.

Thanks.

schemacrawler commented 8 years ago

Glad that it is working for you.

On Fri, Mar 18, 2016 at 12:02 AM, Michèle notifications@github.com wrote:

@sualeh https://github.com/sualeh I tried the lint summary this morning, the result is really fine !

We still have some suggestions we have to discuss with Adrien before going back to you. Maybe we'll do a PR to avoid to annoy with very little things.

Thanks.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/sualeh/SchemaCrawler/issues/41#issuecomment-198198212