Lint even if pre-condition do not match?

Hi.

I’ve had a few cases where a changeset have either:

  • a context attribute; or
  • a precondition

that evades the validation builds, and then fails on the next environment where the context or data matches the precondition.

Some cases the actual changeset even have syntax errors.

Is it possible to at least run a Lint on the changeset, even if the conditions do not match it to be executed?

PS: i was sure when i looked at this in the past there was a Jira ticket for something very similar, but i did not bookmark and can’t find it now.

Hi @gcb ,

Welcome to the Liquibase Forum!

I can see others have written lint for liquibase:

It does sound like the process has worked, you caught the issue before productions! Great job, but I would argue that the process should be rethought a bit. I personally am not a fan of preconditions that change deployment output, b/c then I don’t know what really will happen in production. That sorta defeats the purpose of practicing deployments across progressively higher environments.

Thanks for sharing this project. it never showed up on my searches.

I’m changing my setup from liquibase jar to the maven plugin to be able to use it… but it seems to only add a few other rules on top of what liquibase does, so if liquibase is not running the query, the linter will also not look into it (i can add other rules, such as fail if there is a pre-condition, etc. but not add extra lint to the query section that is being ignored in this pass)

I personally am not a fan of preconditions that change deployment output, b/c then I don’t know what really will happen in production.

we mostly use preconditions to avoid re-doing work. all our preconditions check “if this already exist, mark_ran”. is this not recommended?