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
handle empty lines at start of formatted sql #1713
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1713 +/- ##
============================================
- Coverage 48.20% 47.91% -0.30%
- Complexity 7558 7953 +395
============================================
Files 755 799 +44
Lines 36456 38973 +2517
Branches 6645 6983 +338
============================================
+ Hits 17574 18672 +1098
- Misses 16522 17798 +1276
- Partials 2360 2503 +143 Continue to review full report at Codecov.
|
Hi @smith-xyz Thanks for creating this PR for enhancement. Here's what happens next:
The PR will be prioritized according to our internal development and testing capacity. We’ll let you know when it’s ready to move to the next step or if any changes are needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix!
➤ obovsunivskyi commented: verified this on branch smithxyzemptylineissue-sql#5 and works fine. Moving to RTM. |
Environment
Liquibase Version: 3.10.0
Liquibase Integration & Version: All
Liquibase Extension(s) & Version: N/A
Database Vendor & Version: N/A
Operating System Type & Version: All
Pull Request Type
Description
An issue spotted where empty space at the beginning of the formatted sql changelog would result in the changeset running as raw sql. This change is to find the first non empty string (or end of file) and perform the regex match to determine if the file is a formatted sql file so that the changeset is logged correctly. First time committing code here, thank you for any and all feedback.
Steps To Reproduce
cf. Liquibase Forum Post
Actual Behavior
Before these changes, the changelog will run fine but save with raw:includeAll in the databasechangelog. The only issue with the changeset file is some whitespace at the beginning.
Expected/Desired Behavior
A simple check to find the first non empty line in the sql file, and then run the test to see if the text starts with 'liquibase formatted sql'. Otherwise run the file as raw sql storing the changeset id:author as raw:includeAll.
Screenshots (if appropriate)
screenshots on forum post:
cf. Liquibase Forum Post
Additional Context
Add any other context about the problem here.
Fast Track PR Acceptance Checklist:
<
!--- If you're unsure about any of these, just ask us in a comment. We're here to help|width=200,height=183!
-->
Test Requirements (Internal Liquibase QA)
Manual Test Requirements
For the following tests, use the attached formatted SQL changelog.
Verify update-sql command returns the correct SQL to deploy changeset test:1.
Verify update is successful.
Verify DATABASECHANGELOG.ID=1-test1
Verify DATABASECHANGELOG.AUTHOR=bug_user.
Dev Handoff Notes (Internal Use)
Links
Testing
Dev Verification
Code review and automated tests
Need Help?
Come chat with us on our discord channel
┆Issue is synchronized with this Jiraserver Story by Unito