Skip to content

Commit

Permalink
Restore mergecommitsha implementation for RemoveMergedTestMerges
Browse files Browse the repository at this point in the history
  • Loading branch information
Drulikar committed Feb 15, 2025
1 parent b943efd commit 994d165
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ query GetMergeRequest($project: ID!, $number: String!) {
description
title
diffHeadSha
mergeCommitSha
webUrl
iid
id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ query GetMergeRequests($project: ID!, $numbers: [String!]!) {
nodes {
state
diffHeadSha
mergeCommitSha
closedAt
iid
id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ async ValueTask CheckRemoveMR(IGetMergeRequests_Project_MergeRequests_Nodes? mer
if (mergeRequest.State != MergeRequestState.Merged)
return;

var diffHeadSha = mergeRequest.DiffHeadSha;
if (diffHeadSha == null)
var mergeCommitSha = mergeRequest.MergeCommitSha;
if (mergeCommitSha == null)
{
Logger.LogWarning("MergeRequest #{id} had no DiffHeadSha!", mergeRequest.Iid);
Logger.LogWarning("MergeRequest #{id} had no MergeCommitSha!", mergeRequest.Iid);
return;
}

Expand All @@ -116,7 +116,7 @@ async ValueTask CheckRemoveMR(IGetMergeRequests_Project_MergeRequests_Nodes? mer
}

// We don't just assume, actually check the repo contains the merge commit.
if (await repository.CommittishIsParent(diffHeadSha, cancellationToken))
if (await repository.CommittishIsParent(mergeCommitSha, cancellationToken))
newList.Remove(
newList.First(
potential => potential.Number == number));
Expand Down

0 comments on commit 994d165

Please sign in to comment.