Skip to content

River Pro Changelog

All notable changes to this project will be documented in this file.

0.6.0 - 2024-11-03

Added

  • Added riverworkflow.NameFromJobRow and riverworkflow.TaskFromJobRow to make it easy to extract the workflow name and workflow task name from a job's metadata.

Deprecated

In the v0.5.0 release, several top-level functions were added to the riverpro package by mistake. These have been deprecated in favor of the riverworkflow variants:

  • river.WorkflowIDFromJobRow becomes riverworkflow.IDFromJobRow.
  • river.JobListParams can be changed to the preexisting riverworkflow.JobListParams.
  • river.JobListParamsByID can be changed to the preexisting riverworkflow.JobListParamsByID.

In addition, more deprecations were marked in the riverworkflow package for things that should now be done with the main riverpro package. The next release will remove the remaining deprecations.

0.5.1 - 2024-10-18

Fixed

  • Fixed an initialization panic when using the riverpropgxv5 driver with a regular river.Client.

0.5.0 - 2024-10-08

⚠️ v0.5.0 makes significant changes to the way workflows are interacted with, and introduces a riverpro.Client to allow for better extensibility. Pro customers should migrate to this new interface for existing workflow usage, as well as to access new Pro features including Sequences and other upcoming functionality.

The API changes can be fixed with a few quick find & replaces and should take no more than a few minutes to complete:

  • Change river.NewClient to riverpro.NewClient.
  • Change river.Client to riverpro.Client.
  • Change river.ClientFromContext to riverpro.ClientFromContext.
  • Change river.Config to be nested as the Config attr within a riverpro.Config.
  • Change riverworkflow.Workflow to riverpro.NewWorkflow.
  • Change riverworkflow.Opts to riverpro.WorkflowOpts.
  • Change riverworkflow.TaskOpts to riverpro.WorkflowTaskOpts.
  • Change riverworkflow.Prepare(ctx, riverClient, to riverClient.WorkflowPrepare(ctx,.
  • Change riverworkflow.PrepareTx(ctx, riverClient, to riverClient.WorkflowPrepareTx(ctx,.

These APIs should be stable going forward as the new design is flexible enough to support all the upcoming functionality on the short term roadmap.

Added

  • Added a new riverpro.Client type and riverpro.NewClient constructor. This new Client should be used in River Pro projects in order to access Pro functionality like workflows, sequences, and other upcoming features. Most usage of the old riverworkflow package has been deprecated and will be removed in an upcoming release.
  • Introduce a new "Sequences" Pro feature ✨. Sequences enable a sequence of jobs to run in a strict one-at-a-time sequential order based on their insertion order. Sequences can be partitioned in several ways, including by arguments (full or partial), queue name, and job kind. Within each sequence, River Pro ensures that each sequence
  • Added WorkflowCancel and WorkflowCancelTx methods to riverpro.Client to enable cancelling all non-finalized tasks in a workflow.
  • Add riverpro.ClientFromContext to extract a riverpro.Client from workers, equivalent to river.ClientFromContext for regular clients.
  • Add riverpro.ContextWithClient to inject a client into the context in order to facilitate testing a worker that makes use of riverpro.ClientFromContext.

Breaking

  • The config argument has been removed from the riverpropgxv5.New constructor because it is now provided to the riverpro.Client constructor and propagated internally as necessary.
  • The deprecated Prepare method on riverworkflow.Workflow has been removed. Use the top-level riverpro.Client type along with its WorkflowPrepare / WorkflowPrepareTx methods.

Deprecated

  • ⚠️ Most of the riverworkflow package has been deprecated and will be removed in a future release. Users should transition to the riverpro.Client type along with its related workflow functionality. While this API shift is regrettable, it's necessary to ensure a good experience going forward and to be compatible with upcoming functionality.

0.4.1 - 2024-09-23

Correctly upgrade River dependencies to v0.12.0.

0.4.0 - 2024-09-23

  • Upgrade to use River v0.12.0.

v0.3.1 - 2024-09-17

Fixed

  • riverpropgxv5: UnwrapExecutor (for unwrapping a non-pro executor) now works when using a nil driver, which is required for use in functions like rivertest.RequireInsertedTx.

v0.3.0 - 2024-09-11

Fixed

  • Workflows: Fix an issue with directly mutating user-provided opts structs by ensuring we take copies of them prior to mutating. Without this fix, users who provided the same InsertOpts pointer to multiple workflow tasks would see identical metadata on all resulting tasks (rather than task-specific metadata as expected).

v0.2.1 - 2024-08-12

Fixed

  • Lowered the go directives in go.mod to Go 1.21, which River aims to support. A more modern version of Go is specified with the toolchain directive. This should provide more flexibility on the minimum required Go version for programs importing River.
  • Fixed a potential panic when unwrapping the pro driver and executor.

v0.2.0 - 2024-08-03

Added

  • Tasks can now be dynamically added to an existing workflow. The riverworkflow.FromExisting() constructor initiates a workflow from an existing job in that workflow. New tasks can be added using the same .Add() method that's used for a brand new worfklow. When preparing the workflow for insert using top-level Prepare and PrepareTx functions, existing jobs will be automatically loaded as needed to validate the workflow dependency graph.

  • New top-level functions in the riverworkflow package for Prepare and PrepareTx. These are used to prepare a workflow's tasks/jobs for insertion into the database, including validations of task dependencies. These functions should be preferred over workflow.Prepare which will be removed in the next release.

Deprecated

  • The Prepare method on riverworkflow.Workflow has been deprecated in favor of the new top-level Prepare and PrepareTx functions in that package. The new functions present a single interface for preparing workflow tasks for insertion, whether the workflow is brand new or for adding tasks to an existing workflow. This method will be removed in an upcoming release.

v0.1.1 - 2024-07-25

Added

  • This is the initial release of River Pro.