Context typo causes changeset to be silently ignored

Description

ChangeLogIterator.run() has this logic:

When I printf the class name of the visitor when updating with a formatted sql changeset, I see that the visitor is first

and second

.

Neither of these classes implement the

interface.

The result is that the changeset is silently ignored; the error is not output, even with logging at debug level.

It seems like an easy error to create with that instanceof check.

For now, in my local copy I will add an else clause to the instanceof check and log an error.

Environment

Java 7

Activity

Show:

Geißler, Daniel February 17, 2017 at 10:28 AM

I would love to see what changeSets where available and wich where skipped by what reason.

Mark Bucciarelli August 19, 2016 at 4:08 PM

changed to info level. there is no way for the changeset iterator to know the full list of valid context strings.

but this is still a hack, message is output twice.

maybe a better solution is to make ValidatingVisitor implement SkippedChangeSetVisitor so existing framework logs messages. other than ShouldRunChangeSetFilter, it seems useful to get info on why a changeset was filtered out.

filters used:

Mark Bucciarelli August 19, 2016 at 2:30 PM

Hmmm, not the correct fix, because now if a changeset is skipped because it is already applied, that condition is logged as a SEVERE.

Maybe context typos should raise an exception instead of setting a skip reason.

Mark Bucciarelli August 19, 2016 at 1:06 PM

My local patch.

Details

Reporter

Components

Affects versions

Priority

Created August 19, 2016 at 12:53 PM
Updated February 17, 2017 at 10:28 AM