• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SwissDataScienceCenter / renku-data-services / 18099160032

29 Sep 2025 01:45PM UTC coverage: 83.309% (-3.4%) from 86.756%
18099160032

Pull #1015

github

web-flow
Merge a03635015 into 0690bab65
Pull Request #1015: fix: loading kube configs

23 of 68 new or added lines in 8 files covered. (33.82%)

892 existing lines in 42 files now uncovered.

21422 of 25714 relevant lines covered (83.31%)

1.49 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

38.46
/components/renku_data_services/notebooks/api/classes/cloud_storage/existing.py
1
"""Cloud storage."""
2

3
from dataclasses import dataclass
2✔
4
from typing import Any, Self, cast
2✔
5

6
from renku_data_services.errors import errors
2✔
7
from renku_data_services.notebooks.crs import JupyterServerV1Alpha1
2✔
8

9

10
@dataclass
2✔
11
class ExistingCloudStorage:
2✔
12
    """Cloud storage for a session."""
13

14
    remote: str
2✔
15
    type: str
2✔
16

17
    @classmethod
2✔
18
    def from_manifest(cls, manifest: JupyterServerV1Alpha1, storage_class: str = "csi-rclone") -> list[Self]:
2✔
19
        """The patches applied to a jupyter server to insert the storage in the session."""
UNCOV
20
        if manifest.spec is None:
×
21
            raise errors.ProgrammingError(message="Unexpected manifest format")
×
UNCOV
22
        output: list[Self] = []
×
UNCOV
23
        for patch_collection in manifest.spec.patches:
×
UNCOV
24
            for patch in cast(list[dict[str, Any]], patch_collection.patch):
×
UNCOV
25
                if patch["op"] == "test":
×
UNCOV
26
                    continue
×
UNCOV
27
                if not isinstance(patch["value"], dict):
×
UNCOV
28
                    continue
×
UNCOV
29
                is_persistent_volume = patch["value"].get("kind") == "PersistentVolume"
×
UNCOV
30
                is_rclone = patch["value"].get("spec", {}).get("csi", {}).get("driver", "") == storage_class
×
UNCOV
31
                if isinstance(patch["value"], dict) and is_persistent_volume and is_rclone:
×
32
                    configData = patch["value"]["spec"]["csi"]["volumeAttributes"]["configData"].splitlines()
×
33
                    _, storage_type = next(
×
34
                        (line.strip().split("=") for line in configData if line.startswith("type")),
35
                        (None, "Unknown"),
36
                    )
37
                    output.append(
×
38
                        cls(
39
                            remote=patch["value"]["spec"]["csi"]["volumeAttributes"]["remote"],
40
                            type=storage_type.strip(),
41
                        )
42
                    )
UNCOV
43
        return output
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc