Skip to content

Commit

Permalink
Merge branch 'develop' into fix/3659-fix-image-registry
Browse files Browse the repository at this point in the history
  • Loading branch information
Panaetius authored Dec 20, 2023
2 parents 1a48017 + 2502aaf commit 0ddea38
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ htmlcov/
nosetests.xml
coverage.xml
*,cover
.hypothesis

# Translations
*.mo
Expand Down
13 changes: 13 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@
Changes
=======

`2.8.1 <https://github.com/SwissDataScienceCenter/renku-python/compare/v2.8.0...v2.8.1>`__ (2023-12-18)
-------------------------------------------------------------------------------------------------------

Bug Fixes
~~~~~~~~~

- **core:** adapt to Zenodo jsonld changes; send referrer on Zenodo request
(`#3643 <https://github.com/SwissDataScienceCenter/renku-python/issues/3643>`__)
(`41816d8 <https://github.com/SwissDataScienceCenter/renku-python/commit/41816d8178af0b057cca5bdd91330fbb265f9c03>`__)
- **service:** dataset import error
(`#3670 <https://github.com/SwissDataScienceCenter/renku-python/issues/3670>`__)
(`1795cde <https://github.com/SwissDataScienceCenter/renku-python/commit/1795cde3e1a0cd849618175251f8feab997fecfc>`__)

`2.8.0 <https://github.com/SwissDataScienceCenter/renku-python/compare/v2.7.0...v2.8.0>`__ (2023-11-17)
-------------------------------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion helm-chart/renku-core/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.8.0
version: 2.8.1
2 changes: 1 addition & 1 deletion helm-chart/renku-core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ global:
versions:
latest:
image:
tag: v2.8.0
tag: v2.8.1
4 changes: 2 additions & 2 deletions renku/core/dataset/providers/zenodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class ZenodoDatasetSchema(ProviderDatasetSchema):
"""Schema for Zenodo datasets."""

@pre_load
def fix_data(self, data, **kwargs):
def fix_data(self, data, **_):
"""Fix data that is received from Zenodo."""
# Fix context
context = data.get("@context")
Expand Down Expand Up @@ -236,7 +236,7 @@ def fix_data(self, data, **kwargs):
class ZenodoFileSerializer:
"""Zenodo record file."""

def __init__(self, *, id=None, checksum=None, links=None, key=None, size=None, **kwargs):
def __init__(self, *, id=None, checksum=None, links=None, key=None, size=None, **_):
self.id = id
self.checksum = checksum
self.links = links
Expand Down
4 changes: 2 additions & 2 deletions renku/core/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ def __init__(self):
msg = (
"There are not any detected outputs in the repository. This can be due to your command not creating "
"any new files or due to files that get created already existing before the command was run. In the "
"latter case, you can remove those files prior to running your command.\nIf you want to track the command"
"without outputs, use the use --no-output option.\nYou can also use the --output flag to track outputs"
"latter case, you can remove those files prior to running your command.\nIf you want to track the command "
"without outputs, use the use --no-output option.\nYou can also use the --output flag to track outputs "
"manually."
)

Expand Down
2 changes: 1 addition & 1 deletion renku/ui/service/controllers/datasets_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def renku_op(self):
"""Renku operation for the controller."""
job = self.cache.make_job(
self.user,
# NOTE: To support operation to be execute on remote project, this behaviour should be updated.
# NOTE: To support operation to be executed on remote project, this behaviour should be updated.
project=self.ctx["project_id"],
job_data={"renku_op": "dataset_import", "client_extras": self.ctx.get("client_extras")},
)
Expand Down
10 changes: 5 additions & 5 deletions renku/ui/service/jobs/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def dataset_import(
user_job_id,
project_id,
dataset_uri,
name=None,
slug=None,
extract=False,
tag=None,
timeout=None,
Expand All @@ -63,7 +63,7 @@ def dataset_import(
command = import_dataset_command().with_commit_message(commit_message)
command.with_communicator(communicator).build().execute(
uri=dataset_uri,
name=name,
slug=slug,
extract=extract,
tag=tag,
yes=True,
Expand Down Expand Up @@ -98,7 +98,7 @@ def _is_safe_to_pass_gitlab_token(project_git_url, dataset_uri):


@requires_cache
def dataset_add_remote_file(cache, user, user_job_id, project_id, create_dataset, commit_message, name, url):
def dataset_add_remote_file(cache, user, user_job_id, project_id, create_dataset, commit_message, slug, url):
"""Add a remote file to a specified dataset."""
user = cache.ensure_user(user)
worker_log.debug(f"executing dataset add remote file job for {user.user_id}:{user.fullname}")
Expand All @@ -113,9 +113,9 @@ def dataset_add_remote_file(cache, user, user_job_id, project_id, create_dataset
with renku_project_context(project.abs_path):
urls = url if isinstance(url, list) else [url]

worker_log.debug(f"adding files {urls} to dataset {name}")
worker_log.debug(f"adding files {urls} to dataset {slug}")
command = add_to_dataset_command().with_commit_message(commit_message).build()
result = command.execute(dataset_slug=name, urls=urls, create=create_dataset)
result = command.execute(dataset_slug=slug, urls=urls, create=create_dataset)
if result.error:
raise result.error

Expand Down
24 changes: 20 additions & 4 deletions tests/service/jobs/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ def test_dataset_url_import_job(url, svc_client_with_repo):
@pytest.mark.service
@retry_failed
@pytest.mark.vcr
def test_dataset_import_job(doi, svc_client_with_repo):
"""Test dataset import via doi."""
def test_dataset_import_job_with_slug(doi, svc_client_with_repo):
"""Test dataset import via doi and give it a slug."""
svc_client, headers, project_id, url_components = svc_client_with_repo

user_id = encode_b64(secure_filename("9ab2fc80-3a5c-426d-ae78-56de01d214df"))
Expand Down Expand Up @@ -118,7 +118,14 @@ def test_dataset_import_job(doi, svc_client_with_repo):
job_id = response.json["result"]["job_id"]

commit_message = "service: import remote dataset"
dataset_import(user, job_id, project_id, doi, commit_message=commit_message)
dataset_import(
user=user,
user_job_id=job_id,
project_id=project_id,
dataset_uri=doi,
slug="dataset-slug",
commit_message=commit_message,
)

new_commit = Repository(dest).head.commit
assert old_commit.hexsha != new_commit.hexsha
Expand Down Expand Up @@ -279,7 +286,16 @@ def test_dataset_add_remote_file(url, svc_client_with_repo):
job_id = response.json["result"]["files"][0]["job_id"]
commit_message = "service: dataset add remote file"

dataset_add_remote_file(user, job_id, project_id, True, commit_message, payload["slug"], url)
# user, user_job_id, project_id, create_dataset, commit_message, slug, url
dataset_add_remote_file(
user=user,
user_job_id=job_id,
project_id=project_id,
create_dataset=True,
commit_message=commit_message,
slug=payload["slug"],
url=url,
)

new_commit = Repository(dest).head.commit

Expand Down

0 comments on commit 0ddea38

Please sign in to comment.