128 Commits

Author SHA1 Message Date
bahdotsh
50e62fbc1f feat: Add comprehensive Podman container runtime support
Add Podman as a new container runtime option alongside Docker and emulation modes,
enabling workflow execution in rootless containers for enhanced security and
compatibility in restricted environments.

Features:
- New PodmanRuntime implementing ContainerRuntime trait
- CLI --runtime flag with docker/podman/emulation options
- TUI runtime cycling (e → Docker → Podman → Emulation)
- Full container lifecycle management (run, pull, build, cleanup)
- Container preservation support with --preserve-containers-on-failure
- Automatic fallback to emulation when Podman unavailable
- Rootless container execution without privileged daemon

Implementation:
- crates/executor/src/podman.rs: Complete Podman runtime implementation
- crates/executor/src/engine.rs: Runtime type enum and initialization
- crates/ui/: TUI integration with runtime switching and status display
- crates/wrkflw/src/main.rs: CLI argument parsing for runtime selection

Testing & Documentation:
- TESTING_PODMAN.md: Comprehensive testing guide
- test-podman-basic.sh: Automated verification script
- test-preserve-containers.sh: Container preservation testing
- MANUAL_TEST_CHECKLIST.md: Manual verification checklist
- README.md: Complete Podman documentation and usage examples

Benefits:
- Organizations restricting Docker installation can use Podman
- Enhanced security through daemonless, rootless architecture
- Drop-in compatibility with existing Docker-based workflows
- Consistent container execution across different environments

Closes: Support for rootless container execution in restricted environments
2025-08-09 15:06:17 +05:30
Gokul
30659ac5d6 Merge pull request #27 from bahdotsh/bahdotsh/validation-exit-codes
feat: add exit code support for validation failures
2025-08-09 14:23:08 +05:30
bahdotsh
b4a73a3cde docs: update README with exit code functionality
- Add comprehensive documentation for new --exit-code and --no-exit-code flags
- Include CI/CD integration examples showing script usage
- Document exit code behavior (0=success, 1=validation failure, 2=usage error)
- Update validation examples to show both success and failure cases
- Add GitLab CI validation examples
- Update feature list to highlight CI/CD integration capabilities
2025-08-09 14:19:24 +05:30
bahdotsh
4802e686de feat: add exit code support for validation failures
- Add --exit-code flag (default: true) to set exit code 1 on validation failure
- Add --no-exit-code flag to disable exit code setting for script flexibility
- Modify validation functions to return boolean failure status
- Track validation failures across multiple files in directory validation
- Ensure proper exit codes for both GitHub workflows and GitLab CI pipelines
- Maintains backwards compatibility while enabling CI/CD integration

Closes #[issue-number] if applicable
2025-08-09 14:18:17 +05:30
Gokul
64621375cb Merge pull request #26 from bahdotsh/bahdotsh/conditional-job-execution
feat: add conditional job execution and flexible needs parsing
2025-08-09 13:40:04 +05:30
bahdotsh
cff8e3f4bd feat: add conditional job execution and flexible needs parsing
- Add support for job-level if conditions with basic expression evaluation
- Support both string and array formats for job needs field (needs: job vs needs: [job])
- Add missing job fields: if_condition, outputs, permissions to Job struct
- Implement job condition evaluation in executor with pattern matching for:
  - Simple boolean conditions (true/false)
  - GitHub event conditions (github.event.pull_request.draft == false)
  - Job output conditions (needs.jobname.outputs.outputname == 'value')
- Jobs with false conditions are now properly skipped with appropriate logging
- Fixes parsing issues with workflows that use changes jobs and conditional execution

Resolves compatibility with workflows like iceoryx2 that use path filtering patterns.
2025-08-09 13:36:03 +05:30
Gokul
4251e6469d feat: add --preserve-containers-on-failure flag for debugging
feat: add --preserve-containers-on-failure flag for debugging
2025-08-09 13:22:50 +05:30
bahdotsh
2ba3dbe65b docs: update README with container preservation feature
- Add documentation for --preserve-containers-on-failure flag
- Include usage examples for both CLI and TUI modes
- Explain when and how containers are preserved for debugging
- Add example of the helpful debugging message users will see
- Update CLI examples section to showcase the new feature
2025-08-09 13:20:17 +05:30
bahdotsh
7edc6b3645 feat: add --preserve-containers-on-failure flag for debugging
- Add CLI flag to preserve Docker containers when tasks fail
- Create ExecutionConfig structure to pass configuration through system
- Modify DockerRuntime to conditionally skip container cleanup on failure
- Add support for both CLI run and TUI modes
- Log helpful debugging messages with container ID and inspection commands
- Preserve containers only when exit_code != 0 and flag is enabled
- Untrack preserved containers from automatic cleanup system

Fixes issue where failed containers were always deleted, preventing users
from inspecting the actual state when debugging workflow failures.
2025-08-09 13:18:08 +05:30
Gokul
93f18d0327 Merge pull request #24 from bahdotsh/bahdotsh/duplicate_id
fix(validators): Add validation for duplicate step IDs within GitHub Actions jobs
2025-08-09 11:40:37 +05:30
bahdotsh
faee4717e1 fix(ui): Fix final io::Error clippy warning
Replace remaining io::Error::new(io::ErrorKind::Other, msg) with
io::Error::other(msg) in workflow validation error handling.

Also apply cargo fmt to fix formatting.
2025-08-09 11:37:40 +05:30
bahdotsh
22389736c3 fix(ui): Fix additional clippy warnings for CI compatibility
- Replace io::Error::new(io::ErrorKind::Other, e) with io::Error::other(e) in workflow handler
- Add explicit lifetime annotations to UI component render methods to fix mismatched-lifetime-syntaxes warnings
- These changes ensure CI passes with -D warnings flag

All changes are backwards compatible and maintain existing functionality.
2025-08-09 11:27:16 +05:30
bahdotsh
699c9250f2 fix(utils): Replace deprecated io::Error::new with io::Error::other
Replace io::Error::new(io::ErrorKind::Other, e) with the newer
io::Error::other(e) method as recommended by clippy.

This fixes CI failures when running with -D warnings that treat
clippy::io_other_error as an error.
2025-08-09 11:16:11 +05:30
bahdotsh
48e944a4cc fix(validators): Add validation for duplicate step IDs within GitHub Actions jobs
GitHub Actions requires step IDs to be unique within each job scope, but wrkflw
was not validating this constraint. This caused workflows with duplicate step
IDs to pass validation with exit code 0, while GitHub would reject them with
"The identifier 'X' may not be used more than once within the same scope".

- Add HashSet tracking of step IDs in validate_steps()
- Check for duplicate IDs and report validation errors
- Use GitHub's exact error message format for consistency
- Step IDs can still be duplicated across different jobs (which is valid)

Fixes validation gap that allowed invalid workflows to pass undetected.
2025-08-09 10:25:06 +05:30
bahdotsh
d5d1904d0a fix: make gitlab pipelines show up in tui 2025-05-02 15:56:58 +05:30
bahdotsh
00fa569add fix: fixed the issues in viewing step details in non verbose mode 2025-05-02 15:45:51 +05:30
bahdotsh
a97398f949 formatted 2025-05-02 15:09:26 +05:30
bahdotsh
e73b0df520 feat(gitlab): add comprehensive GitLab CI/CD pipeline support
This commit adds full support for GitLab CI/CD pipelines:

- Add GitLab CI pipeline models with complete spec support (jobs, stages, artifacts, cache, etc.)
- Implement GitLab CI/CD pipeline parsing and validation
- Add schema validation against GitLab CI JSON schema
- Support automatic pipeline type detection based on filename and content
- Add GitLab-specific CLI commands and flags
- Implement pipeline conversion for executor compatibility
- Add validation for common GitLab CI configuration issues
- Update CLI help text to reflect GitLab CI/CD support
- Support listing both GitHub and GitLab pipeline files

This expands wrkflw to be a multi-CI tool that can validate and execute both GitHub
Actions workflows and GitLab CI/CD pipelines locally.
2025-05-02 15:08:59 +05:30
bahdotsh
9f51e26eb3 refactor(ui): modularize UI crate for improved maintainability
- Split monolithic lib.rs (3700+ lines) into logical modules
- Create directory structure for app, models, components, handlers, utils, and views
- Implement reusable UI components (Button, Checkbox, ProgressBar)
- Separate view rendering code by screen function
- Fix all compiler warnings and linter issues
- Maintain existing functionality while improving code organization
- Follow Rust best practices for module hierarchy and separation of concerns

This change makes the UI codebase easier to navigate, maintain and extend
without changing any of the existing behavior.
2025-05-02 14:16:13 +05:30
bahdotsh
3a88b33c83 refactor(workspace): move top-level src to crates/wrkflw
Consolidated the main binary (main.rs) and library root (lib.rs)
from the top-level src/ directory into the dedicated crates/wrkflw
crate. This aligns the project structure with standard Rust
workspace conventions.

- Moved src/main.rs to crates/wrkflw/src/main.rs
- Moved src/lib.rs to crates/wrkflw/src/lib.rs
- Updated use statements in crates/wrkflw/src/main.rs to directly reference other workspace crates (e.g., `executor`, `parser`).
- Updated crates/wrkflw/src/lib.rs to re-export workspace crates.
- Configured crates/wrkflw/Cargo.toml for both `[lib]` and `[[bin]]` targets.
- Removed the top-level src/ directory.
2025-05-02 13:01:54 +05:30
bahdotsh
3a9f4f1101 formatted 2025-05-02 12:54:50 +05:30
bahdotsh
470132c5bf Refactor: Migrate modules to workspace crates
- Extracted functionality from the `src/` directory into individual crates within the `crates/` directory. This improves modularity, organization, and separation of concerns.
- Migrated modules include: models, evaluator, ui, gitlab, utils, logging, github, matrix, executor, runtime, parser, and validators.
- Removed the original source files and directories from `src/` after successful migration.
- This change sets the stage for better code management and potentially independent development/versioning of workspace members.
2025-05-02 12:53:41 +05:30
bahdotsh
6ee550d39e cliff update v0.4.0 2025-04-30 17:57:29 +05:30
bahdotsh
16fc7ca83e cliff update 2025-04-30 17:52:18 +05:30
bahdotsh
61cb474c01 Fix invalid escape sequence in cliff.toml 2025-04-30 17:46:55 +05:30
bahdotsh
d8cf675f37 cliff update 2025-04-30 17:41:16 +05:30
bahdotsh
6f09411c6f cliff update 2025-04-30 17:35:06 +05:30
bahdotsh
62475282ee cliff update 2025-04-30 17:32:18 +05:30
bahdotsh
89f255b226 cliff update 2025-04-30 17:22:38 +05:30
bahdotsh
fffa920e4a cliff update 2025-04-30 17:10:56 +05:30
bahdotsh
27f5229325 cliff update 2025-04-30 17:10:35 +05:30
bahdotsh
26e1ccf7c3 cliff update 2025-04-30 17:04:33 +05:30
bahdotsh
f658cf409d cliff update 2025-04-30 17:00:22 +05:30
bahdotsh
b17cfd10fb version update 2025-04-30 16:55:28 +05:30
bahdotsh
f97c3304cb docs: updated the changelog format 2025-04-30 16:53:51 +05:30
bahdotsh
34e1fc513e ix(executor): correct image selection and workspace mapping for run steps
Previously, `run` steps in Docker jobs were failing due to several issues:
- They were hardcoded to use `ubuntu:latest`, which often lacked necessary tools like `cargo`.
- Even when the image was correct, the host workspace directory was not properly mapped into the container, preventing access to source files.

This commit addresses these issues by:
- Using the correct runner image specified by the job's `runs_on` field for `run` steps, instead of always defaulting to `ubuntu:latest`.
- Updating the `get_runner_image` function to map `macos-latest` runners to `rust:latest` to ensure the Rust toolchain is available for relevant workflows.
- Correctly mapping the host working directory to `/github/workspace` within the container for `run` steps.
- Setting the container's working directory to `/github/workspace` when executing `run` steps.

This allows commands like `cargo build` and `cargo test` within `run` steps to find both the necessary tools and the project source code inside the container.
2025-04-30 16:51:38 +05:30
bahdotsh
e978d09a7d refactor: refactored all the test files 2025-04-30 16:14:28 +05:30
bahdotsh
7bd7cc3b2b fix(validator): add support for GitHub Actions reusable workflow validation
Enhance the workflow validator to correctly handle GitHub Actions reusable workflows:
- Skip validation of 'runs-on' field for jobs with a 'uses' field
- Skip validation of the 'steps' field for reusable workflow jobs
- Add specific format validation for reusable workflow references
- Make workflow name optional for files that only contain reusable workflow jobs
- Add comprehensive test workflow files for various reusable workflow scenarios

This fixes validation errors when using GitHub's workflow_call feature that
allows reusing workflows from other repositories or local files.
2025-04-30 15:36:38 +05:30
bahdotsh
8975519c03 chore: update README with roadmap 2025-04-25 15:55:38 +05:30
bahdotsh
dff56fd855 fix variable name 2025-04-25 15:47:34 +05:30
bahdotsh
49a5eec484 reafactor example yml files 2025-04-25 15:33:26 +05:30
bahdotsh
fb1c636971 feat: add GitLab pipeline integration 2025-04-25 15:32:04 +05:30
bahdotsh
0c5460e6ea feat: add GitLab pipeline integration 2025-04-25 15:31:46 +05:30
bahdotsh
f1421dc154 fix: fix trigger issues 2025-04-25 13:21:45 +05:30
bahdotsh
189fc0f97b added workflow dispatch 2025-04-25 12:49:01 +05:30
bahdotsh
46cd1d6e33 updated README 2025-04-24 18:34:47 +05:30
bahdotsh
6e3d61efe3 feat: added github workflow schemas for better handling the workflows 2025-04-24 18:10:52 +05:30
bahdotsh
674af353f1 clippy fixes 2025-04-24 17:45:31 +05:30
bahdotsh
0acc65ff79 feat: better ouputs 2025-04-24 16:49:07 +05:30
bahdotsh
e524122f62 feat: detailed verbose and debug outputs of steps 2025-04-24 16:06:53 +05:30