Update documentation for patch releases#2652
Conversation
| 7. **Important!** Manually check the database migrations. Any migrations that are not cherry-picked in a | ||
| patch must have a _higher_ timestamp than migrations that were cherry-picked. If there | ||
| are new migrations that were not cherry-picked, verify that those migrations have higher | ||
| timestamps. If they do not, submit a new Pull Request to increase the timestamps and ensure that |
There was a problem hiding this comment.
Is this reshuffling step manual? (maybe link to the docs if this is already documented).
There was a problem hiding this comment.
So far this is the best docs we've got. @chiiph any thoughts on how to better express what needs to be done with the migrations?
There was a problem hiding this comment.
We can probably write a script that renames and seds the timestamp. Something like:
./tools/shuffle_migrations.sh server/datastore/mysql/migrations/tables/20210927143115_AddPolicyUpdatedAtColumn.go server/datastore/mysql/migrations/tables/20210927143116_AddBundleIdentifierColumn.go
That would parse the timestamps from the names, and then grab the second timestamp, add 1, and rename the first file to the new timestamp + _AddPolicyUpdatedAtColumn.go and sed inside the old timestamp for the new one.
It would still need somebody manually identifying what migrations need reshuffling, which I suppose can also be automated by using something like:
git show patch-fleet-v4.4.3:server/datastore/mysql/migrations/tables/
to inspect the files in the patch branch and collect all the migrations that need reshuffling. So maybe the resulting script could be:
git fetch origin # to make sure to get the patch branch you want
git checkout main # move to main, since that's the branch we want to reshuffle
git pull origin main # make sure you are in the latest version of it
./tools/migration_shuffle 4.4.3 # and this checks the files in origin/patch-v<provided version> and reshuffles themand it'll do it all for you?
There was a problem hiding this comment.
I added this as a TODO in #2850 and linked to it in the doc.
No description provided.