/// <summary> /// Formats a comment for a given <paramref name="testMerge"/>. /// </summary> /// <param name="repositorySettings">The <see cref="RepositorySettings"/> to use.</param> /// <param name="compileJob">The test merge's <see cref="CompileJob"/>.</param> /// <param name="testMerge">The <see cref="TestMerge"/>.</param> /// <param name="remoteRepositoryOwner">The <see cref="Api.Models.Internal.IGitRemoteInformation.RemoteRepositoryOwner"/>.</param> /// <param name="remoteRepositoryName">The <see cref="Api.Models.Internal.IGitRemoteInformation.RemoteRepositoryName"/>.</param> /// <param name="updated">If <see langword="false"/> <paramref name="testMerge"/> is new, otherwise it has been updated to a different <see cref="Api.Models.TestMergeParameters.TargetCommitSha"/>.</param> /// <returns>A <see cref="Task"/> representing the running operation.</returns> protected abstract string FormatTestMerge( RepositorySettings repositorySettings, CompileJob compileJob, TestMerge testMerge, string remoteRepositoryOwner, string remoteRepositoryName, bool updated);
/// <inheritdoc /> protected override string FormatTestMerge( RepositorySettings repositorySettings, CompileJob compileJob, TestMerge testMerge, string remoteRepositoryOwner, string remoteRepositoryName, bool updated) => String.Format( CultureInfo.InvariantCulture, "#### Test Merge {4}{0}{0}##### Server Instance{0}{5}{1}{0}{0}##### Revision{0}Origin: {6}{0}Merge Request: {2}{0}Server: {7}{3}", Environment.NewLine, repositorySettings.ShowTestMergeCommitters.Value ? String.Format( CultureInfo.InvariantCulture, "{0}{0}##### Merged By{0}{1}", Environment.NewLine, testMerge.MergedBy.Name) : String.Empty, testMerge.TargetCommitSha, testMerge.Comment != null ? String.Format( CultureInfo.InvariantCulture, "{0}{0}##### Comment{0}{1}", Environment.NewLine, testMerge.Comment) : String.Empty, updated ? "Updated" : "Deployed", Metadata.Name, compileJob.RevisionInformation.OriginCommitSha, compileJob.RevisionInformation.CommitSha);
/// <inheritdoc /> protected override string FormatTestMerge( RepositorySettings repositorySettings, CompileJob compileJob, TestMerge testMerge, string remoteRepositoryOwner, string remoteRepositoryName, bool updated) => String.Format( CultureInfo.InvariantCulture, "#### Test Merge {4}{0}{0}##### Server Instance{0}{5}{1}{0}{0}##### Revision{0}Origin: {6}{0}Pull Request: {2}{0}Server: {7}{3}{8}", Environment.NewLine, repositorySettings.ShowTestMergeCommitters.Value ? String.Format( CultureInfo.InvariantCulture, "{0}{0}##### Merged By{0}{1}", Environment.NewLine, testMerge.MergedBy.Name) : String.Empty, testMerge.TargetCommitSha, testMerge.Comment != null ? String.Format( CultureInfo.InvariantCulture, "{0}{0}##### Comment{0}{1}", Environment.NewLine, testMerge.Comment) : String.Empty, updated ? "Updated" : "Deployed", Metadata.Name, compileJob.RevisionInformation.OriginCommitSha, compileJob.RevisionInformation.CommitSha, compileJob.GitHubDeploymentId.HasValue ? $"{Environment.NewLine}[GitHub Deployments](https://github.com/{remoteRepositoryOwner}/{remoteRepositoryName}/deployments/activity_log?environment=TGS%3A%20{Metadata.Name})" : String.Empty);