Example #1
0
        public BuildResultEntity(
            BoundBuildId buildId,
            DateTimeOffset buildDateTime,
            TimeSpan duration,
            string jobKind,
            string machineName,
            BuildResultClassification classification,
            PullRequestInfo prInfo)
        {
            JobName               = buildId.JobId.Name;
            JobKind               = jobKind;
            ViewName              = AzureUtil.GetViewName(BuildId.JobId);
            BuildNumber           = buildId.Number;
            HostRaw               = buildId.Host.ToString();
            ClassificationKindRaw = classification.Kind.ToString();
            ClassificationName    = classification.Name;
            BuildDateTime         = buildDateTime.UtcDateTime;
            MachineName           = machineName;
            IsPullRequest         = JobUtil.IsPullRequestJobName(buildId.JobId);
            DurationSeconds       = (int)duration.TotalSeconds;

            if (prInfo != null)
            {
                PullRequestId          = prInfo.Id;
                PullRequestAuthor      = prInfo.Author;
                PullRequestAuthorEmail = prInfo.AuthorEmail;
                PullRequestUrl         = prInfo.PullUrl;
                PullRequestSha1        = prInfo.Sha1;
                Debug.Assert(HasPullRequestInfo);
                Debug.Assert(PullRequestInfo != null);
            }

            Debug.Assert(BuildDateTime.Kind == DateTimeKind.Utc);
        }
Example #2
0
        public BuildResultEntity(
            BoundBuildId buildId,
            DateTimeOffset buildDateTime,
            TimeSpan duration,
            string jobKind,
            string machineName,
            BuildResultClassification classification,
            PullRequestInfo prInfo)
        {
            JobName = buildId.JobId.Name;
            JobKind = jobKind;
            ViewName = AzureUtil.GetViewName(BuildId.JobId);
            BuildNumber = buildId.Number;
            HostRaw = buildId.Host.ToString();
            ClassificationKindRaw = classification.Kind.ToString();
            ClassificationName = classification.Name;
            BuildDateTime = buildDateTime.UtcDateTime;
            MachineName = machineName;
            IsPullRequest = JobUtil.IsPullRequestJobName(buildId.JobId);
            DurationSeconds = (int)duration.TotalSeconds;

            if (prInfo != null)
            {
                PullRequestId = prInfo.Id;
                PullRequestAuthor = prInfo.Author;
                PullRequestAuthorEmail = prInfo.AuthorEmail;
                PullRequestUrl = prInfo.PullUrl;
                PullRequestSha1 = prInfo.Sha1;
                Debug.Assert(HasPullRequestInfo);
                Debug.Assert(PullRequestInfo != null);
            }

            Debug.Assert(BuildDateTime.Kind == DateTimeKind.Utc);
        }