Refactor shells; add consumer graph & call stack tracking#7352
Refactor shells; add consumer graph & call stack tracking#7352sfmskywalker wants to merge 17 commits intomainfrom
Conversation
Replace CShells NuGet package references with direct project references to the local CShells source to enable developing and testing against local changes and simplify build integration across modules.
Added error handling for assembly load failures in feature discovery to improve resilience. Also updated configuration for identity token options and removed unused service bus consumer dependencies. Simplified project structure by moving and cleaning up `Directory.Build.targets` files.
Moved `ShellSettingsExtensions` and `ShellConfiguration` to `CShells.Abstractions` for better modularity. Added new `ServiceCollectionFeatureExtensions` to improve options registration. Updated appsettings and references to support these changes.
…y and variable registration Added `ManagementServiceCollectionExtensions` for registering Elsa activity types and variable descriptors, providing a modular and shell-feature-compatible approach to configuration. Updated relevant features to utilize these new extension methods, enhancing code modularity and reducing redundancy.
Introduced `ResilienceServiceCollectionExtensions` to register resilience strategies within the `Elsa.Resilience.Core` module. Updated `HttpFeature` to incorporate resilience strategies, enhancing HTTP-related resilience configuration leveraging the new extension methods.
Implemented multiple properties in `JavaScriptFeature` to enhance JavaScript execution: `AllowClrAccess`, `AllowConfigurationAccess`, `ScriptCacheTimeout`, `DisableWrappers`, and `DisableVariableCopying`. These additions enable more flexible and secure configuration of the Jint JavaScript engine.
Resolve workflow definitions first and store graphs under stable per-version-ID cache keys so different lookup paths share entries. Centralize cache creation and change-token registration to remove duplicated caching logic. Skip materializer-unavailable definitions to avoid caching null graphs and simplify flow.
Introduce constants for default definition and version IDs, and materializer name. Refactor tests to use these constants, streamline graph and definition resolution, and improve cache key creation by sharing logic across tests. Extend tests to check scenarios with unavailable materializers, ensuring caching only occurs for valid cases.
Added checks for both workflow definition and version cache keys in AutoUpdateTests to ensure comprehensive cache validation, improving test reliability and coverage.
…ration Revised project reference paths in `Elsa.ModularServer.Web.csproj` for CShells projects and updated `Elsa.sln` to include new CShells projects, streamlining project organization and build configuration.
…rename `ResilienceShellFeature` to `ResilienceFeature`.
…pWorkflowsMiddleware`, and update `HttpActivityOptions` defaults.
… service collections - Introduced `AddTypeAlias<T>` method in `ServiceCollectionExtensions.cs` for adding type aliases. - Added `AddVariableTypeAndAlias<T>` method in `ManagementServiceCollectionExtensions.cs` to add variable types with aliases.
Greptile SummaryThis PR switches four Key observations:
Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| Elsa.sln | Adds a cshells solution folder containing 6 CShells project references from a sibling repo path (../cshells/). All 6 projects are wired into build configurations and nested correctly. However, Elsa.ModularServer.Web.csproj (not in this diff) still references the concrete CShells.AspNetCore and CShells.FastEndpoints NuGet packages, creating a mixed NuGet/local-source state. |
| src/common/Elsa.Api.Common/Elsa.Api.Common.csproj | Switches CShells.AspNetCore.Abstractions and CShells.FastEndpoints.Abstractions from NuGet PackageReference to local ProjectReference. Requires sibling cshells repository to be present; will break fresh checkouts of elsa-core alone. |
| src/common/Elsa.Features/Elsa.Features.csproj | Switches CShells.Abstractions from NuGet PackageReference to local ProjectReference. Same sibling-repo dependency concern as the other updated csproj files. |
| src/modules/Elsa.Identity/Elsa.Identity.csproj | Switches CShells.FastEndpoints.Abstractions to local ProjectReference. Note: Elsa.Identity already references Elsa.Api.Common (which itself brings in this same project), making this a redundant but harmless direct reference. |
| src/modules/Elsa.Workflows.Api/Elsa.Workflows.Api.csproj | Switches CShells.FastEndpoints.Abstractions to local ProjectReference. Same observations as Elsa.Identity — sibling-repo path dependency and redundant reference via Elsa.Api.Common. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph elsa-core repo
SLN[Elsa.sln]
FEA[Elsa.Features.csproj]
API[Elsa.Api.Common.csproj]
IDN[Elsa.Identity.csproj]
WFA[Elsa.Workflows.Api.csproj]
WEB[Elsa.ModularServer.Web.csproj]
end
subgraph cshells sibling repo
CA[CShells.Abstractions]
C[CShells]
CASP[CShells.AspNetCore.Abstractions]
CASP2[CShells.AspNetCore]
CFE[CShells.FastEndpoints.Abstractions]
CFE2[CShells.FastEndpoints]
end
subgraph NuGet
NU_CASP2["CShells.AspNetCore v0.0.11"]
NU_CFE2["CShells.FastEndpoints v0.0.11"]
end
SLN -->|solution folder| CA
SLN -->|solution folder| C
SLN -->|solution folder| CASP
SLN -->|solution folder| CASP2
SLN -->|solution folder| CFE
SLN -->|solution folder| CFE2
FEA -->|ProjectReference NEW| CA
API -->|ProjectReference NEW| CASP
API -->|ProjectReference NEW| CFE
IDN -->|ProjectReference NEW| CFE
WFA -->|ProjectReference NEW| CFE
WEB -->|PackageReference UNCHANGED| NU_CASP2
WEB -->|PackageReference UNCHANGED| NU_CFE2
NU_CASP2 -.->|transitive NuGet dep| CASP
NU_CFE2 -.->|transitive NuGet dep| CFE
style NU_CASP2 fill:#f96,stroke:#c00
style NU_CFE2 fill:#f96,stroke:#c00
Comments Outside Diff (1)
-
src/apps/Elsa.ModularServer.Web/Elsa.ModularServer.Web.csproj, line 3-4 (link)Incomplete migration — mixed PackageReference/ProjectReference for CShells
Elsa.ModularServer.Web.csprojstill consumesCShells.AspNetCoreandCShells.FastEndpointsviaPackageReference(NuGet v0.0.11), while all their upstream dependencies (CShells.Abstractions,CShells.AspNetCore.Abstractions,CShells.FastEndpoints.Abstractions) have been switched to localProjectReferences in this PR.At build time the NuGet concrete packages will pull in their own transitive dependency on
CShells.*Abstractionsv0.0.11from NuGet. MSBuild will therefore try to reconcile two copies of those assemblies: one from the local project build and one from NuGet. Depending on the final resolution, the wrong ABI version could end up in the output, silently shadowing the locally-built abstractions or causing type-identity mismatches at runtime.To stay consistent,
CShells.AspNetCoreandCShells.FastEndpointsshould also be switched toProjectReferencehere:<ProjectReference Include="..\..\..\..\cshells\src\CShells.AspNetCore\CShells.AspNetCore.csproj" /> <ProjectReference Include="..\..\..\..\cshells\src\CShells.FastEndpoints\CShells.FastEndpoints.csproj" />
Both target projects are already registered in
Elsa.slnunder the newcshellssolution folder.
Last reviewed commit: 01e458a
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="CShells.Abstractions" /> | ||
| <ProjectReference Include="..\..\..\..\cshells\src\CShells.Abstractions\CShells.Abstractions.csproj" /> |
There was a problem hiding this comment.
External sibling-repository dependency breaks default contributor workflow
The ProjectReference path ../../../../cshells/src/CShells.Abstractions/CShells.Abstractions.csproj resolves to a directory that is a sibling of the elsa-core repo root (i.e. ../cshells/ relative to the solution). This pattern requires every developer and every CI agent to check out the cshells repository beside elsa-core before the solution can build.
Without an explicit README note, a git submodule, or a CI pipeline step that clones cshells as a sibling, any fresh clone of elsa-core alone will fail to restore/build with an error like:
error MSB3202: The project file "..\cshells\src\CShells.Abstractions\CShells.Abstractions.csproj" was not found.
Consider documenting the required sibling checkout in the repository README (or CONTRIBUTING.md), and adding the corresponding checkout step to the CI workflow. The same concern applies to Elsa.Api.Common.csproj, Elsa.Identity.csproj, and Elsa.Workflows.Api.csproj where the same relative path pattern is used.
Purpose
Modernize shell-based features and add developer-facing graph and observability capabilities:
Scope
Select one primary concern:
Description
Problem
Solution
Add workflow consumer graph:
Add activity execution call stack:
Modernize shell features and configuration:
Improve multitenancy and caching:
Bolster runtime resilience in distributed scenarios:
CI and dependencies:
Hardening and fixes:
Verification
Steps:
Expected outcome:
Screenshots / Recordings (if applicable)
Commit Convention
We recommend using conventional commit prefixes:
fix:– Bug fixes (behavior change)feat:– New features (e.g., consumer graph, call stack API)refactor:– Code changes without behavior change (shell feature consolidation)docs:– Documentation updates (release notes agent path)chore:– Maintenance, tooling, or dependency updates (.NET 10, package bumps)test:– Test additions or modifications (graph/export/call stack/idempotency)Clear commit messages make reviews easier and history more meaningful.
Checklist