Skip to content

Update documentation for patch releases#2652

Merged
zwass merged 3 commits intofleetdm:mainfrom
zwass:patch-docs
Nov 9, 2021
Merged

Update documentation for patch releases#2652
zwass merged 3 commits intofleetdm:mainfrom
zwass:patch-docs

Conversation

@zwass
Copy link
Copy Markdown
Member

@zwass zwass commented Oct 23, 2021

No description provided.

@zwass zwass added the :improve documentation Involves writing improvements or additions to documentation label Oct 23, 2021
@zwass zwass requested a review from chiiph October 23, 2021 02:34
Comment thread docs/03-Contributing/05-Releasing-Fleet.md Outdated
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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this reshuffling step manual? (maybe link to the docs if this is already documented).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 them

and it'll do it all for you?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this as a TODO in #2850 and linked to it in the doc.

@zwass zwass merged commit f327aaa into fleetdm:main Nov 9, 2021
@zwass zwass deleted the patch-docs branch November 9, 2021 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:improve documentation Involves writing improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants