-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implement mechanism of override and patch migration files #31
Conversation
I'd like to have more opinions about this behavior mentioned above
I'm not sure if in this case we would prefer to execute only amended or both amended and fixed file. |
I'm not sure if we should couple the amended/fixed logic to the migtool library. Originally, the proposal described at https://github.com/seqeralabs/nf-tower-cloud/issues/3613 suggested general-purpose changes that would allow to implement the logic on the side of the users of the library. From the point of view of the tool/library, the idea was to:
Therefore, with those capabilites in place, from the point of view of users of the tool, the amended/fixed logic could be applied by:
The idea in this case is to ignore the original (and
|
After talking with @tcrespog decided to close this PR and prepare another one with less changes. We will handle fix and amend files on the platform side. |
Sorry to be late on this, but not sure that a good idea. This tools is used across different projects, tower, licman, groundswell thefore it has more sense to have this logic as a core feature |
@pditommaso okay, then we can reopen this PR. I tested It with the platform by running migration with all migration files and I added a few fixed, and amended files to test new functionality - all worked well. When we have this PR merged I will open another PR with more e2e tests on the platform side and actual fixed and amended files described in this issue. For visibility: I created similar PR for the platform, logic is the same. If we decided that we will place these changes here, in this repo - I will close that PR. |
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.
Worth adding adding a description about the .fixed
/.amended
files support in the README
file.
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.
I've just noticed a few things that I overlooked initially in the tests, but the rest is fine.
64decfd
to
b4e3888
Compare
aa32016
to
b8af571
Compare
@pditommaso Can you review this one, please? |
Thanks. I'll check asap |
@pditommaso can you please merge and start a release? |
I want to run It again with tower after the file pattern changes just in case. I will put a comment here when ready. |
we need fix before the current problem, I don't want to overlap things |
All right, I managed to run It locally with |
Ok |
Description
Closes #30
This PR adds functionality of override and patch files described in this issue https://github.com/seqeralabs/nf-tower-cloud/issues/3613.
The migration tool will scan migration files according to the given pattern like before. Besides collecting
migrationEntries
, It will also collect files with.patch
or.override
extensions in the file name and put Them in separate lists. In these collections, we will be looking for override or patch files during theapplyMigration
method.Scenarios
WHEN file.sql exists and was executed
WHEN file.sql exists and was not executed
WHEN file.sql doesn't exist but file.patch.sql exists OR file.override.sql exists -> nothing happens