Skip to content

Commit

Permalink
fix(service): fix clone depth not being respected
Browse files Browse the repository at this point in the history
  • Loading branch information
Panaetius committed Jan 15, 2024
1 parent a7f4a22 commit 2e17a83
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions renku/ui/service/cache/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"""Renku service project cache management."""
from typing import cast

from marshmallow import EXCLUDE
from marshmallow import RAISE

from renku.ui.service.cache.base import BaseCache
from renku.ui.service.cache.models.project import Project
Expand All @@ -34,7 +34,7 @@ def make_project(self, user, project_data, persist=True) -> Project:
"""Store user project metadata."""
project_data.update({"user_id": user.user_id})

project_obj: Project = cast(Project, self.project_schema.load(project_data, unknown=EXCLUDE))
project_obj: Project = cast(Project, self.project_schema.load(project_data, unknown=RAISE))

if persist:
project_obj.save()
Expand Down
4 changes: 0 additions & 4 deletions renku/ui/service/controllers/templates_create_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,8 @@ def setup_new_project(self):
"name": self.ctx["project_name"],
"slug": self.ctx["project_name_stripped"],
"description": self.ctx["project_description"],
"fullname": self.ctx["fullname"],
"email": self.ctx["email"],
"owner": self.ctx["project_namespace"],
"token": self.ctx["token"],
"initialized": True,
"image": self.ctx["image"],
}
project = self.cache.make_project(self.user, new_project_data)

Expand Down
2 changes: 1 addition & 1 deletion renku/ui/service/gateways/repository_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def _clone_project(
"owner": parsed_git_url.owner,
"name": parsed_git_url.name,
"slug": normalize_to_ascii(parsed_git_url.name),
"depth": PROJECT_CLONE_DEPTH_DEFAULT if shallow else None,
"clone_depth": PROJECT_CLONE_DEPTH_DEFAULT if shallow else None,
"branch": branch,
"git_url": git_url,
"user_id": user.user_id,
Expand Down

0 comments on commit 2e17a83

Please sign in to comment.