Skip to content

Conversation

@flaviostutz
Copy link
Owner

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

wso2Tenant: string;
},
): Promise<undefined> => {
if (!args.lifecycleStatus) throw new Error(`'lifecycleStatus' is required`);

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?

Copy link
Owner Author

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?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

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

Copy link
Owner Author

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 😊

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`);
Copy link
Collaborator

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

@flaviostutz flaviostutz changed the title [WIP] feat: API Lifecycle status control initial implementation feat: API Lifecycle status control initial implementation Nov 13, 2024
@flaviostutz flaviostutz merged commit 547ac09 into main Nov 13, 2024
@flaviostutz flaviostutz deleted the feat/lifecycle-control branch November 13, 2024 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants