schemacrawler / SchemaCrawler

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

Question > Schemacrawler Lint and continuous integration #30

Closed adriens closed 8 years ago

adriens commented 8 years ago

Context

We are using continuous quality check and integration on an always increasing number of projects, but this essentially applies to code (Java code). This is done by Travis.

In my everyday job, i have to pass lints on our integrations databases that are generated by liquibase. Hence we make database reviews on the html exported version of the lints.

The idea

What i begin to think about and would save a lot of time to me is : to run lint on commit event on gh, on Travis and call lint execution that would return an error status code when two many high are triggered, or based on certain lint filtering conditions. This would be a huge advantage on continuous integration of our databases... and could be interest a lot of people as it would save so much time ! The lint could even generate Junit like xml files so the "testCase" could be imported in unit testing tools for example, and give a database cover status like indicator.

The approaches

The first idea i had was to trigger a maven build as it is a popular build tool, and in the same tech as schemacrawler. We could launch a

mvn schemacrawler:lint

... and would throw required exit status code... and generate the lint report in and unitesting format for example ? What do you think about this approach ? Does some piece of schemcrawler software already do the job.

schemacrawler commented 8 years ago

Let me think about this.

adriens commented 8 years ago

:+1:

adriens commented 8 years ago

Hi @sualeh did you think about it these last days ? At least on an approach ?.. si we could talk about it together ?.. and maybe even create a small POC ?

adriens commented 8 years ago

@sualeh : in which release shall i find the aditional main method to call lints please ?

schemacrawler commented 8 years ago

You will be able to do this in the next release. Will that work?

<schemacrawler-linter-configs>
  <linter id="schemacrawler.tools.linter.LinterTableWithNoIndexes">
    <config>
      <severity>critical</severity>
      <dispatch>terminate_system</dispatch>
      <dispatch-threshold>1</dispatch-threshold>
    </config>
  </linter>
</schemacrawler-linter-configs>