MishkaCmsMigration.Resources.Changes.EnqueueJob (Mishka CMS Migration v0.0.1)

Copy Markdown View Source

Queues the job of a run's AshOban trigger (:trigger) with AshOban.run_trigger/3, in the same transaction as the action, once the run is written, as the actor who asked.

update :start_dry_run do
  change {MishkaCmsMigration.Resources.Changes.EnqueueJob, trigger: :run_dry_run}
end

Besides what AshOban keeps in it (the run's id, its site as the tenant, the actor through MishkaCmsMigration.Workers.Helpers.Actor), the job carries its site, who asked (actor_id) and the resource, the shape the activity log reads a job by (MishkaCmsCore.Activity.Sources.Oban), and the arguments a change before it put in the changeset's job_arguments context, which AshOban hands the trigger's action, such as the items of a job of picked items (MishkaCmsMigration.Resources.Changes.PickedItems). AshOban's own run_oban_trigger change takes no per-action arguments, so it cannot say who asked.