From cc66a1ca714c7166a0d6f6155214ea93b0727e5c Mon Sep 17 00:00:00 2001 From: Carlos Garcia Lalicata Date: Fri, 5 Apr 2024 07:43:15 +0200 Subject: [PATCH] [gh-flow] If Item.Message is null it tries to post empty messages (#42) --- .../src/Microsoft.AI.DevTeam/Agents/Hubber.cs | 2 +- .../Services/GithubService.cs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Hubber.cs b/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Hubber.cs index 4a9dfe253..cfe30aeb5 100644 --- a/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Hubber.cs +++ b/samples/gh-flow/src/Microsoft.AI.DevTeam/Agents/Hubber.cs @@ -34,7 +34,7 @@ public class Hubber : Agent case nameof(GithubFlowEventType.DevPlanGenerated): case nameof(GithubFlowEventType.CodeGenerated): var contents = string.IsNullOrEmpty(item.Message)? "Sorry, I got tired, can you try again please? ": item.Message; - await PostComment(item.Data["org"], item.Data["repo"], long.Parse(item.Data["issueNumber"]), item.Message); + await PostComment(item.Data["org"], item.Data["repo"], long.Parse(item.Data["issueNumber"]), contents); break; case nameof(GithubFlowEventType.DevPlanCreated): { diff --git a/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/GithubService.cs b/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/GithubService.cs index 745a822ec..6c50c2938 100644 --- a/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/GithubService.cs +++ b/samples/gh-flow/src/Microsoft.AI.DevTeam/Services/GithubService.cs @@ -71,7 +71,7 @@ public class GithubService : IManageGithub catch (Exception ex) { _logger.LogError(ex, "Error committing to branch"); - throw; + throw; } } @@ -85,7 +85,7 @@ public class GithubService : IManageGithub catch (Exception ex) { _logger.LogError(ex, "Error creating branch"); - throw; + throw; } } @@ -100,7 +100,7 @@ public class GithubService : IManageGithub catch (Exception ex) { _logger.LogError(ex, "Error getting main language"); - throw; + throw; } } @@ -120,7 +120,7 @@ public class GithubService : IManageGithub catch (Exception ex) { _logger.LogError(ex, "Error creating issue"); - throw; + throw; } } @@ -134,7 +134,7 @@ public class GithubService : IManageGithub catch (Exception ex) { _logger.LogError(ex, "Error creating PR"); - throw; + throw; } } @@ -147,7 +147,7 @@ public class GithubService : IManageGithub catch (Exception ex) { _logger.LogError(ex, "Error posting comment"); - throw; + throw; } } @@ -161,7 +161,7 @@ public class GithubService : IManageGithub catch (Exception ex) { _logger.LogError(ex, "Error getting files"); - throw; + throw; } } @@ -192,7 +192,7 @@ public class GithubService : IManageGithub catch (Exception ex) { _logger.LogError(ex, "Error collecting files"); - throw; + throw; } } }