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

Updated endpoint used for build/deploy which supports polling and added polling #411

Merged
merged 4 commits into from
Jan 13, 2021

Conversation

miketalley
Copy link
Contributor

@miketalley miketalley commented Jan 5, 2021

Description and Context

Changed custom serverless build endpoint from cms/v3/functions/package to cms/v3/functions/build which returns a buildId. This is used to poll cms/v3/functions/build/((id))/poll for build status.

This update does not change anything visibly or from a flow standpoint, it is done to allow polling to be done instead of having the BE endpoint only respond when the build has completed.

The --delete option has also been removed from the hs functions deploy command as the backend handles properly deleting associated built packages when serverless function folders are deleted.

Who to Notify

@bkrainer @gcorne @williamspiro

@@ -30,6 +30,23 @@ const makeSpinner = (actionText, functionPath, accountIdentifier) => {
);
};

const pollBuildStatus = (accountId, buildId) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice. Is 1000 too fast?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I set it to a faster poll because the build seems to happen pretty quickly in some cases. Although, this is a good point because the BE only has PROCESSING, ERROR, and SUCCESS states ATM, so we can dial this back. I'll go with 5000

@miketalley miketalley merged commit bdede5f into master Jan 13, 2021
@miketalley miketalley deleted the serverless/build-and-poll branch January 13, 2021 18:57
miketalley added a commit that referenced this pull request Jan 22, 2021
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