@@ -68,8 +68,10 @@ void reportStatus(Commands commands, Inputs inputs, Context context) throws IOEx
6868 commands .notice (String .format ("The issue is currently %s" , issue .getState ().toString ()));
6969 }
7070
71+ String quarkusSha = inputs .get (InputKeys .QUARKUS_SHA ).orElse (null );
72+ String projectSha = inputs .get (InputKeys .PROJECT_SHA ).orElse (null );
7173 Status existingStatus = extractStatus (issue .getBody ());
72- State newState = new State (Instant .now (), context . getGitHubSha (), inputs . get ( InputKeys . QUARKUS_SHA ). orElse ( null ) );
74+ State newState = new State (Instant .now (), quarkusSha , projectSha );
7375
7476 final State firstFailure ;
7577 final State lastFailure ;
@@ -100,7 +102,8 @@ void reportStatus(Commands commands, Inputs inputs, Context context) throws IOEx
100102 commands .notice (String .format ("Comment added on issue %s - %s" , issue .getHtmlUrl ().toString (),
101103 comment .getHtmlUrl ().toString ()));
102104
103- firstFailure = State .KEEP_EXISTING ;
105+ // for old reports, we won't have the first failure previously set so let's set it to the new state as an approximation
106+ firstFailure = existingStatus .firstFailure () != null ? State .KEEP_EXISTING : newState ;
104107 } else {
105108 issue .reopen ();
106109 final GHIssueComment comment = issue .comment (String .format (
@@ -115,12 +118,12 @@ void reportStatus(Commands commands, Inputs inputs, Context context) throws IOEx
115118
116119 Status newStatus ;
117120 if (existingStatus != null ) {
118- newStatus = new Status (Instant .now (), !succeed , repositoryName , runId ,
121+ newStatus = new Status (Instant .now (), !succeed , repositoryName , runId , quarkusSha , projectSha ,
119122 firstFailure == State .KEEP_EXISTING ? existingStatus .firstFailure () : firstFailure ,
120123 lastFailure == State .KEEP_EXISTING ? existingStatus .lastFailure () : lastFailure ,
121124 lastSuccess == State .KEEP_EXISTING ? existingStatus .lastSuccess () : lastSuccess );
122125 } else {
123- newStatus = new Status (Instant .now (), !succeed , repositoryName , runId ,
126+ newStatus = new Status (Instant .now (), !succeed , repositoryName , runId , quarkusSha , projectSha ,
124127 firstFailure , lastFailure , lastSuccess );
125128 }
126129
@@ -164,7 +167,7 @@ public Status extractStatus(String body) {
164167 }
165168
166169 public record Status (Instant updatedAt , boolean failure , String repository , Long runId ,
167- State firstFailure , State lastFailure , State lastSuccess ) {
170+ String quarkusSha , String projectSha , State firstFailure , State lastFailure , State lastSuccess ) {
168171 }
169172
170173 public record State (Instant date , String quarkusSha , String projectSha ) {
0 commit comments