From f8d5fe9a1f3775fa4fa182ce060b3ff2878307db Mon Sep 17 00:00:00 2001 From: hemarina <104857065+hemarina@users.noreply.github.com> Date: Wed, 10 Jul 2024 09:27:31 -0700 Subject: [PATCH] add fleaky case for silence build error fail and run out of time (#4094) --- cli/azd/pkg/tools/azcli/webapp.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/cli/azd/pkg/tools/azcli/webapp.go b/cli/azd/pkg/tools/azcli/webapp.go index 03b98bfbd87..382afc7e063 100644 --- a/cli/azd/pkg/tools/azcli/webapp.go +++ b/cli/azd/pkg/tools/azcli/webapp.go @@ -81,18 +81,31 @@ func appServiceRepositoryHost( } func resumeDeployment(err error, progressLog func(msg string)) bool { - if strings.Contains(err.Error(), "empty deployment status id") { + errorMessage := err.Error() + if strings.Contains(errorMessage, "empty deployment status id") { progressLog("Deployment status id is empty. Failed to enable tracking runtime status." + "Resuming deployment without tracking status.") return true } - if strings.Contains(err.Error(), "response or its properties are empty") { + if strings.Contains(errorMessage, "response or its properties are empty") { progressLog("Response or its properties are empty. Failed to enable tracking runtime status." + "Resuming deployment without tracking status.") return true } + if strings.Contains(errorMessage, "failed to start within the allotted time") { + progressLog("Deployment with tracking status failed to start within the allotted time." + + "Resuming deployment without tracking status.") + return true + } + + if strings.Contains(errorMessage, "the build process failed") && !strings.Contains(errorMessage, "logs for more info") { + progressLog("Failed to enable tracking runtime status." + + "Resuming deployment without tracking status.") + return true + } + var httpErr *azcore.ResponseError if errors.As(err, &httpErr) && httpErr.StatusCode == 404 { progressLog("Resource not found. Failed to enable tracking runtime status." +