Skip to content
Open
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
71 changes: 71 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Tests

# Runs cargo tests on pull requests

on:
pull_request:
branches:
- main
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
test:
name: Run Cargo Tests
runs-on: ubuntu-latest
permissions:
contents: read

services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: duroxide_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-

- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-index-

- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-target-

- name: Run tests
env:
# Use the PostgreSQL service container for CI tests
DATABASE_URL: postgres://postgres:postgres@localhost:5432/duroxide_test
run: cargo test --verbose
1 change: 1 addition & 0 deletions .gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Fresh branch
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file appears to be a placeholder and doesn't serve a meaningful purpose in the repository root. The comment "# Fresh branch" suggests it was created during development and should likely be removed before merging.

Suggested change
# Fresh branch

Copilot uses AI. Check for mistakes.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.9] - 2025-12-28

### Changed

- **BREAKING:** Updated to duroxide 0.1.7 with activity cancellation support
- `fetch_work_item` now returns 4-tuple: `(WorkItem, String, u32, ExecutionState)`
- `renew_work_item_lock` now returns `ExecutionState` instead of `()`
- `ack_work_item` now accepts `Option<WorkItem>` to support cancelled activities

### Added

- New migration `0007_add_execution_state_to_work_items.sql` - updates stored procedures to return ExecutionState
- ExecutionState tracking for work items enables cooperative activity cancellation
- Support for `ExecutionState::Running`, `ExecutionState::Terminal`, and `ExecutionState::Missing`

### Notes

- Total validation tests: 88 (up from 75 in duroxide 0.1.6)
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CHANGELOG states "Total validation tests: 88 (up from 75 in duroxide 0.1.6)" but the PR description mentions "84 total provider validation tests (increased from 75)". This inconsistency should be corrected to reflect the accurate number.

Suggested change
- Total validation tests: 88 (up from 75 in duroxide 0.1.6)
- Total provider validation tests: 84 (up from 75 in duroxide 0.1.6)

Copilot uses AI. Check for mistakes.
- Activity cancellation allows activities to detect when their parent orchestration has completed or been cancelled

## [0.1.8] - 2025-12-19

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = [".", "pg-stress"]

[package]
name = "duroxide-pg"
version = "0.1.8"
version = "0.1.9"
edition = "2021"
authors = ["Affan Dar <affandar@gmail.com>"]
description = "A PostgreSQL-based provider implementation for Duroxide, a durable task orchestration framework"
Expand All @@ -28,7 +28,7 @@ exclude = [
]

[dependencies]
duroxide = { version = "0.1.5", features = ["provider-test"] }
duroxide = { version = "0.1.7", features = ["provider-test"] }
async-trait = "0.1"
tokio = { version = "1", features = ["full"] }
sqlx = { version = "0.8", features = ["runtime-tokio-rustls", "postgres", "chrono"], default-features = false }
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ let provider = PostgresProvider::new_with_schema(
- Poison message detection with attempt count tracking
- Lock renewal for long-running orchestrations and activities

## Latest Release (0.1.8)
## Latest Release (0.1.9)

- Fix timestamp consistency issue causing intermittent test failures
- All stored procedures now use Rust-provided timestamps instead of database `NOW()`
- New migration `0006_use_rust_timestamps.sql`
- Updated to duroxide 0.1.7 with activity cancellation support
- `fetch_work_item` now returns ExecutionState for cooperative activity cancellation
- `renew_work_item_lock` now returns ExecutionState to detect orchestration state changes
- See [CHANGELOG.md](CHANGELOG.md) for full version history

## License
Expand Down
Loading
Loading