Repository navigation
v0.12.0
·
20 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Added
max_firesandbackoffonevery.max_firesstops aneveryafter a number of fires in the current step visit.backoffgrows the gap after each fire, taking a duration tuple or:exponentiallikeretry'sbackoff, and both schedulers compute it fromAshWorkflow.Entities.Retry.delay_ms/2. Either option adds a<step>_<every>_firesinteger column, so runmix ash.codegenon AshPostgres. Aneverywithout them is unchanged.mix ash_workflow.gen.approvaladds an approval workflow to a resource: a sibling approval resource withpending,approved,rejected,cancelledand an optionaloverduestep, a decision resource, quorum routing, and policies that stop a requester approving their own request. Who may open a request and who may approve live in generatedChecks.CanRequestandChecks.CanApprovemodules, which deny everyone until the application fills them in. See the approval recipe.mix ash_workflow.gen.expiryadds an expiry workflow to a resource: a sibling expiry resource withactive,expiredand an optionalexpiringstep, whose deadlines readexpires_atand move when the expiry is renewed. The subject gainshas_one :expiry, anexpired?calculation and a:set_expiryupdate action, which creates the subject's expiry or renews the one it has. A subject with no expiry never expires. The generatedChanges.SetExpirychange does the same work on any other subject action, taking anexpires_in:option such as{365, :day}where the action has no:expires_atargument.--default-expiry 365dadds that change to the subject'schangesblock for every create, which then fails untilChecks.CanCreatelets the creating actor through. Who may create an expiry and who may renew one live in generatedChecks.CanCreateandChecks.CanRenewmodules, which deny everyone until the application fills them in. See the expiry recipe.mix ash_workflow.gen.dormancyadds a dormancy workflow to a resource: a sibling dormancy resource withactive,dormantand an optionalarchivedstep, driven by alast_activity_atthat arecord_activityaction moves and areactivateaction resets. The subject gainshas_one :dormancy, adormant?calculation, and achangeon its create actions that runs the generatedChanges.StartDormancy, so each new subject starts its own dormancy. The generatedChanges.RecordActivityrecords activity from whichever subject actions the application adds it to. Who may create a dormancy directly and who may reactivate one live in generatedChecks.CanCreateandChecks.CanReactivatemodules, which deny everyone until the application fills them in. See the dormancy recipe.mix ash_workflow.gen.syncadds a sync workflow to a resource: a sibling sync resource withsyncing,syncedandfailedsteps, whose:pushaction is retried with--max-attemptsand--backoffand moves back tosyncingon a resync. The subject gainshas_one :sync, asynced?calculation, and two changes in itschangesblock.Changes.StartSyncstarts a sync on every subject create.Changes.RequestSyncstampsresync_requested_aton every subject update, or only when a--fieldsfield changes, and afire_attimeout onsyncedandfailedresyncs on that stamp, so a request made during a push runs once the push settles. Who may create a sync directly and who may resync one by hand live in generatedChecks.CanCreateandChecks.CanResyncmodules, which deny everyone until the application fills them in. See the sync recipe.mix ash_workflow.gen.transition_logaccepts a workflow resource generated earlier in the same Igniter run, before it has compiled, by reading its source. A resource on disk that fails to compile is still reported as an issue.mix ash_workflow.gen.publicationadds a publication workflow to a resource: a sibling publication resource withdraft,scheduled,publishedandunpublishedsteps, which goes live atpublish_atand, with--with-unpublish-at, comes down atunpublish_at. The subject gainshas_one :publicationand apublished?calculation. Who may create a publication and who may schedule, publish and unpublish one live in generatedChecks.CanCreateandChecks.CanPublishmodules, which deny everyone until the application fills them in. See the publication recipe.mix ash_workflow.gen.reviewadds a review workflow to a resource: a sibling review resource within_review,changes_requested,approved,rejectedand an optionaloverduestep, a decision resource that records each round, and policies that stop a requester reviewing their own work. A subject has at most one open review. Who may open a review and who may review live in generatedChecks.CanRequestandChecks.CanReviewmodules, which deny everyone until the application fills them in. See the review recipe.mix ash_workflow.gen.invitationadds an invitation workflow to a resource: a sibling invitation resource withsent,accepted,declined,revokedandexpiredsteps, whose deadline readsexpires_atand moves when the invitation is resent. Who may invite and who may accept live in generatedChecks.CanInviteandChecks.CanAcceptmodules, which deny everyone until the application fills them in. See the invitation recipe.mix ash_workflow.gen.verificationadds a verification workflow to a resource: a sibling verification resource withsubmitted,verifying,needs_review,verifiedandrejectedsteps, whose automatic:verifyaction retries up to--max-attemptstimes before the verification moves to review. The subject gainshas_many :verifications,has_one :latest_verificationand averified?calculation. Who may submit a verification and who may decide one in review live in generatedChecks.CanSubmitandChecks.CanReviewmodules, which deny everyone until the application fills them in. See the verification recipe.mix ash_workflow.gen.deletionadds a deletion workflow to a resource: a sibling deletion resource withrequested,purging,purge_failed,restoredanddeletedsteps. A grace period afterrequested_atmoves a request topurging, which runs a:purgeaction with retries and moves topurge_failedwhen they run out. The subject gainshas_one :deletionand apending_deletion?calculation. What a purge erases lives in a generatedChanges.Purgechange, which fails every purge until the application fills it in. Who may request and who may restore live in generatedChecks.CanRequestandChecks.CanRestoremodules, which deny everyone until the application fills them in. See the deletion recipe.mix ash_workflow.gen.acknowledgementadds an acknowledgement workflow to a resource: a sibling acknowledgement resource withpending,acknowledgedand an optionaloverduestep, holding one request per person per subject, which only that person may acknowledge. Who may open a request lives in a generatedChecks.CanRequestmodule, which denies everyone until the application fills it in. See the acknowledgement recipe.
Fixed
- A create action that upserts onto an existing row no longer appends an
:initialrow to the transition log, emits the workflow's signals or callsAshWorkflow.Scheduler.notify_state_change/2. The row stays in the step it was in.AshWorkflow.Changes.RecordEventskips all three when the returned record carriesupsert_action: :updatemetadata, orupsert_skipped: truemetadata from anupsert_conditionthat did not match. This coversAsh.create/2andAsh.bulk_create/4. The[:ash_workflow, :transition]span still emits:stop, because its:startevent fires before the data layer reports whether the row was inserted. Ash setsupsert_actionon ETS and Mnesia from 3.29, which ash_workflow already requires. AshPostgres sets it from 2.10.0 on PostgreSQL 17 and later, and from 2.13.1 on every PostgreSQL version. With an older AshPostgres, an upsert onto an existing row is still logged. - Transition and timeout actions that
AshWorkflow.Transformers.AddActionsgenerates on a workflow resource with apre_check_withidentity now setrequire_atomic? false. Ash adds abefore_actionfor such an identity, so the generated actions failed withMustBeAtomic. Those actions now run non-atomically on that resource.