diff --git a/src/DMAPI/tgs.dm b/src/DMAPI/tgs.dm index 3f70916664..3225f14d8c 100644 --- a/src/DMAPI/tgs.dm +++ b/src/DMAPI/tgs.dm @@ -67,7 +67,7 @@ #define TGS_EVENT_REPO_CHECKOUT 1 /// When the repository performs a fetch operation. No parameters #define TGS_EVENT_REPO_FETCH 2 -/// When the repository merges a pull request. Parameters: PR Number, PR Sha, (Nullable) Comment made by TGS user +/// When the repository test merges. Parameters: PR Number, PR Sha, (Nullable) Comment made by TGS user #define TGS_EVENT_REPO_MERGE_PULL_REQUEST 3 /// Before the repository makes a sychronize operation. Parameters: Absolute repostiory path #define TGS_EVENT_REPO_PRE_SYNCHRONIZE 4 @@ -190,21 +190,21 @@ /// Represents a merge of a GitHub pull request. /datum/tgs_revision_information/test_merge - /// The pull request number. + /// The test merge number. var/number - /// The pull request title when it was merged. + /// The test merge source's title when it was merged. var/title - /// The pull request body when it was merged. + /// The test merge source's body when it was merged. var/body - /// The GitHub username of the pull request's author. + /// The Username of the test merge source's author. var/author - /// An http URL to the pull request. + /// An http URL to the test merge source. var/url - /// The SHA of the pull request when that was merged. + /// The SHA of the test merge when that was merged. var/pull_request_commit - /// ISO 8601 timestamp of when the pull request was merged. + /// ISO 8601 timestamp of when the test merge was created on TGS. var/time_merged - /// (Nullable) Comment left by the TGS user who initiated the merge.. + /// Optional comment left by the TGS user who initiated the merge. var/comment /// Represents a connected chat channel. diff --git a/src/Tgstation.Server.Api/Models/ErrorCode.cs b/src/Tgstation.Server.Api/Models/ErrorCode.cs index c372458735..cb9a77a786 100644 --- a/src/Tgstation.Server.Api/Models/ErrorCode.cs +++ b/src/Tgstation.Server.Api/Models/ErrorCode.cs @@ -234,7 +234,7 @@ namespace Tgstation.Server.Api.Models /// /// contained duplicate s. /// - [Description("The same pull request was present more than once in the test merge requests or is already merged!")] + [Description("The same test merge was present more than once or is already merged!")] RepoDuplicateTestMerge, /// @@ -460,7 +460,7 @@ namespace Tgstation.Server.Api.Models /// /// Encounted merge conflicts while test merging. /// - [Description("Encountered merge conflicts while test merging one or more pull requests!")] + [Description("Encountered merge conflicts while test merging one or more sources!")] RepoTestMergeConflict, /// diff --git a/src/Tgstation.Server.Api/Models/Internal/TestMerge.cs b/src/Tgstation.Server.Api/Models/Internal/TestMerge.cs index 6189c0327c..76ee553023 100644 --- a/src/Tgstation.Server.Api/Models/Internal/TestMerge.cs +++ b/src/Tgstation.Server.Api/Models/Internal/TestMerge.cs @@ -1,10 +1,10 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; namespace Tgstation.Server.Api.Models.Internal { /// - /// Represents a merge of a GitHub pull request + /// Represents a test merge of a remote "pull request". /// public class TestMerge : TestMergeBase { diff --git a/src/Tgstation.Server.Api/Models/Internal/TestMergeBase.cs b/src/Tgstation.Server.Api/Models/Internal/TestMergeBase.cs index d8cc971b5b..c8b87ee4d2 100644 --- a/src/Tgstation.Server.Api/Models/Internal/TestMergeBase.cs +++ b/src/Tgstation.Server.Api/Models/Internal/TestMergeBase.cs @@ -9,19 +9,19 @@ namespace Tgstation.Server.Api.Models.Internal public abstract class TestMergeBase : TestMergeParameters { /// - /// The title of the pull request + /// The title of the test merge source. /// [Required] public string? TitleAtMerge { get; set; } /// - /// The body of the pull request + /// The body of the test merge source. /// [Required] public string? BodyAtMerge { get; set; } /// - /// The URL of the pull request + /// The URL of the test merge source. /// [Required] #pragma warning disable CA1056 // Uri properties should not be strings @@ -29,7 +29,7 @@ namespace Tgstation.Server.Api.Models.Internal #pragma warning restore CA1056 // Uri properties should not be strings /// - /// The author of the pull request + /// The author of the test merge source. /// [Required] public string? Author { get; set; } diff --git a/src/Tgstation.Server.Api/Models/TestMergeParameters.cs b/src/Tgstation.Server.Api/Models/TestMergeParameters.cs index 0697522f6f..fbac15c974 100644 --- a/src/Tgstation.Server.Api/Models/TestMergeParameters.cs +++ b/src/Tgstation.Server.Api/Models/TestMergeParameters.cs @@ -8,7 +8,7 @@ namespace Tgstation.Server.Api.Models public class TestMergeParameters { /// - /// The number of the pull request + /// The number of the test merge source. /// public int Number { get; set; } @@ -17,7 +17,7 @@ namespace Tgstation.Server.Api.Models /// [Required] [StringLength(40)] - public string? TargetCommitSha { get; set; } + public virtual string? TargetCommitSha { get; set; } /// /// Optional comment about the test diff --git a/src/Tgstation.Server.Api/Rights/RepositoryRights.cs b/src/Tgstation.Server.Api/Rights/RepositoryRights.cs index 3b3e79578f..a65ca17e0a 100644 --- a/src/Tgstation.Server.Api/Rights/RepositoryRights.cs +++ b/src/Tgstation.Server.Api/Rights/RepositoryRights.cs @@ -29,7 +29,7 @@ namespace Tgstation.Server.Api.Rights SetSha = 4, /// - /// User may fetch and merge GitHub pull requests. + /// User may create s. /// MergePullRequest = 8, diff --git a/src/Tgstation.Server.Host/Components/Chat/Commands/PullRequestsCommand.cs b/src/Tgstation.Server.Host/Components/Chat/Commands/PullRequestsCommand.cs index 56cce4cc1e..617a67f6ac 100644 --- a/src/Tgstation.Server.Host/Components/Chat/Commands/PullRequestsCommand.cs +++ b/src/Tgstation.Server.Host/Components/Chat/Commands/PullRequestsCommand.cs @@ -21,7 +21,7 @@ namespace Tgstation.Server.Host.Components.Chat.Commands public string Name => "prs"; /// - public string HelpText => "Display live test merge pull request numbers. Add --repo to view repository test merges"; + public string HelpText => "Display live test merge numbers. Add --repo to view test merges in the repository as opposed to live."; /// public bool AdminOnly => false; diff --git a/src/Tgstation.Server.Host/Components/Events/EventType.cs b/src/Tgstation.Server.Host/Components/Events/EventType.cs index 9b648382c9..9085c6e215 100644 --- a/src/Tgstation.Server.Host/Components/Events/EventType.cs +++ b/src/Tgstation.Server.Host/Components/Events/EventType.cs @@ -1,4 +1,4 @@ -namespace Tgstation.Server.Host.Components.Events +namespace Tgstation.Server.Host.Components.Events { /// /// Types of events. Mirror in tgs.dm @@ -24,10 +24,10 @@ RepoFetch, /// - /// Parameters: Pull request number, pull request sha, merger message + /// Parameters: Test merge number, test merge target sha, merger message /// [EventScript("RepoMergePullRequest")] - RepoMergePullRequest, + RepoAddTestMerge, /// /// Parameters: Absolute path to repository root diff --git a/src/Tgstation.Server.Host/Components/Interop/Bridge/TestMergeInformation.cs b/src/Tgstation.Server.Host/Components/Interop/Bridge/TestMergeInformation.cs index 314a6d5ed3..d3dc664503 100644 --- a/src/Tgstation.Server.Host/Components/Interop/Bridge/TestMergeInformation.cs +++ b/src/Tgstation.Server.Host/Components/Interop/Bridge/TestMergeInformation.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using Tgstation.Server.Api.Models.Internal; @@ -14,6 +14,18 @@ namespace Tgstation.Server.Host.Components.Interop.Bridge /// public string TimeMerged { get; set; } + /// + /// Backing field for needed to continue to support DMAPI 5. + /// + public string PullRequestRevision { get; set; } + + /// + public override string TargetCommitSha + { + get => PullRequestRevision; + set => PullRequestRevision = value; + } + /// /// The of the /// diff --git a/src/Tgstation.Server.Host/Components/Repository/IGitRemoteFeatures.cs b/src/Tgstation.Server.Host/Components/Repository/IGitRemoteFeatures.cs index 7dc7502ba7..d91dca020d 100644 --- a/src/Tgstation.Server.Host/Components/Repository/IGitRemoteFeatures.cs +++ b/src/Tgstation.Server.Host/Components/Repository/IGitRemoteFeatures.cs @@ -6,7 +6,7 @@ namespace Tgstation.Server.Host.Components.Repository interface IGitRemoteFeatures : IGitRemoteAdditionalInformation { /// - /// Gets a formatter string which creates the remote refspec for fetching the HEAD of passed in pull request number. + /// Gets a formatter string which creates the remote refspec for fetching the HEAD of passed in test merge number. /// string TestMergeRefSpecFormatter { get; } diff --git a/src/Tgstation.Server.Host/Components/Repository/IRepository.cs b/src/Tgstation.Server.Host/Components/Repository/IRepository.cs index 84dc366a55..e2caa16611 100644 --- a/src/Tgstation.Server.Host/Components/Repository/IRepository.cs +++ b/src/Tgstation.Server.Host/Components/Repository/IRepository.cs @@ -48,7 +48,7 @@ namespace Tgstation.Server.Host.Components.Repository Task CheckoutObject(string committish, Action progressReporter, CancellationToken cancellationToken); /// - /// Attempt to merge a GitHub pull request into HEAD + /// Attempt to merge the revision specified by a given set of into HEAD /// /// The of the pull request /// The name of the merge committer diff --git a/src/Tgstation.Server.Host/Components/Repository/Repository.cs b/src/Tgstation.Server.Host/Components/Repository/Repository.cs index e5f14215c1..e04c113935 100644 --- a/src/Tgstation.Server.Host/Components/Repository/Repository.cs +++ b/src/Tgstation.Server.Host/Components/Repository/Repository.cs @@ -275,7 +275,7 @@ namespace Tgstation.Server.Host.Components.Repository var commitMessage = String.Format( CultureInfo.InvariantCulture, - "Test merge of pull request #{0}{1}{2}", + "TGS Test merge #{0}{1}{2}", testMergeParameters.Number, testMergeParameters.Comment != null ? Environment.NewLine @@ -390,7 +390,7 @@ namespace Tgstation.Server.Host.Components.Repository } await eventConsumer.HandleEvent( - EventType.RepoMergePullRequest, + EventType.RepoAddTestMerge, new List { testMergeParameters.Number.ToString(CultureInfo.InvariantCulture),