You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@incubator.apache.org by jm...@apache.org on 2026/01/24 19:53:04 UTC

(incubator) 26/30: fix root no longer incubator

This is an automated email from the ASF dual-hosted git repository.

jmclean pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator.git

commit 7e0f0d0b8cca7402abd79b6e4d37149fca00b0a7
Author: Justin Mclean <jm...@apache.org>
AuthorDate: Sat Jan 24 17:25:11 2026 +1100

    fix root no longer incubator
---
 app.py | 35 +++++++++++++++--------------------
 1 file changed, 15 insertions(+), 20 deletions(-)

diff --git a/app.py b/app.py
index cba3b8156..9891f08e2 100644
--- a/app.py
+++ b/app.py
@@ -31,31 +31,26 @@ def run_git(repo_dir: Path, args: list[str]) -> str:
 
 def resolve_incubator_repo() -> Path:
     """
-    This dashboard expects the Incubator repo to exist as a nested git repo at ./incubator.
-    We do NOT fall back to the dashboard repo, because the reports are inside ./incubator.
+    Use the dashboard repo itself as the git root.
+    This works locally and on Streamlit Community Cloud.
     """
-    repo = (Path.cwd().resolve() / "incubator")
+    cwd = Path.cwd().resolve()
 
-    # Use a robust git check (works for worktrees too)
-    p = subprocess.run(
-        ["git", "-C", str(repo), "rev-parse", "--show-toplevel"],
-        stdout=subprocess.PIPE,
-        stderr=subprocess.PIPE,
-        text=True,
-        check=False,
-        env={**dict(os.environ), "GIT_TERMINAL_PROMPT": "0"},
-    )
-    if p.returncode != 0:
+    try:
+        p = subprocess.run(
+            ["git", "-C", str(cwd), "rev-parse", "--show-toplevel"],
+            stdout=subprocess.PIPE,
+            stderr=subprocess.PIPE,
+            text=True,
+            check=True,
+        )
+        return Path(p.stdout.strip())
+    except subprocess.CalledProcessError as e:
         raise RuntimeError(
-            "Incubator repo not found or not a git checkout.\n\n"
-            f"Expected: {repo}\n"
-            f"Error: {p.stderr.strip() or '(no stderr)'}\n\n"
-            "This app requires a nested incubator git repo at ./incubator.\n"
-            "On Streamlit Cloud, ensure the repo contents include ./incubator with a working .git directory."
+            "This app must be run from a git checkout.\n"
+            f"cwd={cwd}\n{e.stderr}"
         )
 
-    return Path(p.stdout.strip())
-
 
 _RE_LS_TREE_BLOB = re.compile(r"^\d+\s+blob\s+([0-9a-f]{40})\t(.+)$")
 


---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org