elsa-core/specs/001-shell-reload-api/quickstart.md

40 lines
2.2 KiB
Markdown
Raw Normal View History

Add shell reload API endpoints and client support (#7353) * feat: add specification and quality checklist for Shell Reload API endpoints * feat: implement Shell Reload API endpoints and associated documentation * feat: enhance Shell Reload API documentation and add tasks for implementation phases * feat: implement Shell Reload API features with endpoints, interface contracts, models, and component tests * feat: update Shell Reload API responses and tests to reflect changes in error handling and response structure * Fix shell reload follow-up review issues (#7354) * Initial plan * Address shell reload review feedback Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Dispose shell reload semaphore Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Harden shell reload follow-up fixes Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> * Update src/modules/Elsa.Workflows.Api/Endpoints/Shells/Reload/Endpoint.cs Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Potential fix for pull request finding 'Missed opportunity to use Where' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Update src/modules/Elsa.Workflows.Api/Endpoints/Shells/Reload/Endpoint.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-09 07:37:11 +00:00
# Quickstart: Shell Reload API Endpoints
## Goal
Implement and verify two administrative endpoints that refresh shell-backed configuration:
- reload all shells
- reload one requested shell while still using the current full-reload fallback
## Implementation Steps
1. Add the API module dependency required to consume `IShellManager`, `IShellSettingsProvider`, and `IShellSettingsCache`.
2. Add a shell reload orchestration contract and implementation under `src/modules/Elsa.Workflows.Api/Contracts` and `src/modules/Elsa.Workflows.Api/Services`.
3. Add endpoint folders under `src/modules/Elsa.Workflows.Api/Endpoints/Shells/ReloadAll` and `src/modules/Elsa.Workflows.Api/Endpoints/Shells/Reload` with collocated request/response models.
4. Use the orchestration service to enforce:
- busy rejection
- unknown-shell validation
- targeted requested-shell strictness
- detailed per-shell results
- current full-reload fallback semantics for the targeted endpoint
5. Add a new client resource under `src/clients/Elsa.Api.Client/Resources/Shells` so first-party consumers can call both endpoints.
6. Add component tests under `test/component/Elsa.Workflows.ComponentTests/Scenarios/RestApis/Endpoints/Shells`.
## Verification Scenarios
1. Full reload returns `Completed` when every affected shell refreshes successfully.
2. Full reload returns `Partial` and shell-level detail when at least one shell remains unchanged because of invalid configuration.
3. Targeted reload returns `404` when the requested shell is unknown.
The `404` response does not include a JSON body.
4. Targeted reload returns `422` with shell-level detail when the requested shell does not refresh successfully during the fallback full reload.
5. Either endpoint returns `409` while another reload is already in progress.
6. Either endpoint returns `503` when the configuration provider cannot supply usable shell settings.
## Suggested Validation Commands
```bash
dotnet test test/component/Elsa.Workflows.ComponentTests/ --filter "FullyQualifiedName~Scenarios.RestApis.Endpoints.Shells" -p:CollectCoverage=false
```
If the component suite is too broad during iteration, run the project with a test filter targeting the new shell reload scenario names.