-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: API Lifecycle status control initial implementation #43
Conversation
wso2Tenant: string; | ||
}, | ||
): Promise<undefined> => { | ||
if (!args.lifecycleStatus) throw new Error(`'lifecycleStatus' is required`); |
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.
shouldn't lifecycle status be set to "publish" by default?
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.
I made it optional so if it's not defined we don't touch on the lifecycle actions and leave it as it is. Another way would be to make it by default be "PUBLISHED" indeed so we would always call the lifecycle to something. What do you think?
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.
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.
I think I prefer to not having default value here, so we just trigger the lifecycle when the caller defines it.
how would we make to not trigger the lifecycle if the default value is "publish"?
p.s. as of my understanding, we want give the option to the user to not touch the api lifecycle in case of manual workflows
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.
That was exactly the original idea 😊
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.
But by default, there are no manual workflows and the lifecycle should be "PUBLISH" right? Only in specific scenarios that a manual workflow is needed (in e.g. upper environments like production).
To make the consumers' life easier setting it by default would be nicer.
But I agree, it does not make it very explicit and it might be disregarded. So anyway works for me. 😬
wso2Tenant: string; | ||
}, | ||
): Promise<undefined> => { | ||
if (!args.lifecycleStatus) throw new Error(`'lifecycleStatus' is required`); |
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.
I think I prefer to not having default value here, so we just trigger the lifecycle when the caller defines it.
how would we make to not trigger the lifecycle if the default value is "publish"?
p.s. as of my understanding, we want give the option to the user to not touch the api lifecycle in case of manual workflows
Summary
This PR adds the prop lifecycleStatus to Wso2ApiProps. If defined, lifecycle status change actions will be triggered accordingly to change the status to the desired state.
Also, if a workflowStatus is detected, the check lifecycle status check is skipped, because there may have a pending workflow process that might take days to complete before the status is actually changed.
This PR implements #42