8000 Release 0.2.1: no printing, YAML leases and listen, OpenAPI validation, spec fixes by arminhammer · Pull Request #42 · arminhammer/jackdaw · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 43 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ jobs:
env:
RUSTDOCFLAGS: -D warnings

# A build without features must not warn either (its links to gated items are allowed explicitly).
- name: Build the docs without features
run: cargo doc -p jackdaw-wf --no-default-features --no-deps --locked
env:
RUSTDOCFLAGS: -D warnings

msrv:
name: Minimum Supported Rust Version
runs-on: ubuntu-latest
Expand All @@ -100,6 +106,42 @@ jobs:
- name: Check the workspace on the MSRV
run: cargo +1.94 check --workspace --all-features --locked

deny:
name: Licenses and sources
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7

# Configured in deny.toml: an unlisted license, a wildcard version or an unknown registry or git source fails.
- name: Run cargo deny
uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check licenses bans sources

semver:
name: Semver check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.99.0

- name: Install cargo-semver-checks
uses: taiki-e/install-action@cargo-semver-checks

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
key: semver

# Compares the library's public API with the latest version on crates.io: a breaking change fails the job
# unless the version in Cargo.toml was bumped to allow it (0.x: the minor version).
- name: Check the public API for breaking changes
run: cargo semver-checks -p jackdaw-wf --all-features

package:
name: Package (publish dry run)
runs-on: ubuntu-latest
Expand Down Expand Up @@ -247,13 +289,11 @@ jobs:
with:
key: specs-${{ matrix.store }}

# The specs run on the store the matrix names (the Test Suite job runs them on Redb). One scenario at a time:
# with several at once, the SQL stores stall (see library-refactor.md).
# The specs run on the store the matrix names (the Test Suite job runs them on Redb).
- name: Run the library specs
run: cargo test -p jackdaw-wf --test lib_features
env:
JACKDAW_TEST_STORE: ${{ matrix.store }}
JACKDAW_SCENARIO_CONCURRENCY: 1
DATABASE_URL: postgres://postgres:postgres@localhost:5432/jackdaw_test

build:
Expand Down
74 changes: 71 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,76 @@ The workspace publishes three crates with the same version: `jackdaw-wf` (the li

## [Unreleased]

## [0.2.0] - unreleased
## [0.2.1] - 2026-11-01

Set the date when the release is tagged.
### Fixed

- The YAML interpreter's HTTP listener passes path parameters under the names the route gives them, and adds the
query string, for every method. It used to report the last path segment of a GET or DELETE as `petId`, whatever
the route said, and drop a GET or DELETE body. Engine listeners and YAML listeners now build a request's input the
same way.
- `#[catalog]` in a build without the `yaml` feature fails with one error that names the feature, instead of errors
about missing `__private` items.
- The docs build without warnings when some features are off.
- YAML instances appear in `Engine::list`, `Engine::status` and `Engine::describe`, read from the YAML engine's
stored events. Before, those saw only Rust instances.
- With a `PayloadCodec` (`EngineBuilder::codec`), the YAML interpreter's records go through it as well: event
payloads (inputs, task results, outputs, published events) and checkpoint data. Before, only Rust instances'
journals and history were encoded, and a YAML workflow's data was stored as plain JSON. Records written before
still read.
- With leases on, the YAML interpreter's own store writes for an instance are checked against the lease, as a
Rust instance's are. An engine that lost the lease has its writes refused. Before, a stalled engine could write
until its next renewal noticed.
- `Engine::sweep` also purges finished YAML instances older than the retention period. It also deletes the events
published on the engine, which are now kept in one store stream per day, after the same period.
- The YAML interpreter stamps every event and checkpoint it stores with the engine's clock. Some used to take the
wall clock, so a custom or test clock gave an instance timestamps from two clocks.
- The YAML interpreter's own HTTP listener checks requests against the listen task's OpenAPI document, as engine
listeners do. The operation is the document path that the listen URI's path ends with (`/api/v1/add` matches
`/add`); without one, the body schema named by `resource.name` applies. A document that cannot be read is
skipped with a warning.
- YAML instances are leased like Rust ones under `EngineBuilder::lease`. An engine takes the lease before it starts
or resumes one, and renews it while the run lasts. `Engine::recover` skips an instance whose lease another engine
holds. Before, two engines could both resume the same YAML instance. The YAML interpreter writes to the store
directly, so its writes are not checked against the lease. An engine that loses a lease stops the run at its next
renewal.
- YAML runs, the readers of a script's output, and listener servers keep the caller's `tracing` subscriber, as Rust
workflows already did.
- A YAML `listen` task for events emitted on the engine follows more of the spec:
- A string in `with` is a regular expression that the whole attribute must match.
- A runtime expression in `with` is evaluated against the workflow's data, and its value is matched the same way.
- `correlate` is supported. A `from` value must equal `expect`, or without `expect`, the value the first matching
event gave.
- A listen task that resumes after a restart also sees the events emitted since it first started. The engine keeps
published events in the store for this.
- A YAML `emit` task stamps `time` from the engine's clock.
- Before, `with` matched only by equality, `correlate` was ignored, and an event emitted while the listening
instance's engine was down was lost.

### Changed

- The library no longer prints. The YAML interpreter's trace, the lines a script task prints and listener startup
are `tracing` events on the `jackdaw::yaml` target (see "Logs and traces" in the events chapter of the guide).
Before, a YAML script task's output went to the process's stdout and stderr, whatever the application did.
`set_yaml_trace` is deprecated and does nothing. The gRPC listener's request diagnostics and the OpenAPI caller's
request lines are `DEBUG` logs.
- Engine OpenAPI listeners (`Listener::openapi`) check each request against its operation before a workflow
starts:
- required parameters;
- the schemas of path, query and header parameters;
- the JSON request body's schema, with `$ref`s into `components` resolved. An `openapi: 3.0` document's schemas are
read as JSON Schema draft 4, a 3.1 one's as 2020-12.
A request that does not match gets a `400` listing the problems. A document with an invalid schema is rejected
when the listener is built. This adds the `jsonschema` dependency to the `http-listener` feature, without its
default features (no remote `$ref`s, no C code). The listener docs now say to terminate TLS in a proxy or
sidecar.
- The `jackdaw` CLI renders that trace as before, and now also prints warnings and errors from the library on stderr
(everything with `--verbose`; `RUST_LOG` overrides).
- `console` is no longer a dependency of the library.
- CI checks the public API against the latest release with `cargo semver-checks`, and dependency licenses and
sources with `cargo deny` (`deny.toml`).

## [0.2.0] - 2026-11-01

Jackdaw becomes a library first: durable workflows written in Rust, with the Open Workflow YAML interpreter as
an optional part of the same engine. The CLI is now a separate crate built on the library's public API.
Expand Down Expand Up @@ -79,6 +146,7 @@ an optional part of the same engine. The CLI is now a separate crate built on th

The CLI release before the library refactor; see the GitHub release.

[Unreleased]: https://github.com/arminhammer/jackdaw/compare/v0.2.0...HEAD
[Unreleased]: https://github.com/arminhammer/jackdaw/compare/v0.2.1...HEAD
[0.2.1]: https://github.com/arminhammer/jackdaw/compare/v0.2.0...v0.2.1
[0.2.0]: https://github.com/arminhammer/jackdaw/compare/v0.1.1...v0.2.0
[0.1.1]: https://github.com/arminhammer/jackdaw/releases/tag/v0.1.1
7 changes: 6 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,16 @@ the Open Workflow Specification and conformance tests.
`cargo clippy --workspace --all-targets --all-features -- -D warnings` and `cargo fmt --all` must be clean; the workspace
denies wildcard matches on enums, indexing that can panic, and a few other lints (see the root `Cargo.toml`).

CI also runs `just semver` (`cargo semver-checks` against the latest release: a breaking change in `jackdaw-wf` needs a
minor version bump) and `just deny` (`cargo deny`: every dependency's license is in `deny.toml`'s allow list, and
every source is crates.io).

## Vendored code

`jackdaw/src/dsl` is the Open Workflow Specification Rust SDK's model, copied verbatim. Do not edit it: change it upstream (or in
the fork that `just update-dsl` pulls from) and run `just update-dsl [repo] [ref]`, which records the commit in
`jackdaw/src/dsl/UPSTREAM`.
`jackdaw/src/dsl/UPSTREAM`. The SDK's unit tests (in its `lib.rs`) come along as `src/dsl/unit_tests.rs`, run with
the library's unit tests; the recipe drops `lib.rs`'s `mod models;` line and swaps `serde_yaml` for `serde-saphyr`.

## Stability

Expand Down
Loading
Loading
0