Commit graph

993 commits

Author SHA1 Message Date
Sipke Schoorstra 33181ae304
fix: persist Interrupted after drain force-cancel commits Cancelled (#8069)
Some checks failed
Packages / Test unit/integration with coverage (push) Has been cancelled
Packages / Test component with coverage (push) Has been cancelled
Packages / Generate coverage report (push) Has been cancelled
Packages / Build packages (push) Has been cancelled
Packages / Publish to feedz.io (push) Has been cancelled
Packages / Publish release to nuget.org (push) Has been cancelled
Packages / Deploy coverage to GitHub Pages (push) Has been cancelled
* fix: persist Interrupted after drain force-cancel commits Cancelled

Deadline-breach force-cancel makes the runner persist Finished/Cancelled.
#8059 then skipped every Finished row, so Interrupted never landed and
Packages CI failed DeadlineBreachPersistsInterrupted. Treat Cancelled as
interruptible and promote it to Running+Interrupted so recovery can
requeue it, while still refusing naturally completed rows.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* fix: do not promote user cancellations to Interrupted on drain

Gate Cancelled→Interrupted on instances that were not already Cancelled
when drain snapshotted live cycles. Deadline-breach force-cancel still
promotes the runner's Finished/Cancelled commit; ordinary client
cancellations stay Cancelled and are not requeued.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* fix: confine Cancelled→Interrupted promote to Drain

Restore TryMarkInterruptedAsync to refuse every Finished row by default
(#8052). Drain PersistInterrupted alone may pass allowFinishedCancelled
when the instance is Finished/Cancelled and in this drain's
force-cancelled set. User cancellations stay cancelled.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* docs: document TryMarkInterruptedAsync parameters

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* fix: bound pre-cancel snapshot so stalled Find cannot block Cancel

WaitAsync the instance-store snapshot under a short shutdown budget so
a hang or ignored cancellation token cannot delay handle.Cancel().
Unknown pre-state is not treated as already Cancelled; observed
user cancellations are still preserved.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* test: restore Fact on terminal-race drain persist skip

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* fix: exclude unknown snapshot rows from drain-induced promote

A timed-out or failed pre-cancel Find no longer joins drainInduced.
Only a successful read that is clearly not already Cancelled may be
promoted. Cancel still proceeds without waiting on store latency.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* fix: give each pre-cancel snapshot its own timeout

A shared 250ms overallSnapshotCts let a stalled first Find cancel later
Finds before they started, so those instances were excluded from
drainInduced and never persisted as Interrupted after Phase A Cancel.

Each Find now uses an independent CTS linked only to the host token.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* fix: snapshot live instances concurrently before Phase A Cancel

Independent per-find 250ms budgets kept recovery, but a serial foreach
still delayed every handle.Cancel by up to N×250ms. Run those bounded
Finds with Task.WhenAll so Cancel waits one timeout window, not N.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* fix: give each parallel snapshot Find its own DI scope

Task.WhenAll was sharing one scoped IWorkflowInstanceStore. EF DbContext
is not thread-safe; Phase C already persists sequentially for that reason.
Each snapshot task now CreateScope()s its own store and disposes it.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-09-12 14:23:47 -07:00
Sipke Schoorstra 5ab383ce86
fix: stop requeuing Finished+Interrupted workflow instances (#8052)
* fix: stop requeuing Finished+Interrupted workflow instances

InterruptedRecoveryScanner now requires Status=Running, matching the
sibling crash-recovery task. DrainOrchestrator skips already-terminal
instances so a runner-clobber race cannot stamp Interrupted onto a
Finished row. Fixes #8052.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* fix: conditionally mark Interrupted so drain cannot clobber Finished

PersistInterruptedAsync no longer SaveAsync-es the Find snapshot. The
store now applies Interrupted only when Status is still non-terminal
(EF: ExecuteUpdate WHERE Status != Finished; memory: mutate the live
row). A runner that commits Finished between read and write keeps its
terminal state, so startup recovery cannot requeue completed work.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* test: disambiguate NSubstitute Returns for TryMarkInterruptedAsync

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* fix: make in-memory Interrupted mark atomic against completion

Lock the memory-store check and mutations together, then abort if Status
became Finished in-place so drain cannot record Interrupted on a
completed instance.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* fix: share memory-store lock between Interrupted mark and Save

TryMarkInterruptedAsync now serializes with Save/Update/SaveMany so a
runner's terminal persist cannot land between the non-terminal check
and the Interrupted mutations. A finishing Save therefore cannot leave
Finished+Interrupted.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-09-11 23:05:43 -07:00
Sipke Schoorstra 4f90cfbbdf
fix: register built-in activation strategy serialization aliases (#8049)
* fix: register built-in activation strategy serialization aliases

3.8 type-resolution hardening no longer falls back to Type.GetType, so
Studio-selected and 3.7-era SQN activation strategy types failed to
deserialize. Register the four built-in strategies with legacy names
and advertise registry aliases from the descriptor endpoint.

Fixes https://github.com/elsa-workflows/elsa-core/issues/8049

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* test: DRY activation strategy serialization test setup

Extract shared registry/JSON arrange helpers so activation alias tests
share setup without collapsing their assertions.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* test: qualify Options.Create in serialization test helpers

Avoid Elsa.Options colliding with Microsoft.Extensions.Options.Options.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* test: keep activation alias setup local and obvious

Drop the shared Testing.Shared helper and extra Runtime wrapper. Those
hid one-line registry construction. Leave same-class helpers only.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

* fix: advertise resolvable activation strategy type names

When the registry has no preferred alias, fall back to the simple
assembly-qualified name so Studio stores an identifier the resolver
can load. FullName is not a registered alias.

Co-authored-by: Sipke Schoorstra <sipkeschoorstra@outlook.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-09-11 18:09:51 -07:00
Sipke Schoorstra 2787ff6bd0
Preserve StateMachine composite transition continuations 2026-08-31 04:51:34 +02:00
Sipke Schoorstra da5ccca2be
Yield triggerless StateMachine cycles 2026-08-31 03:30:17 +02:00
Sipke Schoorstra 5a820ce33e
Expand StateMachine conformance coverage 2026-08-31 03:11:19 +02:00
Sipke Schoorstra 6a2e530d77
Enforce StateMachine trigger identity boundaries 2026-08-31 02:54:01 +02:00
Sipke Schoorstra 051e12f864
Fix StateMachine transition lifecycle ordering 2026-08-31 02:47:29 +02:00
Sipke Schoorstra dff7d9f987
Harden output converter contracts
(cherry picked from commit 0737def83d)
2026-08-21 22:22:47 +02:00
Sipke Schoorstra 61fc376dac
Add output converter support at binding boundaries
Backport to release/3.8.0 so Elsa.Api.Client 3.8.0-rc2 exposes the
Resources/OutputConverters surface that Elsa Studio's release/3.8.0 branch
already consumes. Without it, Studio cannot build against a released client:
it was green against 3.8.0-preview.5397 (built from main) and broke when its
pin moved to 3.8.0-rc1 (built from this branch).

(cherry picked from commit d698e6b005)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-21 22:22:46 +02:00
Sipke Schoorstra 5fd3a074c9
Resolve NU1903 warning
warning NU1903: Package 'SSH.NET' 2025.1.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-q939-rpr3-3284
2026-08-15 23:52:27 +02:00
Shivamkmr8 d9ba421737 Use last version for revert version allocation 2026-08-11 12:39:55 +05:30
Sipke Schoorstra 5429008d98
Add architecture and practices documentation
Introduce comprehensive documentation covering architecture (ARCHITECTURE.md), concerns (CONCERNS.md), coding conventions (CONVENTIONS.md), integrations (INTEGRATIONS.md), technology stack (STACK.md), codebase structure (STRUCTURE.md), and testing patterns (TESTING.md). Enhance testing with additional test cases for external sign-in flows, ensuring accurate timestamp recording for identity links.
2026-08-03 23:46:38 +02:00
Sipke Schoorstra ff10a68100
refactor: update package reference configuration
- Updated `CShells.Abstractions` package reference to use the default version in the unit test project.
2026-08-03 13:15:18 +02:00
Sipke Schoorstra e59a0f1721
Merge remote-tracking branch 'origin/release/3.8.0' into release/3.8.0 2026-08-03 02:08:23 +02:00
Sipke Schoorstra 103028452f
feat: introduce HTTP webhooks module
Adds a new `Elsa.Http.Webhooks` module, enabling workflows to receive incoming webhook events and dispatch outgoing webhooks. This integrates the WebhooksCore library.

Further improvements include:
- Enhanced validation for configured application instance names, providing clearer feedback, especially regarding Azure Service Bus entity name limits.
- Improved API error reporting for shell reload operations, distinguishing between blueprint not found (404) and other failures (503).
- Updated release announcement rendering to dynamically reference the correct major.minor release line for feedback messages.
2026-08-03 02:08:15 +02:00
Sipke Schoorstra c557c455ad
Merge release/3.8.0 into bugfix/7900-tenant-request-services 2026-08-03 00:48:56 +02:00
Sipke Schoorstra 286a0d83d1
Harden external identity race compensation 2026-08-02 23:19:49 +02:00
Sipke Schoorstra d10dbdd482
Merge branch 'codex/pr-7903-review-fixes' into release/3.8.0 2026-08-02 22:40:23 +02:00
Sipke Schoorstra f4d749d3f1
Merge branch 'codex/auth-refinements' into release/3.8.0 2026-08-02 22:39:54 +02:00
Sipke Schoorstra fe125ac336
Fix external authentication review findings 2026-08-02 03:35:39 +02:00
Sipke Schoorstra 1b74bb94c0
fix: validate external login methods before discovery
Use the same structural and secret-binding assessment for management, discovery, and initiation so incomplete overrides are never advertised as available sign-in methods.
2026-08-02 02:47:28 +02:00
Sipke Schoorstra 542058971b
Avoid repeated tenant-agnostic registry population 2026-08-02 01:59:45 +02:00
Sipke Schoorstra a24a6fe267
Add test to validate complete configuration requirements for connections
Introduce a new test `ValidateRequiresCompleteConfigurationAndReturnsMissingSecretDetails` to verify that a connection requires a complete configuration, including handling missing secret details. Adjust configuration to enforce `RequiresClientSecret`.
2026-08-02 01:43:30 +02:00
Sipke Schoorstra a60b5a36b2
Refine test for archived connections in shadow relationships; introduce IsAvailableForAuthentication helper for improved connection filtering logic. 2026-08-02 00:49:26 +02:00
Sipke Schoorstra 572cd325b5
Merge compact external authentication secret IDs 2026-08-02 00:22:29 +02:00
Sipke Schoorstra 119f49f7a2
fix: simplify external authentication secret IDs
Use a compact namespaced GUID for newly managed secrets while preserving unique staging and opaque existing references.
2026-08-02 00:22:16 +02:00
Sipke Schoorstra 9f09aca3f6
Refine test to ensure archived connections do not participate as active shadows; update shadow relationship management to exclude archived entries. 2026-07-31 23:07:08 +02:00
Sipke Schoorstra 14f373528d
Add test for handling archived database overrides in connection shadows 2026-07-31 21:34:35 +02:00
Sipke Schoorstra 6e3ed5c4e0
Remove migration for external authentication in EFCore.Sqlite module 2026-07-31 14:31:18 +02:00
Sipke Schoorstra c3c6f12858
fix: restore commit notification scope before flush
Detach the AsyncLocal scope synchronously so notifications published after an asynchronous flush are not re-buffered and discarded. Add regression coverage that forces the flush across an async boundary.
2026-07-31 04:50:31 +02:00
Sipke Schoorstra d63dae95bc
Introduce shadow relationship management in identity provider connections 2026-07-31 01:00:36 +02:00
Rostislav Statko 56b16caa0e
fix: restore request services after tenant middleware exceptions 2026-07-30 09:54:00 +03:00
Sipke Schoorstra ec9acd4f3f
Fix tenant service mutation race (#7898)
Serialize tenant lifecycle mutations and keep synchronization available through shutdown.

Closes #7771.
2026-07-30 02:47:44 +02:00
Sipke Schoorstra edb5f7cd51
Add workflow state rehydration diagnostics (#7899) 2026-07-30 02:28:56 +02:00
Sipke Schoorstra f4ca206607
fix: send preview authentication responses 2026-07-30 02:14:29 +02:00
Sipke Schoorstra 678182dff8
fix: persist relative external auth preview callbacks 2026-07-30 01:27:26 +02:00
Sipke Schoorstra 7941a9d72e
Add runtime descriptor endpoint and tests for version metadata 2026-07-29 20:01:16 +02:00
Sipke Schoorstra 1ccf5b7611
Add test for callback session persistence; extend authentication broker for refresh token hash initialization; enable config connection overrides 2026-07-29 13:59:24 +02:00
Sipke Schoorstra 22bc531aa8
Allow promoting shadowed authentication connections 2026-07-29 12:13:06 +02:00
Sipke Schoorstra 238080c465
feat: add configuration-backed Keycloak demo providers 2026-07-28 00:12:12 +02:00
Sipke Schoorstra eb07aa2cde
Fix external authentication connection contracts 2026-07-27 10:07:29 +02:00
Sipke Schoorstra 75a3216ae8
Persist external authentication in identity shell 2026-07-27 02:25:41 +02:00
Sipke Schoorstra 0fa7657b30
Harden external identity link management 2026-07-27 00:40:23 +02:00
Sipke Schoorstra e97a90d442
Add atomic external identity link replacement 2026-07-26 23:40:17 +02:00
Sipke Schoorstra 97c459f198
Add OpenID Connect authentication features 2026-07-26 23:38:20 +02:00
Sipke Schoorstra 04e58690ff
chore: apply safe dependency upgrades (#7896) 2026-07-26 21:42:27 +02:00
Sipke Schoorstra 7e82a55a9f
Fix local external authentication refresh 2026-07-26 01:49:36 +02:00
Sipke Schoorstra e8aa353d57
Auto stash before merge of "release/3.8.0" and "origin/release/3.8.0" 2026-07-26 00:54:04 +02:00
Sipke Schoorstra 42e507b0d8
Preserve Elsa permissions during external sign-in 2026-07-26 00:27:54 +02:00