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

Make Migration Process More Robust #25

Open
henriqueinonhe opened this issue Oct 12, 2023 · 0 comments
Open

Make Migration Process More Robust #25

henriqueinonhe opened this issue Oct 12, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@henriqueinonhe
Copy link
Owner

We want to make migrating to newer versions of this project as easy as possible, and to do that we have a migration script so that users can just run a command and have their projects automatically migrated to the most recent version.

Currently, the migration script (implemented in bin.cjs) is deceptively simple, and does the following:

  • Checks whether the current folder is actually a promises-training repo
  • Copies new files
  • Reinstalls dependencies

The "copies new files" step is the most sensitive one, as we want to update all "internal" files, like the ones inside src/lib, src/tests, but we want to leave existing files under src/execises untouched, as we don't want to erase users's solutions.

This migration script works in a very naive way as it doesn't consider that different versions might need different migration strategies.

Moving forward we want to use a migration approach that's similar to how database migrations work, where every time we have a new version we'll also have a migration that takes care of the specific migration between the previous and the current version, this way we only need to apply migrations in sequence and each migration can be independent of previous ones.

To do that we need:

  • A set of helpers to address common migration tasks, like copying specific files, merging old and new dependencies (because users might have installed their own dependencies so we can't just overwrite them), etc
  • An "orchestrator" that will be responsible for identifying which migrations need to be run according to the current version of the user's repo and the existing migrations
@henriqueinonhe henriqueinonhe added the enhancement New feature or request label Oct 12, 2023
@henriqueinonhe henriqueinonhe added this to the Stable Version milestone Oct 17, 2023
@henriqueinonhe henriqueinonhe removed this from the Stable Version milestone Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant