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

Detach latest migration #100

Merged
merged 8 commits into from
Aug 3, 2023
Merged

Conversation

jayvdb
Copy link
Collaborator

@jayvdb jayvdb commented May 30, 2023

Step one of #91 - detach rather than unmake.

@jayvdb jayvdb force-pushed the detach-migration branch from 729d49a to da8fe9f Compare July 29, 2023 05:38
@jayvdb
Copy link
Collaborator Author

jayvdb commented Jul 29, 2023

I was a bit ambiguous initially planning to allow any migration to be detached. While detaching from the middle is do-able, it is less sensible to allow it, and it is not necessary for most common #91 scenarios. Doing multiple detaches of the top migration is sufficient, and adding support for re-attaching migrations is more important IMO.

@jayvdb jayvdb marked this pull request as ready for review July 29, 2023 08:04
@jayvdb jayvdb changed the title WIP: Detach latest migration Detach latest migration Jul 29, 2023
@jayvdb jayvdb requested a review from Electron100 July 30, 2023 23:36
@Electron100
Copy link
Owner

Ack on the review request. Will take a look tomorrow.

@jayvdb
Copy link
Collaborator Author

jayvdb commented Jul 31, 2023

Note two parts of #91 (comment) that I havent implemented yet is

Undo it from the embed

and

When there is an existing detached migration, all commands would be disabled except for the "rejoin", with an error message informing the user how to delete the detached migration if they want to abandon it.

The first of those is mandatory.

IMO the second doesnt depend on "rejoin" being built first - all commands can be blocked until the detached migration has been removed - atm that means it is the users responsibility to do something with it or delete it. I'm happy to do that in the scope of this PR if you agree that is good enough for now.

If any command is necessary whilst detached, IMO it is "detachmigration" so that the user can remove multiple migrations from the top, in order to reach a common branch point between two branches of development.

butane_cli/src/main.rs Outdated Show resolved Hide resolved
@jayvdb
Copy link
Collaborator Author

jayvdb commented Aug 1, 2023

I've added the ability to detect if there are detached migrations, but after looking through the existing list of commands I am reconsidering whether this is needed at all. While it might be usually a bad idea to run some of the commands when there is a detached migration, it cant cause new undesirable states which we must avoid, and maybe we should just let the user do the commands and let them deal with the repercussions.

What might be useful is to always print the list of detached migrations, so they are not accidentally forgotten.

butane_cli/src/main.rs Outdated Show resolved Hide resolved
@Electron100
Copy link
Owner

I agree with your reconsideration -- it doesn't seem necessary to me to actually block operations for detached migrations.

@jayvdb jayvdb requested a review from Electron100 August 3, 2023 08:39
@jayvdb jayvdb merged commit 5e5f27e into Electron100:master Aug 3, 2023
@jayvdb jayvdb deleted the detach-migration branch August 3, 2023 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants