Closed
Conversation
tmarcuzz
reviewed
Apr 16, 2025
| rollBack() { | ||
| return Promise.resolve(ActionState.SUCCESS); | ||
| clone(){ | ||
| const clone = new (this.constructor as any)(); |
Contributor
There was a problem hiding this comment.
Can you use the fact that setArgument returns this?
return (new (this.constructor as any)()).setArgument({ ...this.argument });
tmarcuzz
reviewed
Apr 16, 2025
|
|
||
| export enum ResourceState { | ||
| /** | ||
| * @deprecated use UNKNOWN |
Contributor
There was a problem hiding this comment.
lets take the opportunity to remove all the deprecated things
tmarcuzz
reviewed
Apr 16, 2025
| return Action._constructFromWorkflow(actionDb); | ||
| } else { | ||
| return Action._constructFromDb(actionDb); | ||
| } |
Contributor
There was a problem hiding this comment.
That would be more concise:
return actionDb.definitionFrom?.workflow?._id
? Action._constructFromWorkflow(actionDb)
: Action._constructFromDb(actionDb);
tmarcuzz
reviewed
Apr 16, 2025
| setResult(result: Object) { | ||
| this.dbDoc.result = { ...this.dbDoc.result, ...result }; | ||
| setResult(...results) { | ||
| if(results.length === 1){ |
Contributor
There was a problem hiding this comment.
more concise alternative
this.dbDoc.result = results.length === 1 ? results[0] : results;
added 22 commits
April 23, 2025 19:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change description
First step toward orbits v2
Introduction on a new syntax in the Workflow and of two new classes in the core of orbits
Workflow
Now the body of define has to be written as :
`define(){
await this.do("xyz", new Action(...))
}`
Pro :
Easier to add a step in the middle of a workflow
Easier to read
Easier to do try/catch
Con:
Can be confusing with a classic await --> maybe we should write an eslint rule in order not to mixt the two kind of await
Generator
Generators are introduced to manage locking and avoid conflicting runs.
How does it work ?
When a generator starts, it checks if another generator with the same identity + actionRef exists.
If one exists and hasn’t reached a SUCCESS state, it reuses the existing one instead of launching a new one.
Resource
Resources help solve the "redo workflow" problem by introducing lifecycle methods with versioning and drift detection.
How does it work ?
defineInstall() is run :
defineUpdate() is run :
defineUninstall() is run :
Additionally:
Type of change
Related issues
This TR can be looked : https://docs.google.com/document/d/1JuZ0Xz6wDmesNPXtBK-c7gi_dq083TzB1krssMgyN-s/edit?tab=t.0
Checklists
Development
Security
Code review
Next steps :