Skip to content

Merge dev to main: Complete CLI subsystem implementation and unit/integration test suite#7

Merged
etcoder-642 merged 42 commits into
mainfrom
dev
Jul 1, 2026
Merged

Merge dev to main: Complete CLI subsystem implementation and unit/integration test suite#7
etcoder-642 merged 42 commits into
mainfrom
dev

Conversation

@etcoder-642

Copy link
Copy Markdown
Owner

Overview

This pull request marks the first stable feature freeze for FlowHook, merging the stabilized dev branch into main for our initial v0.1.0 release.

This iteration completely structures the user-facing command-line interface, links the underlying multi-threaded file-watching architecture directly to user configurations, and unifies our testing matrices.

Core Changes

1. CLI Layer Implementation (Built from Scratch)

  • Developed a Git-like subcommand architecture utilizing standard CLI11 parsing matrices.
  • Implemented core subcommands for environment management: init, add, list, remove, set, check, and run.
  • Engineered robust input validation, graceful error boundaries, and standard --version and --help flag handling hooks.

2. Unified Automated Testing Framework

  • Integrated and stabilized individual unit and integration tests previously isolated in the test/all tracking branch.
  • Added comprehensive coverage sweeps across vital modules:
    • test_filewatcher (inotify event tracking validation)
    • test_task_runner (thread pipeline orchestration loops)
    • test_session_logger (thread-safe structural logging mechanics)
    • test_config_manager (JSON state serialization and environment persistence)
    • test_flowhook_core (end-to-end integration boundaries)

3. Build System Optimization (CMakeLists.txt)

  • Separated core architectural targets into a distinct internal library compilation entity (flowhook_lib).
  • Wrapped the entire testing suite inside a conditional if(BUILD_TESTING) control block to dramatically decrease binary compilation times for general end-users.
  • Configured portable include directories utilizing ${CMAKE_CURRENT_BINARY_DIR} to smoothly manage generated runtime headers like version.h.
  • Documented standard installation matrices for quick binary deployments (curl) and local CMake compilation pipelines.

Verification & Testing

  • Hand-verified system installations to /usr/local/bin/flowhook on WSL/Ubuntu environments.
  • Run local ctest regression sweeps; all 5 testing targets compiled successfully and passed with 0 execution failure states:
    ctest --output-on-failure

Add the command-line interface with init, add, and run subcommands, and
integrate it into the CMake build system.
 - fixed a bug
   BUG: a new flowhook instance have no idea about the previously
   created tasks using another instances so running cli commands is
   prone to error
   FIX: loading every single change to the config file, and populating
   flowhookcore instance from the config file at initialization
Added support for ignoring specific paths and filename patterns in the
file watcher, including default ignores for common build and metadata
files. Updated the CLI to expose these options and refactored the
FileWatcher to support recursive directory scanning with depth limits.
Introduce a `FW_LOG` macro and a `--verbose` flag to the CLI, allowing
conditional output of internal logs.
- Rename `working_directory` to `id` in `Task` struct to serve as a
  unique identifier.
- Update `FlowHookCore` methods to use `task_id` for task lookups.
- Modularize CLI command registration into separate source files.
- Clean up headers and macros.
Implement add, init, list, and run subcommands for the CLI using CLI11.
- Register all CLI command source files in CMake
- Introduce dedicated `--debug` flag alongside `--verbose`
- Implement config file error handling and recovery
- Refactor SessionLogger for dynamic initialization
- Add persistent logging debug messages across the codebase
- Implement `get_watch_list` in `FlowHookCore` and `TaskRunner`
- Update CLI list command to fetch paths from the core
- Format CLI output with additional spacing
- Remove 'tests' branch from CI workflow triggers
- Added `remove` command to CLI and `CMakeLists.txt`
- Added `VALUE_NOT_FOUND` error code
- Implemented `remove_ignored_path` and `remove_ignored_pattern`
- Refactored `TaskRunner` to handle ignore lists internally rather than
  delegating to `FileWatcher`
- Add confirmation requirement for full task removal.
- Correctly load and save ignored paths and patterns in config manager.
- Fix bug where ignored path/pattern removal affected the command list.
- Update debug log messages for clarity.
Update the CI trigger branches and the test runner command. Modify unit
tests to align with the updated Task schema and correct the JSON
configuration filename.
Split path management into separate file and directory paths, implement
idempotent path addition, and update CLI list command to display
resolved files. Update test runner configuration to include missing
test suites.
Standardize task identification by replacing task names with file paths
across the API. Update internal logic to ensure idempotency for task
activation and start operations.
- Added `set` CLI command to configure active status and watching depth.
- Updated core logic to persist task settings and validation.
- Enabled running tasks by active status.
- Cleaned up output formatting in list command.
- Removed unused `isRunning` property from task configuration.
- add tests to test the add, run, init and list subcommands
- refactored existing code to make the tests pass
- Added a `-f` flag to bypass the confirmation dialog when removing a
  task.
- Added a suite of unit tests for the remove command.
- Improved SIGINT handling in `test_run.sh` to ensure clean process
  cleanup.
Implement the `check` subcommand to verify task status (active/inactive)
and retrieve the watching depth for the current directory.
- Add `set` command support for --active, --deactive, and --depth
- Update FlowHookCore to manage task depth and activation status
- Normalize output streams to standard output across CLI commands
- Add unit tests for configuration persistence and validation
Run the project binary installation and execute the full suite of CLI
shell scripts.
Add missing install rule to CMakeLists and verify the binary path in CI.
Install the flowhook_cli executable and create a symlink or rename it to
flowhook in the bin directory to maintain legacy command support.
Automatically remove non-existent file and directory paths when
initializing a task instead of failing the process.
test: comprehensive C++ unit testing and black-box CLI bash test suite
- Replaced internal architecture details with user-facing documentation.
- Updated installation instructions to include release and build steps.
- Added comprehensive CLI command reference for the new subcommand
  interface.
- Included new project branding and demo links.
- Modularize test builds with BUILD_TESTING option.
- Include generated version header in CLI.
- Add --version flag to CLI executable.
- Clean up include paths and target names.
Fix broken anchor links and remove redundant headers.
@etcoder-642 etcoder-642 merged commit cffa0bb into main Jul 1, 2026
2 checks passed
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