Repository navigation
Releases
v0.1.0
The first release that is not a pre-release: specification 0.1.0, tier 1, capabilities sync, async and testing, cases v0.1.0. It does not break code written for 0.1.0-beta.7, and holds the same code: the cases v0.1.0 are those of v0.1.0-rc.20, which 0.1.0-beta.7 passes. What a journey does is unchanged. The minimum supported Rust version is 1.85.
v0.1.0-beta.7
The seventh beta, which breaks no code written for 0.1.0-beta.6: specification 0.1.0, tier 1, capabilities sync, async and testing, cases v0.1.0-rc.20. What a journey does is unchanged. It follows two corrections the cases carry: an input adapter in an execution mode the executor does not accept is refused as mode not accepted, which Rust rules out since an input adapter cannot be asynchronous, and a scripted run no longer needs an attempt that cannot happen after a rescue step scripted to fail or to end in an abnormal termination. The minimum supported Rust version is 1.85.
Fixed
- With the
testingfeature,instance::StepScripting::runno longer panics when the script leaves out the attempt after a rescued step's attempt 1 and its rescue step is scripted to fail or end in an abnormal termination, an attempt that never runs.
v0.1.0-beta.6
The sixth beta, which breaks code written for 0.1.0-beta.5: specification 0.1.0, tier 1, capabilities sync, async and testing, cases v0.1.0-rc.18. It implements proposal 0121, on copies that keep received data read-only, which itinera makes by cloning, and proposal 0122, on custom code that returns something its call cannot return, which Rust's types rule out, and on journey IDs, which are strings that are not empty. What a journey does is unchanged; only creating an instance whose ID generator produces an empty string now fails. The minimum supported Rust version is 1.85.
Added
journey::EmptyJourneyId, the error that making a journey ID from an empty string returns.instance::InstanceError::EmptyJourneyId, whichinstance::InstanceBuilder::createreturns when the workflow's ID generator produces an empty journey ID.journey::JourneyId::into_inner, which gives a journey ID's text back as anArc<str>, andAsRef<Arc<str>>onjourney::JourneyId.
Changed
journey::JourneyIdis a string that is not empty: it is made withJourneyId::try_from, from a&str, aStringor anArc<str>, or withJourneyId::try_new, from anArc<str>, each refusing an empty string withjourney::EmptyJourneyId, instead ofJourneyId::from, which is gone.
v0.1.0-beta.5
The fifth beta, which breaks no code written for 0.1.0-beta.4: specification 0.1.0, tier 1, capabilities sync, async and testing, cases v0.1.0-rc.16. What a journey does is unchanged. It gives the crate a page written for the people who use it, and its version is that of the first release of itinera-ts, which is checked against the same cases, v0.1.0-rc.16. The minimum supported Rust version is 1.85.
Changed
- The page of
itineraon crates.io, and the opening of its documentation on docs.rs, are the README, with a quick start, the parts of a workflow, links to the book and the API reference, the status and the features.
v0.1.0-beta.4
The fourth beta, which breaks code written for 0.1.0-beta.3: specification 0.1.0, tier 1, capabilities sync, async and testing, cases v0.1.0-rc.16. It implements proposal 0116, on two input adapters with one name and on an input adapter or service provider attached to one step twice, and proposal 0119, on mistakes in choosing a scripted run's attempts. It does not claim the capability value-conversions, which holds every case of proposal 0113, since itinera keeps a value as it is and reads it back by its exact type, calling no conversion. The minimum supported Rust version is 1.85.
Added
event::Supplier, the input adapter, with the key it was resolving, or the service provider that failed while a step was built.workflow::Violation::DuplicateAdapterNameandworkflow::ViolationKind::DuplicateAdapterName:workflow::WorkflowBuilder::buildreports two input adapters with the same name instead ofworkflow::WorkflowBuilder::input_adapterpanicking.
Changed
event::JourneyAbort::StepCouldNotBeBuiltreplaces itsproviderfield withsupplier, anOption<event::Supplier>, which holdsSupplier::Providerwhereproviderheld a service provider's name.workflow::InputAdapterDescriptor::stepandservice::ServiceProviderDescriptor::stepno longer ignore a step they are already attached to;workflow::WorkflowBuilder::buildreportsworkflow::Violation::StepAdaptedTwiceorworkflow::Violation::ServiceProvidedTwice, naming the adapter or provider once per attachment.- The compile errors of
#[workflow]for two input adapters of one name, and for an adapter or provider listing a step twice, name the violationsduplicate adapter name,step adapted twiceandservice provided twice.
Fixed
journey_abortednames the input adapter that failed and the key of the input it was resolving, inevent::JourneyAbort::StepCouldNotBeBuilt.- With the
testingfeature,instance::StepScripting::on_attemptnames an attempt the step can never have, such as attempt 0 or one past what it can have, before an attempt scripted already or a gap, and every panic ofinstance::StepScriptingin choosing attempts names the step and the attempt.
v0.1.0-beta.3
The third beta, which makes the API friendlier and breaks code written for 0.1.0-beta.2: specification 0.1.0, tier 1, capabilities sync, async and testing, cases v0.1.0-rc.15. What a journey does is unchanged. The minimum supported Rust version is 1.85.
Added
error::Result<T, E = Error>, the result custom code returns, such asResult<Outcome>from a step'srun. A service provider declared with#[workflow]may returnResult<Provided<T>>.- Readers on how a journey ended:
JourneyStatus::is_succeeded,is_failed,is_aborted,failureandabort, andFailure::reasonanderror. step::Attempt, an attempt's number, counted from 1, withAttempt::FIRSTandis_first().event::EventKind, an event's kind, which displays as its snake_case name and parses from it.workflow::Supplied, what an input adapter returns, withSupplied::valueand the readerdowncast_ref::<T>().journey::Read::present, the value read when it is present and of the type asked for.
Changed
- Step hooks return
policy::OnSuccess(on step success) orpolicy::OnFailure(on step failure,on step retryandon step abnormal termination) instead of anOptionof a lifecycle:KeepDefault,FinishWorkflowforOnSuccessonly, orFailWorkflowwith a reason, made withOnSuccess::fail_workfloworOnFailure::fail_workflow, which take any text. They read themselves back withkeeps_default,fails_workflowand, onOnSuccess,finishes_workflow. The shorthandDescribedPolicy::carry_on()is nowkeep_default(); theReturnedLifecycletrait and theFailWorkflowstruct are gone. - Input adapters return
workflow::Supplied, aValueorFromDataBag, instead of anOptionof a value, and take the data bag as&DataBag, whosereadis now public;DataBagAccessandDataBag::accessare gone. - Steps and hooks take the contributor as
&mut journey::Contributor, with no lifetime. - The macros recognise a handle by its type, so
#[contributor],#[reporter],#[journey_id],#[step_name],#[attempt],#[reason],#[error],#[cause]and#[data_bag]are gone. Marks stay where the type cannot say what is requested:#[input],#[service],#[from_step],#[from_workflow],#[from_rescued_step],#[key]and#[role]. - An attempt's number is a
step::Attemptinstead of aNonZeroU32wherever it is public; scripts still number attempts with plain integers. Event::kindandEventBody::kindreturn anEventKindinstead of a&'static str.Outcome::failure,Outcome::skipped_becauseandRescueOutcome::failuretake anything that converts into aReason, so a text is the reason's code.- In the builder form, each source of data has one request method, which takes an
Inputor anOptionalInput, through the sealedstep::InputToken, and gives the value or anOptionof it:optional_input,optional_from_workflow,optional_from_stepandoptional_from_rescued_stepare gone. ProvidesandInputAdaptermove frompolicytoworkflow, andProvidertoservice.- A release is published only once every CI check passes on its tagged commit, and docs.rs builds each crate with its features other than
unstable.
v0.1.0-beta.2
The second beta, with the same implementation as 0.1.0-beta.1: specification 0.1.0, tier 1, capabilities sync, async and testing, cases v0.1.0-rc.15. The minimum supported Rust version is 1.85.
Changed
- On crates.io, the crates are listed under the categories
asynchronousandrust-patternsand found by the keywordagentinstead ofevents, and the pages ofitinera-coreanditinera-macrossend readers toitinera. - The crates are published by the release workflow, through crates.io's trusted publishing.
v0.1.0-beta.1
The first beta: specification 0.1.0, tier 1, capabilities sync, async and testing, cases v0.1.0-rc.15. The minimum supported Rust version is 1.85.
Added
- Steps that declare the data they need and report an outcome. Only an attempt that succeeds commits its contributions to the data bag of values. A retry budget alone decides whether a failed or abnormally terminated attempt is tried again; a step that says
no_retry_on_abnormal_termination()is not retried after an abnormal termination. - Step and workflow policies, every hook kind with its requests and lifecycles, roles the workflow provides, and input adapters.
- Rescue steps: a step may have a rescue step, which runs when the step fails or terminates abnormally and, once it succeeds, lets the step run again. Input adapters and service providers are attached to it by the name
<step name>_rescue. - Services that steps request by key, made by service providers of the workflow for the journey or for each attempt, and attached to chosen steps, rescue steps included, or to no step, serving every step that requests their key and has no provider of its own for it. A provider returns its service made with
service::provide!, which names the implementation it made, its concrete type, on theservice_providedevent, together with data the provider may add. - Workflow descriptors declared with the builder and refused when they break a rule of the specification, and listed, with their steps, policies, input adapters, services and rescue steps, by
listing(); workflow instances with their initial data, journey IDs and reporters, and the results and refusals of a journey. - Events, reporters, dispatchers and their factories, with the default dispatcher, and two ready-made reporters:
DebugReporter, which prints every event, and, with thetestingfeature,RecordingReporter, which keeps every event, and the latest value of each entry of global metadata, for a test to read. - Global metadata: entries of a key and a value, apart from the data bag, that every reporter receives as soon as each one is set, starting with the journey ID under the key
journey_id. A workflow instance may start with more entries, and steps, hooks and service providers may set entries while the journey runs, each recorded by aglobal_metadata_setevent that carries its key but not its value. - Test support, with the
testingfeature:RecordingReporter::path(), which lists the flow a recorded journey took, one plain line per attempt's outcome, decision and end;fake_provider, on the instance builder and on the builder#[workflow]generates, which puts a fake in place of a service provider for one instance; scripted runs,instance.scripted(), which play what named steps' attempts do, without their business rules, and record what each attempt was built with; and recorders that let a test call a step'srun, a hook or an input adapter directly, outside any journey:journey::Contributionslends a contributor,step::StepEventReporterandpolicy::HookEventReporterlend the reporters and keep what is emitted and the global metadata that was set, andjourney::DataBag::default().with(key, value)builds a data bag whoseaccess()an input adapter reads. - Step and rescue step outcomes can be read back with
is_success,is_failureandreason, and a step's outcome also withis_skipped; what a hook returned, withkeeps_default,fails_workflowandfinishes_workflowfrompolicy::ReturnedLifecycle. - The local executor and, with the
asyncfeature, the asynchronous local executor, andexecutor::local_executor_for!, which makes the local executor of a workflow's mode. - With the
asyncfeature,mode::async_trait, the attribute for services and roles whose methods are asynchronous. - With the
macrosfeature, on by default, attributes and derives that declare steps, rescue steps, policies, workflows with their service providers, roles and journey data as syntax over the builder. A workflow declared with#[workflow]takes its mode from its steps and refuses steps of both modes, and#[service]takes a service only as a trait object, such as&dyn PaymentGateway, refusing a concrete type. - Compile errors, instead of checks while a journey runs, for the rules the specification lets an implementation make impossible to express: a lifecycle a hook may not return, a role the workflow does not provide, an asynchronous part on the synchronous executor or an asynchronous service provider in a synchronous workflow, a rescue step that skips, a service provider of journey scope requesting the step being built or the attempt, a service provider returning nothing, a non-value entering the data bag, event data, a reason's details or global metadata, handles used after their attempt or call, and an input adapter writing to the data bag.