-
-
Notifications
You must be signed in to change notification settings - Fork 201
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
Avoid storing lints in catalog #1750
Comments
I use this method in my new test extension (will be open sourced in the next few months) to check for new lints after each flyway migration. So I remove all known lints from the new result to get the difference. My current solution has some boilerplate and produces footprints at the catalog instance which I don't like as the catalog is also used for asserts with assertj-schemacrawler to check the schema changes after migration. |
@bekoenig How about if we nested the catalog and table lints as an attribute called {"schemacrawler.lint" = Map<String, Object>}. The inner map would contain the lints as usual. I could add a method to clear lints, which would simply remove the "schemacrawler.lint" attribute on the catalog and all tables. Will that work for you - a new method to clear lints? |
Hi @sualeh, thank you for your quick feedback! Your suggestion would work, but my idea is more api related. My current solution looks like:
My suggestion would be:
Greetings, |
Ok. I have started on a fix in the |
@bekoenig @JohReher - Please take a look at the code I just merged into main - 2bf6e86 It contains:
You will be using the lint report rather than the lint collector, but you will have the same functionality. I will release this as soon as I finish up the other work I want to get into the next release. |
Hi @sualeh, thank you very much for your improvements. You will get feedback in the next few days. Greetings, |
Hi @sualeh, here is my promised feedback after refactoring from version 16.22.3 to 16.23.1: I like your changes, but now there are no possibilities to filter known lints after linting process to create a report with new lints. LintReportGenerator needs an instance of LinterReport which boxes all lints. Constructor of LinterReport ist private and array with lints can't be mutated. My current workaround is to use the three parameter constructor of LinterReport by reflection. Greetings, P.S.: Some other change, which is not related to this issue is that getCrawlInfo in BaseLinter is removed. I used this method to implement generic rules which effects only specific database systems (like db2luw). |
@bekoenig Thanks for your feedback.
If I am not understanding your use case, please provide some pseudo code like you did earlier. Or, please share your working copy of the assertj-schemacrawer library. |
Meaning, are you writing a custom linter that needs the crawl info? If yes, then I can add it back in. Please let me know. |
Yes. By default all of our custom linters are enabled, but some linters are only needed for specific database systems. |
Got it. I will add that back in, or something similar. |
This issue is not related to assertj-schemacrawler. |
@bekoenig I have introduced a lint report builder. This may be a little clumsy for you to use, but I have done this so that the lint report presents an immutable face, which I prefer. I will release a new version of SchemaCrawler soon. |
Allow custom lint reports to be created (see #1750)
Works perfect. Thank you very much. |
Description
Calling Linters#lint from java is confusing. In first expectation this method should returns all found lints. But this method has a side effect in which all lints are stored in the catalog root and each table. So the caller has to replicate the object key (private constant), get all lints from the nodes and reset the catalog to get the original state.
How to Reproduce
No response
Relevant log output
No response
SchemaCrawler Version
16.22.3
Java Version
21
Operating System and Version
Win 10
Relational Database System and Version
DB2LUW 11.5
JDBC Driver and Version
current
The text was updated successfully, but these errors were encountered: