All checks unexpectedly pass when database is unavailable
I just found out that I set up our CI incorrectly (my bad!), and there was no database connection available when running our database_consistency checks.
So I was surprised to find that CI passed! This is because every model is ignored, and therefore bundle exec database_consistency exits with 0 i.e. successfully.
Loaded configurations: .database_consistency.yml
ApplicationRecord doesn't have active connection: ignoring
User doesn't have active connection: ignoring
Product doesn't have active connection: ignoring
...
I think it would be better if the checks fail when there's unexpectedly no connection at all, so that CI doesn't give false reassurances!
I researched a bit and found https://github.com/djezzzl/database_consistency/pull/213 but I'm not sure what the motivation was for ignoring disconnected models, so I'm not sure how to balance the two situations.
Hi @gravitystorm,
There is no balance; it is only preference, I guess. We may introduce a configuration that changes the behavior, but it's an open question that should be defaulted.
Would you like to introduce such?
Hi @gravitystorm,
I will close the proposal for now, but I'm open to discussing it again if more people need it or if somebody is willing to implement it.