From d24c1b343fb1c3675bb9d1b19b885f87d5b326c3 Mon Sep 17 00:00:00 2001 From: mr-chelyshkin Date: Tue, 28 Oct 2025 16:10:07 +0400 Subject: [PATCH 1/8] use predefined image with cargo tools --- Taskfile.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index f1414c4..5b58e26 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -4,7 +4,7 @@ vars: git_root: sh: git rev-parse --show-toplevel - rust_version: "1.90" + rust_version: "1.90.0" cache_dir: ".cache" tasks: @@ -59,7 +59,7 @@ tasks: - cmd: mkdir -p "{{.git_root}}/{{.cache_dir}}" - task: _docker/run vars: - IMAGE: "rust:{{.rust_version}}-slim" + IMAGE: "ghcr.io/soltihq/cargo-tools:{{.rust_version}}" CMD: "{{.CMD}}" MOUNT_DIR: "." VOLUMES: @@ -67,6 +67,8 @@ tasks: ENVS: - "CARGO_TARGET_DIR=/tmp/{{.cache_dir}}/target" - "CARGO_HOME=/tmp/{{.cache_dir}}/cargo" + - "RUSTUP_TOOLCHAIN={{.rust_version}}" + - "RUSTUP_NO_UPDATE_CHECK=1" - "CARGO_INCREMENTAL=0" # ================================================# @@ -78,18 +80,18 @@ tasks: cmds: - task: _cargo/tool vars: - CMD: "rustup component add rustfmt && cargo fmt --check --verbose" + CMD: "fmt --check --verbose" cargo/clippy: desc: Run 'cargo clippy'. cmds: - task: _cargo/tool vars: - CMD: "rustup component add clippy && cargo clippy --all --all-features -- -D warnings" + CMD: "clippy --all --all-features -- -D warnings" cargo/test: desc: Run 'cargo test'. cmds: - task: _cargo/tool vars: - CMD: "cargo test --all --all-features" + CMD: "test --all --all-features" From 791b1509be8705ac1ecb2faec0f542e5d80874af Mon Sep 17 00:00:00 2001 From: mr-chelyshkin Date: Tue, 28 Oct 2025 16:13:41 +0400 Subject: [PATCH 2/8] use remote task action --- .github/actions/taskfile/action.yml | 61 ----------------------------- .github/workflows/.checks.yml | 6 +-- 2 files changed, 3 insertions(+), 64 deletions(-) delete mode 100644 .github/actions/taskfile/action.yml diff --git a/.github/actions/taskfile/action.yml b/.github/actions/taskfile/action.yml deleted file mode 100644 index feb607f..0000000 --- a/.github/actions/taskfile/action.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Task Runner -description: Invoke Task commands - -inputs: - command: - description: Task command to run - required: true - vars: - description: Envs for command as key=value,key=value - required: false - dir: - description: Working directory - required: false - default: '.' - version: - description: Version - required: false - default: '3.44.1' - -runs: - using: composite - steps: - - name: Cache Task binary - id: cache - uses: actions/cache@v4 - with: - path: /usr/local/bin/task - key: task-${{ inputs.version }}-linux-amd64 - - - name: Install Task - if: steps.cache.outputs.cache-hit != 'true' - shell: bash - run: | - set -euo pipefail - - URL="https://github.com/go-task/task/releases/download/v${{ inputs.version }}/task_linux_amd64.tar.gz" - curl -fsSL "$URL" | tar -xz task - sudo install -m 755 task /usr/local/bin/task - - - name: Verify Task - shell: bash - run: task --version - - - name: Export environment variables - if: ${{ inputs.vars != '' }} - shell: bash - run: | - set -euo pipefail - - IFS=',' read -ra VARS <<< "${{ inputs.vars }}" - for var in "${VARS[@]}"; do - [[ "$var" =~ ^([^=]+)=(.+)$ ]] && echo "${BASH_REMATCH[1]}=${BASH_REMATCH[2]}" >> "$GITHUB_ENV" - done - - - name: Run Task command - shell: bash - working-directory: ${{ inputs.dir }} - run: | - set -euo pipefail - echo "🚀 Running task ${{ inputs.command }}" - task ${{ inputs.command }} diff --git a/.github/workflows/.checks.yml b/.github/workflows/.checks.yml index 8fadc2c..52a7786 100644 --- a/.github/workflows/.checks.yml +++ b/.github/workflows/.checks.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Run fmt - uses: ./.github/actions/taskfile + uses: soltiHQ/actions/taskfile@main with: { command: cargo/fmt } test: @@ -32,7 +32,7 @@ jobs: with: { job_name: test } - name: Run Job - uses: ./.github/actions/taskfile + uses: soltiHQ/actions/taskfile@main with: { command: cargo/test } - name: Put Cache @@ -51,7 +51,7 @@ jobs: with: { job_name: clippy } - name: Run Job - uses: ./.github/actions/taskfile + uses: soltiHQ/actions/taskfile@main with: { command: cargo/clippy } - name: Put Cache From 1ee1586cfa9ce3ccf27ecacfc610f2089f116531 Mon Sep 17 00:00:00 2001 From: mr-chelyshkin Date: Tue, 28 Oct 2025 16:47:46 +0400 Subject: [PATCH 3/8] update --- .github/workflows/.checks.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/.checks.yml b/.github/workflows/.checks.yml index 52a7786..41bce08 100644 --- a/.github/workflows/.checks.yml +++ b/.github/workflows/.checks.yml @@ -2,16 +2,6 @@ name: Checks on: { workflow_call: {} } -permissions: { - contents: read, - actions: write -} - -env: - CI: "true" - RUST_BACKTRACE: "1" - CARGO_TERM_COLOR: "always" - jobs: fmt: runs-on: ${{ vars.RUNS_ON }} From a4d299f3d1524e30d0ee82b6d5b748094a1dc3ed Mon Sep 17 00:00:00 2001 From: mr-chelyshkin Date: Tue, 28 Oct 2025 18:43:24 +0400 Subject: [PATCH 4/8] update docs flags --- src/core/builder.rs | 1 - src/core/supervisor.rs | 2 -- src/lib.rs | 3 --- 3 files changed, 6 deletions(-) diff --git a/src/core/builder.rs b/src/core/builder.rs index 1e1509a..ca9b823 100644 --- a/src/core/builder.rs +++ b/src/core/builder.rs @@ -46,7 +46,6 @@ impl SupervisorBuilder { /// /// Requires the `controller` feature flag. #[cfg(feature = "controller")] - #[cfg_attr(docsrs, doc(cfg(feature = "controller")))] pub fn with_controller(mut self, config: crate::controller::ControllerConfig) -> Self { self.controller_config = Some(config); self diff --git a/src/core/supervisor.rs b/src/core/supervisor.rs index 3edc512..8a94a3d 100644 --- a/src/core/supervisor.rs +++ b/src/core/supervisor.rs @@ -263,7 +263,6 @@ impl Supervisor { /// /// Requires the `controller` feature flag. #[cfg(feature = "controller")] - #[cfg_attr(docsrs, doc(cfg(feature = "controller")))] pub async fn submit( &self, spec: crate::controller::ControllerSpec, @@ -280,7 +279,6 @@ impl Supervisor { /// /// Requires the `controller` feature flag. #[cfg(feature = "controller")] - #[cfg_attr(docsrs, doc(cfg(feature = "controller")))] pub fn try_submit( &self, spec: crate::controller::ControllerSpec, diff --git a/src/lib.rs b/src/lib.rs index 8250c46..17c6665 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,3 @@ -#![doc(html_no_source)] -#![cfg_attr(docsrs, feature(doc_cfg))] - //! # taskvisor //! //! **Taskvisor** is a lightweight task orchestration library for Rust. From 87293d8848e6a192fa0c24a0245caaa276af676f Mon Sep 17 00:00:00 2001 From: mr-chelyshkin Date: Tue, 28 Oct 2025 19:14:42 +0400 Subject: [PATCH 5/8] add gen doc task --- Taskfile.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Taskfile.yml b/Taskfile.yml index 5b58e26..03229d7 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -95,3 +95,13 @@ tasks: - task: _cargo/tool vars: CMD: "test --all --all-features" + + cargo/docs: + desc: Run 'rustdoc'. + cmds: + - task: _cargo/tool + vars: + CMD: >- + +nightly rustdoc --lib -Zrustdoc-map --features "logging controller" + --offline -Zunstable-options -Zrustdoc-scrape-examples + --config 'build.rustdocflags=["--cfg","docsrs","-Z","unstable-options","--cap-lints","warn"]' From 15a6a51fce8bc192fcb91b0ce8ac76722b8ce152 Mon Sep 17 00:00:00 2001 From: mr-chelyshkin Date: Tue, 28 Oct 2025 19:59:18 +0400 Subject: [PATCH 6/8] fix docs --- src/lib.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 17c6665..240adf4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,8 +10,8 @@ //! ### Overview //! ```text //! ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ -//! │ TaskSpec │ … │ TaskSpec │ … │ TaskSpec │ -//! │(user task #1)│ … │(user task #2)│ … │(user task #3)│ +//! │ TaskSpec │ │ TaskSpec │ │ TaskSpec │ +//! │(user task #1)│ │(user task #2)│ │(user task #3)│ //! └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ //! ▼ ▼ ▼ //! ┌───────────────────────────────────────────────────────────────────┐ @@ -37,7 +37,7 @@ //! ┌───────────────────────────────────────────────────────────────────┐ //! │ Bus (broadcast channel) │ //! │ (capacity: Config::bus_capacity) │ -//! └─────────────────────────────────┬─────────────────────────────────┘ +//!└─────────────────────────────────┬─────────────────────────────────┘ //! ▼ //! ┌────────────────────────┐ //! │ subscriber_listener │ @@ -46,11 +46,9 @@ //! ▼ ▼ //! AliveTracker SubscriberSet //! (sequence-based) (per-sub queues) -//! │ //! ┌─────────┼─────────┐ //! ▼ ▼ ▼ //! worker1 worker2 workerN -//! │ │ │ //! ▼ ▼ ▼ //! sub1.on sub2.on subN.on //! _event() _event() _event() @@ -67,12 +65,12 @@ //! ├─► run_once(task, timeout, attempt) //! │ │ //! │ ├─ Ok ──► publish TaskStopped -//! │ │ ├─ RestartPolicy::Never → ActorExhausted, exit -//! │ │ ├─ RestartPolicy::OnFailure → ActorExhausted, exit -//! │ │ └─ RestartPolicy::Always → reset delay, continue +//! │ │ ├─ RestartPolicy::Never ─► ActorExhausted, exit +//! │ │ ├─ RestartPolicy::OnFailure ─► ActorExhausted, exit +//! │ │ └─ RestartPolicy::Always ─► reset delay, continue //! │ │ //! │ └─ Err ──► publish TaskFailed{ task, error, attempt } -//! │ ├─ RestartPolicy::Never → ActorExhausted, exit +//! │ ├─ RestartPolicy::Never ─► ActorExhausted, exit //! │ └─ RestartPolicy::OnFailure/Always: //! │ ├─ compute delay = backoff.next(prev_delay) //! │ ├─ publish BackoffScheduled{ delay, attempt } @@ -81,8 +79,8 @@ //! │ //! └─ exit conditions: //! - runtime_token cancelled (OS signal or explicit remove) -//! - RestartPolicy forbids continuation → ActorExhausted -//! - Fatal error → ActorDead +//! - RestartPolicy forbids continuation ─► ActorExhausted +//! - Fatal error ─► ActorDead //! - semaphore closed //! } //! From 3f48c3528bd9b08465f69b8d5eb8513fdd359e98 Mon Sep 17 00:00:00 2001 From: mr-chelyshkin Date: Wed, 29 Oct 2025 08:12:24 +0400 Subject: [PATCH 7/8] update --- .github/workflows/.docs.yml | 12 ++++++++++++ .github/workflows/pr.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/.docs.yml create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/.docs.yml b/.github/workflows/.docs.yml new file mode 100644 index 0000000..80366a1 --- /dev/null +++ b/.github/workflows/.docs.yml @@ -0,0 +1,12 @@ +name: Docs + +on: { workflow_call: {} } + +jobs: + docs: + runs-on: ${{ vars.RUNS_ON }} + steps: + - uses: actions/checkout@v4 + - name: Run docs gen + uses: soltiHQ/actions/taskfile@main + with: { command: cargo/docs } diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..85e003f --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,27 @@ +name: Pr + +on: + pull_request: + types: [opened, synchronize] + +concurrency: + group: pr-${{ github.ref }} + cancel-in-progress: true + +permissions: { + contents: read, + actions: write +} + +jobs: + docs: + name: Docs + uses: ./.github/workflows/.docs.yml + + pr-check: + name: Pr Check + needs: docs + runs-on: ${{ vars.RUNS_ON }} + steps: + - name: All checks passed + run: echo "All Pr checks completed successfully!" From c526fe5b91b51c7834d5e3d4dd3637155c1abf0d Mon Sep 17 00:00:00 2001 From: mr-chelyshkin Date: Wed, 29 Oct 2025 08:17:02 +0400 Subject: [PATCH 8/8] update docs gen options --- Taskfile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Taskfile.yml b/Taskfile.yml index 03229d7..673667e 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -103,5 +103,5 @@ tasks: vars: CMD: >- +nightly rustdoc --lib -Zrustdoc-map --features "logging controller" - --offline -Zunstable-options -Zrustdoc-scrape-examples + -Zunstable-options -Zrustdoc-scrape-examples --config 'build.rustdocflags=["--cfg","docsrs","-Z","unstable-options","--cap-lints","warn"]'