Skip to content

Commit 37fa333

Browse files
CopilotMalcolmnixon
andcommitted
Add temporary debug output to diagnose CI PR detection issue
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
1 parent 1820ba1 commit 37fa333

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/DemaConsulting.BuildMark/RepoConnectors/GitHubRepoConnector.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ private async Task<bool> TagExistsAsync(string tag)
127127
/// <returns>List of pull request IDs.</returns>
128128
public override async Task<List<string>> GetPullRequestsBetweenTagsAsync(Version? from, Version? to)
129129
{
130+
// Temporary debug output
131+
Console.WriteLine($"[DEBUG] GetPullRequestsBetweenTagsAsync called with from={from?.Tag ?? "null"}, to={to?.Tag ?? "null"}");
132+
130133
// Build git log range based on provided versions
131134
string range;
132135
if (from == null && to == null)
@@ -169,6 +172,10 @@ public override async Task<List<string>> GetPullRequestsBetweenTagsAsync(Version
169172
.Split('\n', StringSplitOptions.RemoveEmptyEntries)
170173
.Select(hash => hash.Trim())
171174
.ToList();
175+
176+
// Temporary debug output to diagnose CI issues
177+
Console.WriteLine($"[DEBUG] Git range: {range}");
178+
Console.WriteLine($"[DEBUG] Found {commitHashes.Count} commits in range");
172179

173180
// Search GitHub API for PRs containing these commits
174181
// This approach is secure because the API only returns PRs that actually contain the commits,
@@ -190,15 +197,19 @@ public override async Task<List<string>> GetPullRequestsBetweenTagsAsync(Version
190197
foreach (var prNumber in prNumbers)
191198
{
192199
pullRequestsFromApi.Add(prNumber);
200+
Console.WriteLine($"[DEBUG] Commit {commitHash.Substring(0, 8)} -> PR #{prNumber}");
193201
}
194202
}
195-
catch (InvalidOperationException)
203+
catch (InvalidOperationException ex)
196204
{
197205
// If gh command fails for a specific commit, continue with others
198206
// This can happen if the commit isn't associated with any PR yet
207+
Console.WriteLine($"[DEBUG] No PRs found for commit {commitHash.Substring(0, 8)}: {ex.Message}");
199208
continue;
200209
}
201210
}
211+
212+
Console.WriteLine($"[DEBUG] Total unique PRs found: {pullRequestsFromApi.Count}");
202213

203214
return pullRequestsFromApi.ToList();
204215
}

0 commit comments

Comments
 (0)