Пример #1
0
        private void AddQaChangeSets(StringBuilder contentBuilder, List <MergeRequest> mergeRequests, string qaBranchName)
        {
            var requestsMergeToQa = RequestsMergeToTargetBranch(mergeRequests, qaBranchName);

            if (!requestsMergeToQa.Any())
            {
                return;
            }

            var qaChangeSets = from request in requestsMergeToQa
                               group request by request.SourceBranch
                               into qaGroup
                               orderby qaGroup.Key
                               select new
            {
                SourceBranch = qaGroup.Key,
                ChangeSets   = string.Join(',', qaGroup.OrderBy(r => r.DevChangeSetId).Select(r => r.DevChangeSetId).Distinct())
            };

            contentBuilder.AppendLine(_mailTemplate.GenerateSectionTitle("DEV", "QA"));
            qaChangeSets.ToList()
            .ForEach(changeSetGroup => { contentBuilder.AppendLine(_mailTemplate.GenerateQaChangeSet(changeSetGroup.SourceBranch, changeSetGroup.ChangeSets)); });

            contentBuilder.Append(_mailTemplate.GenerateNewLine());
        }