Skip to content

Comments

Development#5

Merged
assembler-0 merged 2 commits intomainfrom
Development
Sep 20, 2025
Merged

Development#5
assembler-0 merged 2 commits intomainfrom
Development

Conversation

@assembler-0
Copy link
Owner

@assembler-0 assembler-0 commented Sep 20, 2025

Summary by CodeRabbit

  • New Features

    • Added a cross-platform process execution API: spawn/execute commands, capture stdout/stderr, set timeouts, working directory, and environment; provides result metadata (exit info, timing, resource usage, signals).
  • Refactor

    • Improved reliability: safer process/pipe lifecycle, stronger timeout and wait behavior, case-insensitive environment merging on Windows, and faster output polling for more responsive capture.
  • Chores

    • Temporarily disabled test coverage upload in CI.
    • Enabled stricter compilation with pedantic checks.

@coderabbitai
Copy link

coderabbitai bot commented Sep 20, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Disables Codecov steps in CI. Updates CMake flags and definitions, adjusts test target sources, and adds EXIT_FAIL_EC. Refactors CatalystCX.hpp for pipe lifecycle, environment merging, and wait/timeout handling. Adds a include in Evaluate.cpp. Introduces a new exported C++ module (CatalystCX.cppm) implementing cross-platform process execution.

Changes

Cohort / File(s) Summary
CI Workflow
.github/workflows/ci.yml
Commented out Codecov-related “Run tests and collect coverage” steps, leaving other CI steps unchanged.
Build Configuration
CMakeLists.txt
Added -pedantic to CXX flags, defined EXIT_FAIL_EC=127, removed CatalystCX.hpp from cxtest sources, formatting newline.
Core Process Header Refactor
CatalystCX.hpp
Added Windows PipesClosed member and lifecycle tracking; tightened handle/FD cleanup; case-insensitive env merge on Windows; refined timeout/wait and output capture; adjusted polling interval on Unix.
Source Include Adjustment
Evaluate.cpp
Added #include <vector>.
New C++ Module API
module/CatalystCX.cppm
Added exported module CatalystCX with Command, Child, CommandResult, ExecutionValidator, and SignalInfo; implements cross-platform spawn/execute, async I/O, timeouts, and usage collection.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Caller
  participant Command as Command
  participant OS as Platform APIs
  participant Child as Child
  participant Reader as Async Pipe Reader

  Caller->>Command: Execute()
  Command->>Command: Validate executable/env/args
  Command->>OS: Setup pipes, working dir, env
  OS-->>Command: Handles/FDs
  Command->>OS: Spawn process
  OS-->>Command: PID/handles (or error)
  alt spawn success
    Command->>Child: Construct with PID/handles
    Command->>Reader: Start stdout/stderr reads
    Command->>Child: Wait(timeout?)
    Child->>OS: Wait for process exit / poll
    OS-->>Child: Exit status/usage
    Reader-->>Child: Collected stdout/stderr
    Child-->>Command: CommandResult
    Command-->>Caller: CommandResult
  else spawn failure
    Command->>OS: Close handles/cleanup
    Command-->>Caller: Failure result (ExitCode=EXIT_FAIL_EC)
  end
Loading
sequenceDiagram
  autonumber
  participant Caller as Caller of Wait()
  participant Child as Child
  participant OS as Platform APIs
  participant Reader as Async Pipe Reader

  Caller->>Child: Wait(optional timeout)
  par Async read
    Child->>Reader: Read stdout/stderr non-blocking
  and Process wait
    alt timeout specified
      Child->>OS: Wait until deadline
      opt timeout reached
        Child-->>Caller: Result with TimedOut=true
      end
    else no timeout
      Child->>OS: Wait for completion
    end
  end
  Child->>OS: Gather rusage/process times
  Reader-->>Child: Final buffers
  Child->>Child: Mark pipes closed / cleanup
  Child-->>Caller: Result (exit/signals, outputs, usage)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • New changes #1 — Also restructures the CatalystCX process-execution API and build setup, overlapping with the new module and command/child/result types.
  • Development #2 — Touches the same files (CMakeLists.txt, CatalystCX.hpp, Evaluate.cpp, CI workflow), indicating direct code-level overlap.
  • Better test suite #3 — Modifies async I/O, waiting, and environment handling in CatalystCX, closely matching the header refactor and module behavior.

Poem

I thump my paw on build-time ground,
Pipes now close with safer sound.
A module hops across the glade,
Commands spawn, results are made.
CI naps—no cover run—
Still, the process race is won.
Carrot-shaped exec time: fun! 🥕🐇

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Development

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1ebe2d5 and 509618e.

📒 Files selected for processing (5)
  • .github/workflows/ci.yml (1 hunks)
  • CMakeLists.txt (2 hunks)
  • CatalystCX.hpp (12 hunks)
  • Evaluate.cpp (1 hunks)
  • module/CatalystCX.cppm (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@assembler-0 assembler-0 merged commit 9461d9c into main Sep 20, 2025
2 of 3 checks passed
This was referenced Sep 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant