-
Notifications
You must be signed in to change notification settings - Fork 30
[codex] Harden alterations guides against 3.8.0 #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,8 @@ The Alterations module exposes `POST /alterations/run` for immediate execution a | |
|
|
||
| Use this endpoint when you already know the target instance IDs and want the results immediately. If you want Elsa to select instances from a filter and process them in the background, use [alteration plans](../alteration-plans/rest-api.md) instead. | ||
|
|
||
| All endpoints on this page require the `run:alterations` permission. | ||
|
|
||
| For example, to apply an alteration that modifies a variable, migrates the workflow instance to a new version, and schedules an activity, use the following request: | ||
|
|
||
| ```http | ||
|
|
@@ -68,3 +70,39 @@ The response includes one result per targeted workflow instance: | |
| ``` | ||
|
|
||
| After the runner finishes, the endpoint automatically dispatches any successful workflow instance that still has scheduled work. | ||
|
|
||
| ## Retry faulted activities | ||
|
|
||
| `release/3.8.0` also exposes `POST /alterations/workflows/retry` for retrying faulted activities across one or more workflow instances. | ||
|
|
||
| If you omit `activityIds`, Elsa retries all incident activity IDs recorded on each specified workflow instance. | ||
|
|
||
| ```http | ||
| POST /alterations/workflows/retry HTTP/1.1 | ||
| Host: localhost:5001 | ||
|
|
||
| { | ||
| "workflowInstanceIds": [ | ||
| "88ce68d00e824c78a53af04f16d276ea" | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| To retry only specific activities, include `activityIds`: | ||
|
|
||
| ```http | ||
| POST /alterations/workflows/retry HTTP/1.1 | ||
| Host: localhost:5001 | ||
|
|
||
| { | ||
| "workflowInstanceIds": [ | ||
| "88ce68d00e824c78a53af04f16d276ea" | ||
| ], | ||
| "activityIds": [ | ||
| "ShipOrder", | ||
| "CapturePayment" | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| The response shape matches `/alterations/run` by returning one result per targeted workflow instance. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
ArtifactsRepro: executable retry endpoint harness
Repro: harness output showing 200 OK and multiplied results
Prompt To Fix With AIThis is a comment left during a code review.
Path: features/alterations/applying-alterations/rest-api.md
Line: 108
Comment:
**Retry results multiply** The shipped retry endpoint does not always return one result per targeted workflow instance. In `release/3.8.0`, it loops over each loaded workflow instance, then calls the alteration runner with the full requested `workflowInstanceIds` collection each time. With two workflow IDs and omitted `activityIds`, callers can receive four results, and incident activity IDs from one instance can be applied to the other instance. The docs should describe this release behavior or recommend one workflow instance ID per retry request when relying on incident-derived activity IDs.
How can I resolve this? If you propose a fix, please make it concise. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run:alterations. Inrelease/3.8.0,GET /alterations/{id}is guarded byread:alterations, while submit and dry-run userun:alterations. An operator following this note can grant onlyrun:alterationsand still get authorization failures when trying to inspect plan/job status.Artifacts
Repro: executable authorization metadata harness for alteration endpoints
Repro: harness output showing endpoint permissions and HTTP status mappings
Prompt To Fix With AI