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

OpenLabsHQ / OpenLabs / 16390468151

19 Jul 2025 04:12PM UTC coverage: 93.714%. First build
16390468151

push

github

web-flow
Merge pull request #114 from OpenLabsHQ/monorepo

71 of 75 new or added lines in 4 files covered. (94.67%)

2758 of 2943 relevant lines covered (93.71%)

0.94 hits per line

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

63.64
/api/src/app/utils/path_utils.py
1
from pathlib import Path
1✔
2

3

4
def find_git_root(marker: str = ".git") -> Path:
1✔
5
    """Find the absolute path of a git repo.
6

7
    Starts from the current file's directory and travels up the tree looking for a '.git' or marker directory.
8

9
    Returns:
10
        The absolute Path object for the Git root.
11

12
    Raises:
13
        RuntimeError: If the traversal reaches the filesystem root without finding the .git directory.
14

15
    """
16
    # Start at current directory of this util file which
17
    # should prevent walking out of the OpenLabs repo unless
18
    # something goes very very wrong
19
    current_path = Path(__file__).resolve().parent
1✔
20

21
    # Move up one directory tree
22
    while current_path.parent != current_path:
1✔
23
        if (current_path / marker).exists():
1✔
24
            return current_path
1✔
25
        current_path = current_path.parent
1✔
26

27
    # Check the final path as well
NEW
28
    if (current_path / marker).exists():
×
NEW
29
        return current_path
×
30

NEW
31
    msg = f"Could not find the root of the Git repository containing marker: {marker}."
×
NEW
32
    raise RuntimeError(msg)
×
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