diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 194a5a2..9704a37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,10 @@ on: - full-integration (with examples) - all +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: CARGO_TERM_COLOR: always RUST_BACKTRACE: 1 @@ -91,13 +95,11 @@ jobs: name: Integration Tests runs-on: ubuntu-latest timeout-minutes: 15 - # Always run on push to main/master and PRs, or when manually triggered + # Run on all PRs and pushes to main/master, or when manually triggered if: >- + github.event_name == 'pull_request' || (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')) || - github.event_name == 'pull_request' || - (github.event_name == 'workflow_dispatch' && - (github.event.inputs.test_type == 'integration' || - github.event.inputs.test_type == 'all')) + github.event_name == 'workflow_dispatch' services: postgres: @@ -153,13 +155,11 @@ jobs: name: Full Integration Tests (with Examples) runs-on: ubuntu-latest timeout-minutes: 20 - # Run on main branch, or when manually triggered with 'full-integration' or 'all' + # Run on all PRs and pushes to main/master, or when manually triggered if: >- - github.ref == 'refs/heads/main' || - github.ref == 'refs/heads/master' || - (github.event_name == 'workflow_dispatch' && - (github.event.inputs.test_type == 'full-integration (with examples)' || - github.event.inputs.test_type == 'all')) + github.event_name == 'pull_request' || + github.event_name == 'push' || + github.event_name == 'workflow_dispatch' services: postgres: diff --git a/crates/zart/src/lib.rs b/crates/zart/src/lib.rs index f475f79..5650072 100644 --- a/crates/zart/src/lib.rs +++ b/crates/zart/src/lib.rs @@ -60,7 +60,7 @@ //! //! Register the handler, start a worker, and fire an execution: //! -//! ```rust,ignore +//! ```text //! let mut registry = TaskRegistry::new(); //! registry.register("onboard-user", OnboardUser); //! diff --git a/crates/zart/src/registry.rs b/crates/zart/src/registry.rs index 4ba1869..0d4f6c0 100644 --- a/crates/zart/src/registry.rs +++ b/crates/zart/src/registry.rs @@ -251,6 +251,11 @@ impl TaskRegistry { self.handlers.get(task_name).map(|h| h.as_ref()) } + /// Returns the names of all registered handlers (for diagnostics). + pub(crate) fn handler_names(&self) -> Vec<&str> { + self.handlers.keys().map(|s| s.as_str()).collect() + } + /// Execute a registered handler with the given raw JSON data. /// /// This sets up task-local scoping and delegates to the internal adapter. diff --git a/crates/zart/src/worker.rs b/crates/zart/src/worker.rs index 1874fa5..605cffe 100644 --- a/crates/zart/src/worker.rs +++ b/crates/zart/src/worker.rs @@ -391,7 +391,11 @@ async fn dispatch_task( let handler = match registry.get_handler(&task.task_name) { Some(h) => h, None => { - warn!("No handler registered for task {}", &task.task_name); + warn!( + "No handler registered for task '{}'; registered handlers: [{}]", + &task.task_name, + registry.handler_names().join(", ") + ); let _ = scheduler .mark_failed( &task.task_id,