Skip to content
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

Non-obvious behavior with include and SQL files with no changeset declaration #4484

Open
2 tasks done
K900 opened this issue Jul 12, 2023 · 1 comment
Open
2 tasks done

Comments

@K900
Copy link

K900 commented Jul 12, 2023

Search first

  • I searched and no similar issues were found

Description

If a changelog includes an SQL file with no --changeset comment, the file is simply ignored without a warning or anything like that, which leads to really confusing behavior if you e.g. typo the word "changeset" or not make a comment at all.

Steps To Reproduce

See https://github.com/K900/liquibase-ux-issue-repro for an example project.

Run docker-compose up to start a database and run Liquibase, which will report 0 changesets applied. Remove the extra dash on line 3 of data/example.sql and run docker-compose up again to allow Liquibase to see the changeset and apply it correctly.

Expected/Desired Behavior

Making this fail will probably be a breaking change, so maybe a warning for "you have SQL that is not part of any changeset"?

Liquibase Version

Tested on 4.23 and 3.8.2, but likely all of them

Database Vendor & Version

PostgreSQL 15

Liquibase Integration

CLI

Liquibase Extensions

none

OS and/or Infrastructure Type/Provider

not applicable

Additional Context

We actually ran into this and spent an hour or so chasing down a typo. Would be nice to have this at least warn by default :) I'm happy to submit a PR if someone is willing to point me at the right code for this.

Are you willing to submit a PR?

  • I'm willing to submit a PR (Thank you!)
@MalloD12
Copy link
Contributor

MalloD12 commented Aug 9, 2023

Hi @K900,

Thank you for raising this issue for us. I do agree on something like this would help, but I also think considering format validations like this would lead us to a never-ending story because there could be many different format validation errors we want to warn users about for the different format types we support.

Probably a good start would be to set some sort of expectations asking ourselves "Which are minimum (format) validations we should be handling?" and "Where should we stop allowing special exceptions?".

Thanks,
Daniel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Discussion
Development

No branches or pull requests

5 participants