diff --git a/CHANGES.rst b/CHANGES.rst index 9609be926b..ca3bb6165f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -18,6 +18,17 @@ Changes ======= +`2.9.1 `__ (2024-01-18) +------------------------------------------------------------------------------------------------------- + +Bug Fixes +~~~~~~~~~ + +- **svc:** fix migration not working with old template metadata + (`#3687 `__) + (`398ec2e `__) + + `2.9.0 `__ (2024-01-17) ------------------------------------------------------------------------------------------------------- diff --git a/helm-chart/renku-core/Chart.yaml b/helm-chart/renku-core/Chart.yaml index 439f9ec1d4..5e08dc8299 100644 --- a/helm-chart/renku-core/Chart.yaml +++ b/helm-chart/renku-core/Chart.yaml @@ -3,4 +3,4 @@ appVersion: "1.0" description: A Helm chart for Kubernetes name: renku-core icon: https://avatars0.githubusercontent.com/u/53332360?s=400&u=a4311d22842343604ef61a8c8a1e5793209a67e9&v=4 -version: 2.9.0 +version: 2.9.1 diff --git a/helm-chart/renku-core/values.yaml b/helm-chart/renku-core/values.yaml index 70cc73c055..9c8bc7658d 100644 --- a/helm-chart/renku-core/values.yaml +++ b/helm-chart/renku-core/values.yaml @@ -8,4 +8,4 @@ global: versions: latest: image: - tag: v2.9.0 + tag: v2.9.1 diff --git a/renku/core/migration/migrate.py b/renku/core/migration/migrate.py index 30e0e37a17..233cf71304 100644 --- a/renku/core/migration/migrate.py +++ b/renku/core/migration/migrate.py @@ -142,7 +142,12 @@ def migrate_project( except Exception as e: raise TemplateUpdateError("Couldn't update from template.") from e - if not skip_docker_update: + if ( + not skip_docker_update + and project + and hasattr(project, "template_metadata") + and isinstance(project.template_metadata, ProjectTemplateMetadata) + ): try: docker_updated, _, _ = update_dockerfile() except DockerfileUpdateError: diff --git a/renku/ui/service/controllers/cache_migrate_project.py b/renku/ui/service/controllers/cache_migrate_project.py index 7c2032f717..50e168301f 100644 --- a/renku/ui/service/controllers/cache_migrate_project.py +++ b/renku/ui/service/controllers/cache_migrate_project.py @@ -30,13 +30,27 @@ def execute_migration( project_path, force_template_update, skip_template_update, skip_docker_update, skip_migrations, commit_message ): """Execute project migrations.""" - from renku.command.migrate import migrate_project_command + from renku.command.migrate import ( + AUTOMATED_TEMPLATE_UPDATE_SUPPORTED, + DOCKERFILE_UPDATE_POSSIBLE, + TEMPLATE_UPDATE_POSSIBLE, + check_project, + migrate_project_command, + ) worker_log.debug(f"migrating {project_path}") communicator = ServiceCallback() with renku_project_context(project_path): + status = check_project().build().execute().output + + template_update_possible = status & TEMPLATE_UPDATE_POSSIBLE and status & AUTOMATED_TEMPLATE_UPDATE_SUPPORTED + docker_update_possible = status & DOCKERFILE_UPDATE_POSSIBLE + + skip_docker_update = skip_docker_update or not docker_update_possible + skip_template_update = skip_template_update or not template_update_possible + result = ( migrate_project_command() .with_commit(message=commit_message)