Merge dev to main: Complete CLI subsystem implementation and unit/integration test suite#7
Merged
Conversation
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.
implementation for ignored patterns
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This pull request marks the first stable feature freeze for FlowHook, merging the stabilized
devbranch intomainfor our initialv0.1.0release.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)
init,add,list,remove,set,check, andrun.--versionand--helpflag handling hooks.2. Unified Automated Testing Framework
test/alltracking branch.test_filewatcher(inotifyevent 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)flowhook_lib).if(BUILD_TESTING)control block to dramatically decrease binary compilation times for general end-users.${CMAKE_CURRENT_BINARY_DIR}to smoothly manage generated runtime headers likeversion.h.curl) and local CMake compilation pipelines.Verification & Testing
/usr/local/bin/flowhookon WSL/Ubuntu environments.ctestregression sweeps; all 5 testing targets compiled successfully and passed with0execution failure states: