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

Explicitly handle cancellation on errors #56

Merged
merged 1 commit into from
Aug 24, 2022
Merged

Explicitly handle cancellation on errors #56

merged 1 commit into from
Aug 24, 2022

Conversation

yoannchaudet
Copy link
Collaborator

When a deployment reaches the client side timeout, we don't cancel it. This PR addresses that.

This also explicit cancel a deployment after too many errors pulling the status (this may not work but I feel it's best to be safer here).

@yoannchaudet yoannchaudet requested a review from a team as a code owner August 24, 2022 04:33
Comment on lines +173 to +174
await this.cancel()
return
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is new and I think will not hurt.

@@ -109,7 +109,7 @@ class Deployment {
const statusUrl =
this.deploymentInfo != null
? this.deploymentInfo['status_url']
: `${this.githubApiUrl}/repos/${this.repositoryNwo}/pages/deployment/status/${process.env['GITHUB_SHA']}`
: `${this.githubApiUrl}/repos/${this.repositoryNwo}/pages/deployment/status/${this.buildVersion}`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don't use other environment variable in this file so normalizing to what's in the context. Did the same for cancel below.

Copy link
Contributor

@JamesMGreene JamesMGreene left a comment

Choose a reason for hiding this comment

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

Looks great. 👍🏻

Base automatically changed from formatter to main August 24, 2022 15:59
@yoannchaudet yoannchaudet merged commit 114f9cc into main Aug 24, 2022
@yoannchaudet yoannchaudet deleted the cancel branch August 24, 2022 17:46
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.

None yet

2 participants