Skip to content

Commit 11f753c

Browse files
authored
Merge pull request #2885 from SwissDataScienceCenter/release/v1.2.4
chore: release v1.2.4
2 parents a5d96a8 + cccb90f commit 11f753c

File tree

17 files changed

+163
-97
lines changed

17 files changed

+163
-97
lines changed

CHANGES.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,26 @@
1818
Changes
1919
=======
2020

21+
`1.2.4 <https://github.com/SwissDataScienceCenter/renku-python/compare/v1.2.3...v1.2.4>`__ (2022-05-06)
22+
-------------------------------------------------------------------------------------------------------
23+
24+
Bug Fixes
25+
~~~~~~~~~
26+
27+
- **core:** fix using float values in renku workflow iterate
28+
(`#2875 <https://github.com/SwissDataScienceCenter/renku-python/issues/2875>`__)
29+
(`07934a8 <https://github.com/SwissDataScienceCenter/renku-python/commit/07934a8df49a4b8a7a4c25eddaae93b97943ac59>`__)
30+
- **service:** set oauth token when using gitlab APIs
31+
(`#2884 <https://github.com/SwissDataScienceCenter/renku-python/issues/2884>`__)
32+
(`11a69d7 <https://github.com/SwissDataScienceCenter/renku-python/commit/11a69d71fc08854a03bf3e524f0d68d3e86a5685>`__)
33+
34+
Features
35+
~~~~~~~~
36+
37+
- **core:** preserve staged files when editing renku config
38+
(`#2871 <https://github.com/SwissDataScienceCenter/renku-python/issues/2871>`__)
39+
(`3c3cc66 <https://github.com/SwissDataScienceCenter/renku-python/commit/3c3cc66a426c71d742d13b5fb394791d8425a5c6>`__)
40+
2141
`1.2.3 <https://github.com/SwissDataScienceCenter/renku-python/compare/v1.2.2...v1.2.3>`__ (2022-04-29)
2242
-------------------------------------------------------------------------------------------------------
2343

helm-chart/renku-core/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ appVersion: "1.0"
33
description: A Helm chart for Kubernetes
44
name: renku-core
55
icon: https://avatars0.githubusercontent.com/u/53332360?s=400&u=a4311d22842343604ef61a8c8a1e5793209a67e9&v=4
6-
version: 1.2.3
6+
version: 1.2.4

helm-chart/renku-core/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ versions:
109109
fullnameOverride: ""
110110
image:
111111
repository: renku/renku-core
112-
tag: "v1.2.3"
112+
tag: "v1.2.4"
113113
pullPolicy: IfNotPresent
114114
v8:
115115
name: v8

renku/command/command_builder/command.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ def with_commit(
414414
commit_if_empty: bool = False,
415415
raise_if_empty: bool = False,
416416
commit_only: Optional[bool] = None,
417+
skip_staging: bool = False,
417418
) -> "Command":
418419
"""Create a commit.
419420
@@ -426,7 +427,7 @@ def with_commit(
426427
"""
427428
from renku.command.command_builder.repo import Commit
428429

429-
return Commit(self, message, commit_if_empty, raise_if_empty, commit_only)
430+
return Commit(self, message, commit_if_empty, raise_if_empty, commit_only, skip_staging)
430431

431432
@check_finalized
432433
def lock_project(self) -> "Command":

renku/command/command_builder/repo.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def __init__(
3535
commit_if_empty: Optional[bool] = False,
3636
raise_if_empty: Optional[bool] = False,
3737
commit_only: Optional[bool] = None,
38+
skip_staging: bool = False,
3839
) -> None:
3940
"""__init__ of Commit.
4041
@@ -49,6 +50,7 @@ def __init__(
4950
self._commit_if_empty = commit_if_empty
5051
self._raise_if_empty = raise_if_empty
5152
self._commit_filter_paths = commit_only
53+
self._skip_staging: bool = skip_staging
5254

5355
def _pre_hook(self, builder: Command, context: dict, *args, **kwargs) -> None:
5456
"""Hook to create a commit transaction.
@@ -65,7 +67,9 @@ def _pre_hook(self, builder: Command, context: dict, *args, **kwargs) -> None:
6567
from renku.core.management.git import prepare_commit
6668

6769
self.diff_before = prepare_commit(
68-
context["client_dispatcher"].current_client, commit_only=self._commit_filter_paths
70+
context["client_dispatcher"].current_client,
71+
commit_only=self._commit_filter_paths,
72+
skip_staging=self._skip_staging,
6973
)
7074

7175
def _post_hook(self, builder: Command, context: dict, result: CommandResult, *args, **kwargs):
@@ -90,6 +94,7 @@ def _post_hook(self, builder: Command, context: dict, result: CommandResult, *ar
9094
commit_empty=self._commit_if_empty,
9195
raise_if_empty=self._raise_if_empty,
9296
commit_message=self._message,
97+
skip_staging=self._skip_staging,
9398
)
9499
except errors.RenkuException as e:
95100
result.error = e

renku/command/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def update_config():
100100
Command()
101101
.command(_update_config)
102102
.require_migration()
103-
.with_commit(commit_if_empty=False, commit_only=CONFIG_LOCAL_PATH)
103+
.with_commit(commit_if_empty=False, commit_only=CONFIG_LOCAL_PATH, skip_staging=True)
104104
.with_database()
105105
)
106106

renku/command/git.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
from renku.core import errors
2525

2626
GIT_KEY = "renku.git"
27-
GIT_ISOLATION = "renku.worktree"
2827

2928

3029
def set_git_home(value: Path):
@@ -57,25 +56,3 @@ def get_git_home(path=".") -> Path:
5756
return Repository(path, search_parent_directories=True).path
5857
except errors.GitError:
5958
raise ValueError(f"Cannot find a git repository at '{path}'")
60-
61-
62-
def set_git_isolation(value):
63-
"""Set Git isolation.
64-
65-
Args:
66-
value: Git isolation level.
67-
68-
Returns:
69-
The value passed.
70-
"""
71-
ctx = click.get_current_context()
72-
ctx.meta[GIT_ISOLATION] = value
73-
74-
return value
75-
76-
77-
def get_git_isolation():
78-
"""Get Git isolation from the current context."""
79-
ctx = click.get_current_context(silent=True)
80-
if ctx and GIT_ISOLATION in ctx.meta:
81-
return ctx.meta[GIT_ISOLATION]

renku/command/options.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,6 @@
1919

2020
import click
2121

22-
from .git import set_git_isolation
23-
24-
option_isolation = click.option(
25-
"--isolation",
26-
is_flag=True,
27-
default=False,
28-
callback=lambda ctx, param, value: set_git_isolation(value),
29-
help="Set up the isolation for invoking of the given command.",
30-
)
31-
32-
3322
option_external_storage_requested = click.option(
3423
"external_storage_requested",
3524
"--external-storage/--no-external-storage",

renku/core/management/git.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@
3838
STARTED_AT = int(time.time() * 1e3)
3939

4040

41-
def prepare_commit(
42-
client,
43-
commit_only=None,
44-
skip_dirty_checks=False,
45-
):
41+
def prepare_commit(client, commit_only=None, skip_dirty_checks=False, skip_staging: bool = False):
4642
"""Gather information about repo needed for committing later on."""
4743
diff_before = set()
4844

45+
if skip_staging:
46+
if not isinstance(commit_only, list) or len(commit_only) == 0:
47+
raise errors.OperationError("Cannot use ``skip_staging`` without specifying files to commit.")
48+
4949
if commit_only == COMMIT_DIFF_STRATEGY:
5050
if len(client.repository.staged_changes) > 0 or len(client.repository.unstaged_changes) > 0:
5151
client.repository.reset()
@@ -73,6 +73,7 @@ def finalize_commit(
7373
raise_if_empty=False,
7474
commit_message=None,
7575
abbreviate_message=True,
76+
skip_staging: bool = False,
7677
):
7778
"""Commit modified/added paths."""
7879
from renku.infrastructure.repository import Actor
@@ -127,8 +128,10 @@ def finalize_commit(
127128
if abbreviate_message:
128129
commit_message = shorten_message(commit_message)
129130

131+
# NOTE: Only commit specified paths when skipping staging area
132+
paths = commit_only if skip_staging else []
130133
# Ignore pre-commit hooks since we have already done everything.
131-
client.repository.commit(commit_message + client.transaction_id, committer=committer, no_verify=True)
134+
client.repository.commit(commit_message + client.transaction_id, committer=committer, no_verify=True, paths=paths)
132135

133136

134137
def prepare_worktree(

renku/core/workflow/converters/cwl.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,9 @@ def _convert_step(
267267
dirents.append(path)
268268
jsrequirement = True
269269

270-
environment_variables.append(cwl.EnvironmentDef(f"{RENKU_ENV_PREFIX}{output_.name}", output_.actual_value))
270+
environment_variables.append(
271+
cwl.EnvironmentDef(f"{RENKU_ENV_PREFIX}{output_.name}", str(output_.actual_value))
272+
)
271273
outp, arg = CWLExporter._convert_output(output_)
272274
tool_object.outputs.append(outp)
273275
if arg:
@@ -280,15 +282,17 @@ def _convert_step(
280282
cwl.Dirent(entry="$(inputs.{})".format(tool_input.id), entryname=input_.actual_value, writable=False)
281283
)
282284

283-
environment_variables.append(cwl.EnvironmentDef(f"{RENKU_ENV_PREFIX}{input_.name}", input_.actual_value))
285+
environment_variables.append(
286+
cwl.EnvironmentDef(f"{RENKU_ENV_PREFIX}{input_.name}", str(input_.actual_value))
287+
)
284288
tool_object.inputs.append(tool_input)
285289
if input_.mapped_to:
286290
tool_object.stdin = "$(inputs.{}.path)".format(tool_input.id)
287291
jsrequirement = True
288292

289293
for parameter in workflow.parameters:
290294
environment_variables.append(
291-
cwl.EnvironmentDef(f"{RENKU_ENV_PREFIX}{parameter.name}", parameter.actual_value)
295+
cwl.EnvironmentDef(f"{RENKU_ENV_PREFIX}{parameter.name}", str(parameter.actual_value))
292296
)
293297
tool_object.inputs.append(CWLExporter._convert_parameter(parameter))
294298

0 commit comments

Comments
 (0)