From e57e6cb2a87ebbc25393f3d757720f3fb197a8bd Mon Sep 17 00:00:00 2001 From: ibrmora Date: Sun, 12 Jun 2022 07:37:48 +0300 Subject: [PATCH 1/2] fix: upgrade_from_maple issue fix: Migration needed before upgrade_from_maple issue #689 --- CHANGELOG.md | 2 ++ tutor/commands/upgrade/k8s.py | 20 ++++++++++++++++++++ tutor/commands/upgrade/local.py | 25 +++++++++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c279514..12acfbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ Every user-facing change should have an entry in this changelog. Please respect ## Unreleased +- [Bugfix] Add migration to "upgrade_from_maple" function ([#689](https://github.com/overhangio/tutor/issues/689)). (by @ibrmora) + ## v14.0.0 (2022-06-09) - 💥[Feature] Upgrade to Nutmeg: (by @regisb) diff --git a/tutor/commands/upgrade/k8s.py b/tutor/commands/upgrade/k8s.py index 60ebe6e..0cce122 100644 --- a/tutor/commands/upgrade/k8s.py +++ b/tutor/commands/upgrade/k8s.py @@ -129,6 +129,11 @@ def upgrade_from_maple(context: Context, config: Config) -> None: "app.kubernetes.io/name=lms", ) k8s.wait_for_pod_ready(config, "lms") + + # Command backpopulate_user_tours + k8s.kubectl_exec( + config, "lms", ["sh", "-e", "-c", "./manage.py lms migrate user_tours"] + ) k8s.kubectl_exec( config, "lms", ["sh", "-e", "-c", "./manage.py lms backpopulate_user_tours"] ) @@ -140,9 +145,24 @@ def upgrade_from_maple(context: Context, config: Config) -> None: "app.kubernetes.io/name=cms", ) k8s.wait_for_pod_ready(config, "cms") + + # Command backfill_course_tabs + k8s.kubectl_exec( + config, "cms", ["sh", "-e", "-c", "./manage.py cms migrate contentstore"] + ) + k8s.kubectl_exec( + config, + "cms", + ["sh", "-e", "-c", "./manage.py cms migrate split_modulestore_django"], + ) k8s.kubectl_exec( config, "cms", ["sh", "-e", "-c", "./manage.py cms backfill_course_tabs"] ) + + # Command simulate_publish + k8s.kubectl_exec( + config, "cms", ["sh", "-e", "-c", "./manage.py cms migrate course_overviews"] + ) k8s.kubectl_exec( config, "cms", ["sh", "-e", "-c", "./manage.py cms simulate_publish"] ) diff --git a/tutor/commands/upgrade/local.py b/tutor/commands/upgrade/local.py index 1fecbc3..b92f78a 100644 --- a/tutor/commands/upgrade/local.py +++ b/tutor/commands/upgrade/local.py @@ -103,14 +103,39 @@ def upgrade_from_maple(context: click.Context, config: Config) -> None: click.echo(fmt.title("Upgrading from Maple")) # The environment needs to be updated because the management commands are from Nutmeg tutor_env.save(context.obj.root, config) + # Command backpopulate_user_tours + context.invoke( + compose.run, + args=["lms", "sh", "-e", "-c", "./manage.py lms migrate user_tours"], + ) context.invoke( compose.run, args=["lms", "sh", "-e", "-c", "./manage.py lms backpopulate_user_tours"], ) + # Command backfill_course_tabs + context.invoke( + compose.run, + args=["cms", "sh", "-e", "-c", "./manage.py cms migrate contentstore"], + ) + context.invoke( + compose.run, + args=[ + "cms", + "sh", + "-e", + "-c", + "./manage.py cms migrate split_modulestore_django", + ], + ) context.invoke( compose.run, args=["cms", "sh", "-e", "-c", "./manage.py cms backfill_course_tabs"], ) + # Command simulate_publish + context.invoke( + compose.run, + args=["cms", "sh", "-e", "-c", "./manage.py cms migrate course_overviews"], + ) context.invoke( compose.run, args=["cms", "sh", "-e", "-c", "./manage.py cms simulate_publish"], From 8a305faa6d1813a55b2743c727224b309308d43c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Mon, 13 Jun 2022 22:26:40 +0200 Subject: [PATCH 2/2] v14.0.1 (2022-06-13) - [Bugfix] Fix missing tables on migration from maple ([#689](https://github.com/overhangio/tutor/issues/689)). (by @ibrmora) - [Bugfix] Fix plugin patches in cms.env.yml template. --- CHANGELOG.md | 5 ++++- tutor/__about__.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12acfbc..8d7e04b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,10 @@ Every user-facing change should have an entry in this changelog. Please respect ## Unreleased -- [Bugfix] Add migration to "upgrade_from_maple" function ([#689](https://github.com/overhangio/tutor/issues/689)). (by @ibrmora) +## v14.0.1 (2022-06-13) + +- [Bugfix] Fix missing tables on migration from maple ([#689](https://github.com/overhangio/tutor/issues/689)). (by @ibrmora) +- [Bugfix] Fix plugin patches in cms.env.yml template. ## v14.0.0 (2022-06-09) diff --git a/tutor/__about__.py b/tutor/__about__.py index 36667fd..eb24232 100644 --- a/tutor/__about__.py +++ b/tutor/__about__.py @@ -2,7 +2,7 @@ import os # Increment this version number to trigger a new release. See # docs/tutor.html#versioning for information on the versioning scheme. -__version__ = "14.0.0" +__version__ = "14.0.1" # The version suffix will be appended to the actual version, separated by a # dash. Use this suffix to differentiate between the actual released version and