Skip to content

Commit 0012737

Browse files
chore: release v2.9.3 (#3724)
* fix: make doctor fix for workflow ids also update oid and derived_from (#3723) * fix(cli): fix the doctor fix for plan ids to reassign oid's * allow overriding renku lock path * also fix derived from * chore: release v2.9.3
1 parent ec72507 commit 0012737

File tree

5 files changed

+41
-5
lines changed

5 files changed

+41
-5
lines changed

CHANGES.rst

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

21+
`2.9.3 <https://github.com/SwissDataScienceCenter/renku-python/compare/v2.9.2...v2.9.3>`__ (2024-04-08)
22+
-------------------------------------------------------------------------------------------------------
23+
24+
Bug Fixes
25+
~~~~~~~~~
26+
27+
- make doctor fix for workflow ids also update oid and derived_from
28+
(`#3723 <https://github.com/SwissDataScienceCenter/renku-python/issues/3723>`__)
29+
(`050ed61 <https://github.com/SwissDataScienceCenter/renku-python/commit/050ed61bf13264b2b446e054e6071a5932280290>`__)
30+
2131
`2.9.2 <https://github.com/SwissDataScienceCenter/renku-python/compare/v2.9.1...v2.9.2>`__ (2024-02-06)
2232
-------------------------------------------------------------------------------------------------------
2333

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: 2.9.2
6+
version: 2.9.3

helm-chart/renku-core/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ global:
88
versions:
99
latest:
1010
image:
11-
tag: v2.9.2
11+
tag: v2.9.3

renku/command/checks/workflow.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616
"""Checks needed to determine integrity of workflows."""
17+
1718
from datetime import timedelta
1819
from typing import List, Optional, Tuple, cast
1920

@@ -145,14 +146,17 @@ def check_plan_id(fix, plan_gateway: IPlanGateway, **_) -> Tuple[bool, bool, Opt
145146
plans: List[AbstractPlan] = plan_gateway.get_all_plans()
146147

147148
to_be_processed = []
149+
to_be_processed_derived = []
148150
for plan in plans:
149151
if isinstance(plan.id, str) and plan.id.startswith("/plans//plans"):
150152
to_be_processed.append(plan)
153+
if isinstance(plan.derived_from, str) and plan.derived_from.startswith("/plans//plans"):
154+
to_be_processed_derived.append(plan)
151155

152-
if not to_be_processed:
156+
if not to_be_processed and not to_be_processed_derived:
153157
return True, False, None
154158
if not fix:
155-
ids = [plan.id for plan in to_be_processed]
159+
ids = [plan.id for plan in to_be_processed + to_be_processed_derived]
156160
message = (
157161
WARNING
158162
+ "The following workflows have incorrect IDs (use 'renku doctor --fix' to fix them):\n\t"
@@ -163,7 +167,17 @@ def check_plan_id(fix, plan_gateway: IPlanGateway, **_) -> Tuple[bool, bool, Opt
163167
for plan in to_be_processed:
164168
plan.unfreeze()
165169
plan.id = plan.id.replace("//plans/", "/")
170+
plan.reassign_oid()
171+
plan._p_changed = True
166172
plan.freeze()
173+
174+
for plan in to_be_processed_derived:
175+
if plan.derived_from is not None:
176+
plan.unfreeze()
177+
plan.derived_from = plan.derived_from.replace("//plans/", "/")
178+
plan._p_changed = True
179+
plan.freeze()
180+
167181
project_context.database.commit()
168182
communication.info("Workflow IDs were fixed")
169183

renku/core/config.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import configparser
1919
import os
2020
from io import StringIO
21+
from pathlib import Path
2122

2223
from renku.core.constant import DATA_DIR_CONFIG_KEY
2324
from renku.domain_model.enums import ConfigFilter
@@ -28,13 +29,21 @@ def global_config_read_lock():
2829
"""Create a user-level config read lock."""
2930
from renku.core.util.contexts import Lock
3031

32+
lock_path = os.environ.get("RENKU_LOCK_PATH")
33+
if lock_path is not None:
34+
return Lock(Path(lock_path))
35+
3136
return Lock(project_context.global_config_path)
3237

3338

3439
def global_config_write_lock():
3540
"""Create a user-level config write lock."""
3641
from renku.core.util.contexts import Lock
3742

43+
lock_path = os.environ.get("RENKU_LOCK_PATH")
44+
if lock_path is not None:
45+
return Lock(Path(lock_path), mode="exclusive")
46+
3847
return Lock(project_context.global_config_path, mode="exclusive")
3948

4049

@@ -112,7 +121,10 @@ def load_config(config_filter=ConfigFilter.ALL):
112121
elif config_filter == ConfigFilter.GLOBAL_ONLY:
113122
config_files += [project_context.global_config_path]
114123
elif config_filter == ConfigFilter.ALL:
115-
config_files += [project_context.global_config_path, project_context.local_config_path]
124+
config_files += [
125+
project_context.global_config_path,
126+
project_context.local_config_path,
127+
]
116128

117129
if config_filter != ConfigFilter.LOCAL_ONLY:
118130
with global_config_read_lock():

0 commit comments

Comments
 (0)