flyway/flyway — pull request #22 by bjhartin (2013-05-09 20:58:37+00:00)
Title: Issue 477: Fail fast for missing placeholders

Axel,

This batch of commits contains a feature to fail a migration if there are unmatched placeholders. It works on the basis of identifying placeholder expressions with a regexp which uses the defined prefix and suffix, and then comparing to the placeholder values in the configuration.

Some questions I have are:

1. Is there any case in which we would _not_ want this behavior? If so we might want to make it an option (see 1.1). I have taken care to disable it for the special NO_PLACEHOLDERS object.

1.1 There is currently no good way for a class like PlaceholderReplacer to get configuration values stored in Flyway. Might we consider adding a facility for this, e.g. a FlywayConfig or FlywayContext object which is injected or bound to the thread?

2. Might we want this to fail faster, e.g. before any migrations get executed?

I did not address the inverse case, i.e. a placeholder value in the configuration which is not used. This does not seem like an error to me, especially considering that an organization might have a common Flyway config with standard placeholder values that are needed by many, but not all, projects.

Thanks again for your work on Flyway. We are excited to roll it out in our company. We will likely send some more patches your way.

Brian