You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@burr.apache.org by eb...@apache.org on 2026/01/10 19:50:27 UTC

(burr) branch elijah/apache_script_fixes created (now 94e32f7a)

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

ebenizzy pushed a change to branch elijah/apache_script_fixes
in repository https://gitbox.apache.org/repos/asf/burr.git


      at 94e32f7a WIP

This branch includes the following new commits:

     new baa78e3d WIP
     new 94e32f7a WIP

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(burr) 01/02: WIP

Posted by eb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ebenizzy pushed a commit to branch elijah/apache_script_fixes
in repository https://gitbox.apache.org/repos/asf/burr.git

commit baa78e3d7c9b0e7a80b09f9dec58eb017b07ec8e
Author: Elijah ben Izzy <eb...@salesforce.com>
AuthorDate: Thu Jan 8 15:08:02 2026 -0800

    WIP
---
 burr/cli/__main__.py      | 10 ++++++----
 pyproject.toml            |  2 +-
 scripts/apache_release.py | 20 +++++++++-----------
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/burr/cli/__main__.py b/burr/cli/__main__.py
index 109eb835..aeb56f7d 100644
--- a/burr/cli/__main__.py
+++ b/burr/cli/__main__.py
@@ -132,7 +132,8 @@ def cli():
     pass
 
 
-def _build_ui():
+def run_build_ui_bash_commands():
+    """Execute the bash commands to build UI artifacts."""
     cmd = "npm install --prefix telemetry/ui"
     _command(cmd, capture_output=False)
     cmd = "npm run build --prefix telemetry/ui"
@@ -146,12 +147,13 @@ def _build_ui():
     _command(cmd, capture_output=False)
 
 
-@cli.command()
+@cli.command(name="build-ui")
 def build_ui():
+    """Build the UI artifacts from source."""
     git_root = _get_git_root()
     logger.info("UI build: using project root %s", git_root)
     with cd(git_root):
-        _build_ui()
+        run_build_ui_bash_commands()
 
 
 BACKEND_MODULES = {
@@ -246,7 +248,7 @@ def build_and_publish(prod: bool, no_wipe_dist: bool):
     git_root = _get_git_root()
     with cd(git_root):
         logger.info("Building UI -- this may take a bit...")
-        _build_ui()
+        build_ui()
         logger.info("Built UI!")
         if not no_wipe_dist:
             logger.info("Wiping dist/ directory for a clean publish.")
diff --git a/pyproject.toml b/pyproject.toml
index 7b8da0fa..e6e61e37 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -21,7 +21,7 @@ build-backend = "flit_core.buildapi"
 
 [project]
 name = "apache-burr"
-version = "0.40.2"
+version = "0.41.0"
 dependencies = [] # yes, there are none
 requires-python = ">=3.9"
 authors = [
diff --git a/scripts/apache_release.py b/scripts/apache_release.py
index 4edba961..27cdb921 100644
--- a/scripts/apache_release.py
+++ b/scripts/apache_release.py
@@ -401,7 +401,7 @@ def _build_sdist_from_git(version: str, output_dir: str = "dist") -> str:
 
 
 def _build_ui_artifacts() -> None:
-    """Build UI artifacts using burr-admin-build-ui."""
+    """Build UI artifacts using burr's build function."""
     print("Building UI artifacts...")
 
     ui_build_dir = "burr/tracking/server/build"
@@ -410,18 +410,16 @@ def _build_ui_artifacts() -> None:
     if os.path.exists(ui_build_dir):
         shutil.rmtree(ui_build_dir)
 
-    # Check for burr-admin-build-ui
-    if shutil.which("burr-admin-build-ui") is None:
-        _fail("burr-admin-build-ui not found. Install with: pip install -e .[cli]")
-
-    # Build UI
-    env = os.environ.copy()
-    env["BURR_PROJECT_ROOT"] = os.getcwd()
-
+    # Import and call burr's build UI function directly
+    print("  Running burr's UI build...")
     try:
-        subprocess.run(["burr-admin-build-ui"], check=True, env=env, capture_output=True)
+        from burr.cli.__main__ import run_build_ui_bash_commands
+
+        run_build_ui_bash_commands()
         print("  ✓ UI artifacts built successfully")
-    except subprocess.CalledProcessError as e:
+    except ImportError as e:
+        _fail(f"Could not import burr's build function. Make sure you're in the project root: {e}")
+    except Exception as e:
         _fail(f"Error building UI: {e}")
 
     # Verify


(burr) 02/02: WIP

Posted by eb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ebenizzy pushed a commit to branch elijah/apache_script_fixes
in repository https://gitbox.apache.org/repos/asf/burr.git

commit 94e32f7a7aecdc12943ff1e040d55bf58a104573
Author: Elijah ben Izzy <eb...@salesforce.com>
AuthorDate: Sat Jan 10 11:22:19 2026 -0800

    WIP
---
 pyproject.toml            |   2 +-
 scripts/apache_release.py | 159 ++++++++++++++++++++++++++++++----------------
 2 files changed, 106 insertions(+), 55 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index e6e61e37..7b8da0fa 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -21,7 +21,7 @@ build-backend = "flit_core.buildapi"
 
 [project]
 name = "apache-burr"
-version = "0.41.0"
+version = "0.40.2"
 dependencies = [] # yes, there are none
 requires-python = ">=3.9"
 authors = [
diff --git a/scripts/apache_release.py b/scripts/apache_release.py
index 27cdb921..7a728005 100644
--- a/scripts/apache_release.py
+++ b/scripts/apache_release.py
@@ -79,6 +79,46 @@ def _print_step(step_num: int, total: int, description: str) -> None:
     print("-" * 80)
 
 
+def _run_command(
+    cmd: list[str],
+    description: str,
+    error_message: str,
+    success_message: Optional[str] = None,
+    capture_output: bool = True,
+    **kwargs,
+) -> subprocess.CompletedProcess:
+    """Run a subprocess command with consistent error handling and output.
+
+    Args:
+        cmd: Command and arguments as list
+        description: What we're doing (printed before running)
+        error_message: Error message prefix if command fails
+        success_message: Optional success message (printed after if provided)
+        capture_output: Whether to capture stdout/stderr (default True)
+        **kwargs: Additional arguments to pass to subprocess.run
+
+    Returns:
+        CompletedProcess instance
+    """
+    if description:
+        print(f"  {description}")
+
+    try:
+        result = subprocess.run(
+            cmd,
+            check=True,
+            capture_output=capture_output,
+            text=True,
+            **kwargs,
+        )
+        if success_message:
+            print(f"    ✓ {success_message}")
+        return result
+    except subprocess.CalledProcessError as e:
+        error_detail = f": {e.stderr}" if capture_output and e.stderr else ""
+        _fail(f"{error_message}{error_detail}")
+
+
 # ============================================================================
 # Environment Validation
 # ============================================================================
@@ -200,14 +240,13 @@ def _sign_artifact(artifact_path: str) -> tuple[str, str]:
     checksum_path = f"{artifact_path}.sha512"
 
     # GPG signature
-    try:
-        subprocess.run(
-            ["gpg", "--armor", "--output", signature_path, "--detach-sig", artifact_path],
-            check=True,
-        )
-        print(f"  ✓ Created GPG signature: {signature_path}")
-    except subprocess.CalledProcessError as e:
-        _fail(f"Error signing artifact: {e}")
+    _run_command(
+        ["gpg", "--armor", "--output", signature_path, "--detach-sig", artifact_path],
+        description="",
+        error_message="Error signing artifact",
+        capture_output=False,
+    )
+    print(f"  ✓ Created GPG signature: {signature_path}")
 
     # SHA512 checksum
     sha512_hash = hashlib.sha512()
@@ -306,22 +345,21 @@ def _create_git_archive(version: str, rc_num: str, output_dir: str = "dist") ->
     archive_path = os.path.join(output_dir, archive_name)
     prefix = f"apache-burr-{version}-incubating/"
 
-    try:
-        subprocess.run(
-            [
-                "git",
-                "archive",
-                "HEAD",
-                f"--prefix={prefix}",
-                "--format=tar.gz",
-                "--output",
-                archive_path,
-            ],
-            check=True,
-        )
-        print(f"  ✓ Created git archive: {archive_path}")
-    except subprocess.CalledProcessError as e:
-        _fail(f"Error creating git archive: {e}")
+    _run_command(
+        [
+            "git",
+            "archive",
+            "HEAD",
+            f"--prefix={prefix}",
+            "--format=tar.gz",
+            "--output",
+            archive_path,
+        ],
+        description="",
+        error_message="Error creating git archive",
+        capture_output=False,
+    )
+    print(f"  ✓ Created git archive: {archive_path}")
 
     file_size = os.path.getsize(archive_path)
     print(f"  ✓ Archive size: {file_size:,} bytes")
@@ -359,20 +397,15 @@ def _build_sdist_from_git(version: str, output_dir: str = "dist") -> str:
     _remove_ui_build_artifacts()
     _check_git_working_tree()
 
-    print("  Running flit build --format sdist...")
-    try:
-        env = os.environ.copy()
-        env["FLIT_USE_VCS"] = "0"
-        subprocess.run(
-            ["flit", "build", "--format", "sdist"],
-            env=env,
-            capture_output=True,
-            text=True,
-            check=True,
-        )
-        print("    ✓ flit sdist created successfully")
-    except subprocess.CalledProcessError as e:
-        _fail(f"Failed to build sdist: {e.stderr}")
+    env = os.environ.copy()
+    env["FLIT_USE_VCS"] = "0"
+    _run_command(
+        ["flit", "build", "--format", "sdist"],
+        description="Running flit build --format sdist...",
+        error_message="Failed to build sdist",
+        success_message="flit sdist created successfully",
+        env=env,
+    )
 
     # Find and rename sdist
     expected_pattern = f"dist/apache_burr-{version.lower()}.tar.gz"
@@ -401,26 +434,46 @@ def _build_sdist_from_git(version: str, output_dir: str = "dist") -> str:
 
 
 def _build_ui_artifacts() -> None:
-    """Build UI artifacts using burr's build function."""
+    """Build UI artifacts (npm build + copy to burr/tracking/server/build).
+
+    This replicates the logic from burr.cli.__main__.run_build_ui_bash_commands()
+    without requiring burr to be installed.
+    """
     print("Building UI artifacts...")
 
+    ui_source_dir = "telemetry/ui"
     ui_build_dir = "burr/tracking/server/build"
 
     # Clean existing UI build
     if os.path.exists(ui_build_dir):
         shutil.rmtree(ui_build_dir)
 
-    # Import and call burr's build UI function directly
-    print("  Running burr's UI build...")
-    try:
-        from burr.cli.__main__ import run_build_ui_bash_commands
+    # Install npm dependencies
+    _run_command(
+        ["npm", "install", "--prefix", ui_source_dir],
+        description="Installing npm dependencies...",
+        error_message="npm install failed",
+        success_message="npm dependencies installed",
+    )
+
+    # Build UI with npm
+    _run_command(
+        ["npm", "run", "build", "--prefix", ui_source_dir],
+        description="Building UI with npm...",
+        error_message="npm build failed",
+        success_message="npm build completed",
+    )
+
+    # Copy build artifacts
+    print("  Copying build artifacts...")
+    os.makedirs(ui_build_dir, exist_ok=True)
+    ui_output = os.path.join(ui_source_dir, "build")
 
-        run_build_ui_bash_commands()
-        print("  ✓ UI artifacts built successfully")
-    except ImportError as e:
-        _fail(f"Could not import burr's build function. Make sure you're in the project root: {e}")
+    try:
+        shutil.copytree(ui_output, ui_build_dir, dirs_exist_ok=True)
+        print("    ✓ Build artifacts copied")
     except Exception as e:
-        _fail(f"Error building UI: {e}")
+        _fail(f"Failed to copy build artifacts: {e}")
 
     # Verify
     if not os.path.exists(ui_build_dir) or not os.listdir(ui_build_dir):
@@ -503,13 +556,13 @@ def _build_wheel_from_current_dir(version: str, output_dir: str = "dist") -> str
         env = os.environ.copy()
         env["FLIT_USE_VCS"] = "0"
 
-        subprocess.run(
+        _run_command(
             ["flit", "build", "--format", "wheel"],
+            description="",
+            error_message="Wheel build failed",
+            success_message="Wheel built successfully",
             env=env,
-            check=True,
-            capture_output=True,
         )
-        print("    ✓ Wheel built successfully")
 
         # Find the wheel
         wheel_pattern = f"dist/apache_burr-{version}*.whl"
@@ -523,8 +576,6 @@ def _build_wheel_from_current_dir(version: str, output_dir: str = "dist") -> str
 
         return wheel_path
 
-    except subprocess.CalledProcessError as e:
-        _fail(f"Wheel build failed: {e}")
     finally:
         # Always restore symlinks
         if copied: