Exemple #1
0
        public bool DetermineFailure()
        {
            Utilities.WriteDebug($"Determining failure for {Repo}...", Log, LogLevel);
            if (BuildBreakdowns.Count == 0)
            {
                Utilities.WriteDebug($"No builds found for {Repo} this rollout; rollout marked as FAILED.", Log, LogLevel);
                return(true);
            }

            ScorecardBuildBreakdown lastBuild = BuildBreakdowns.Last();

            Utilities.WriteDebug($"Last build is for {Repo} is {lastBuild.BuildSummary.BuildNumber} ({lastBuild.BuildSummary.WebLink})", Log, LogLevel);

            if (lastBuild.Score.Rollbacks == 1)
            {
                Utilities.WriteDebug($"Last build ({lastBuild.BuildSummary.BuildNumber}) was a rollback; rollout marked as FAILED.", Log, LogLevel);
                return(true);
            }

            string lastBuildResult = lastBuild.BuildSummary.Result;

            Utilities.WriteDebug($"Build {lastBuild.BuildSummary.BuildNumber} has result '{lastBuildResult}'", Log, LogLevel);
            switch (lastBuildResult)
            {
            case "succeeded":
            case "partiallySucceeded":
                Utilities.WriteDebug($"Last build determined successful.", Log, LogLevel);
                return(false);

            default:
                Utilities.WriteDebug($"Last build determined unsuccessful; rollout marked as FAILED.", Log, LogLevel);
                return(true);
            }
        }
        public bool DetermineFailure()
        {
            if (BuildBreakdowns.Count == 0)
            {
                return(true);
            }

            string lastBuildResult = BuildBreakdowns.Last().BuildSummary.Result;

            switch (lastBuildResult)
            {
            case "succeeded":
            case "partiallySucceeded":
                return(false);

            default:
                return(true);
            }
        }
        public bool DetermineFailure(List <Issue> githubIssues)
        {
            Utilities.WriteDebug($"Determining failure for {Repo}...", Log, LogLevel);
            if (githubIssues.Any(i => Utilities.IssueContainsRelevantLabels(i, GithubLabelNames.FailureLabel, RepoConfig.GithubIssueLabel, Log, LogLevel)))
            {
                Utilities.WriteDebug($"Issue with failure tag found for {Repo}; rollout marked as FAILED", Log, LogLevel);
                return(true);
            }

            if (BuildBreakdowns.Count == 0)
            {
                Utilities.WriteDebug($"No builds found for {Repo} this rollout; rollout marked as FAILED.", Log, LogLevel);
                return(true);
            }

            ScorecardBuildBreakdown lastBuild = BuildBreakdowns.Last();

            Utilities.WriteDebug($"Last build is for {Repo} is {lastBuild.BuildSummary.BuildNumber} ({lastBuild.BuildSummary.WebLink})", Log, LogLevel);

            if (lastBuild.Score.Rollbacks == 1)
            {
                Utilities.WriteDebug($"Last build ({lastBuild.BuildSummary.BuildNumber}) was a rollback; rollout marked as FAILED.", Log, LogLevel);
                return(true);
            }

            string lastBuildResult = lastBuild.BuildSummary.Result;

            Utilities.WriteDebug($"Build {lastBuild.BuildSummary.BuildNumber} has result '{lastBuildResult}'", Log, LogLevel);
            switch (lastBuildResult)
            {
            case "succeeded":
            case "partiallySucceeded":
                Utilities.WriteDebug($"Last build determined successful.", Log, LogLevel);
                return(false);

            default:
                Utilities.WriteDebug($"Last build determined unsuccessful; rollout marked as FAILED.", Log, LogLevel);
                return(true);
            }
        }
Exemple #4
0
 public bool DetermineFailure()
 {
     return(BuildBreakdowns.Count == 0 || BuildBreakdowns.Last().BuildSummary.Result != "succeeded");
 }