Skip to content
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/wait for update openapi document #23

Conversation

MarcioMeier
Copy link
Collaborator

Summary

WSO2 has a few overlap fields between the api definition and the openapi document.
We already check for those changes in the checkWSO2Equivalence method, but it seems to take a while to propagate to the openapi document. If update the openapi document right after updating the api defs, the changes may not be propagated and the final version will not reflect the new definitions.

It is an known issue, take a look in these discussions from serverless apim plugin:

What was changed?

I added a function in the beginning of the deployment to check if there are changes in these overlap fields.
If so, we hang for 2 minutes before updating the openapi document... As far as I tested, 2 minutes is more than enough to WSO2 propagate all the info.

@MarcioMeier MarcioMeier requested a review from flaviostutz June 3, 2024 10:31
@MarcioMeier MarcioMeier self-assigned this Jun 3, 2024
@MarcioMeier MarcioMeier force-pushed the feat/wait-for-update-openapi-document branch from b2921e6 to 9f671a8 Compare June 3, 2024 14:07
Copy link
Owner

@flaviostutz flaviostutz left a comment

Choose a reason for hiding this comment

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

This is a very nice addition! Thanks!

'>>> Wait for 2 minutes for the WSO2 api changes propagate before updating Openapi document...',
);
// eslint-disable-next-line no-promise-executor-return, promise/param-names
await new Promise((resolveP) => setTimeout(resolveP, 120000));
Copy link
Owner

Choose a reason for hiding this comment

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

discussion: Different clusters of WSO2 might behave in different ways, so we could simply continue retrying until this is set, shouldn't we? (or is this something we can't check if was updated correctly?)

@flaviostutz flaviostutz merged commit caedb78 into flaviostutz:main Jun 5, 2024
2 checks passed
@MarcioMeier MarcioMeier deleted the feat/wait-for-update-openapi-document branch June 21, 2024 12: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.

2 participants