2929 FlakyTestAttributes .JSON_PROPERTY_FIRST_FLAKED_TS ,
3030 FlakyTestAttributes .JSON_PROPERTY_FLAKY_CATEGORY ,
3131 FlakyTestAttributes .JSON_PROPERTY_FLAKY_STATE ,
32+ FlakyTestAttributes .JSON_PROPERTY_HISTORY ,
3233 FlakyTestAttributes .JSON_PROPERTY_LAST_FLAKED_BRANCH ,
3334 FlakyTestAttributes .JSON_PROPERTY_LAST_FLAKED_SHA ,
3435 FlakyTestAttributes .JSON_PROPERTY_LAST_FLAKED_TS ,
@@ -68,6 +69,9 @@ public class FlakyTestAttributes {
6869 public static final String JSON_PROPERTY_FLAKY_STATE = "flaky_state" ;
6970 private FlakyTestAttributesFlakyState flakyState ;
7071
72+ public static final String JSON_PROPERTY_HISTORY = "history" ;
73+ private List <FlakyTestHistory > history = null ;
74+
7175 public static final String JSON_PROPERTY_LAST_FLAKED_BRANCH = "last_flaked_branch" ;
7276 private String lastFlakedBranch ;
7377
@@ -302,6 +306,41 @@ public void setFlakyState(FlakyTestAttributesFlakyState flakyState) {
302306 this .flakyState = flakyState ;
303307 }
304308
309+ public FlakyTestAttributes history (List <FlakyTestHistory > history ) {
310+ this .history = history ;
311+ for (FlakyTestHistory item : history ) {
312+ this .unparsed |= item .unparsed ;
313+ }
314+ return this ;
315+ }
316+
317+ public FlakyTestAttributes addHistoryItem (FlakyTestHistory historyItem ) {
318+ if (this .history == null ) {
319+ this .history = new ArrayList <>();
320+ }
321+ this .history .add (historyItem );
322+ this .unparsed |= historyItem .unparsed ;
323+ return this ;
324+ }
325+
326+ /**
327+ * Chronological history of status changes for this flaky test, ordered from most recent to
328+ * oldest. Includes state transitions like new -> quarantined -> fixed, along with the
329+ * associated commit SHA when available.
330+ *
331+ * @return history
332+ */
333+ @ jakarta .annotation .Nullable
334+ @ JsonProperty (JSON_PROPERTY_HISTORY )
335+ @ JsonInclude (value = JsonInclude .Include .USE_DEFAULTS )
336+ public List <FlakyTestHistory > getHistory () {
337+ return history ;
338+ }
339+
340+ public void setHistory (List <FlakyTestHistory > history ) {
341+ this .history = history ;
342+ }
343+
305344 public FlakyTestAttributes lastFlakedBranch (String lastFlakedBranch ) {
306345 this .lastFlakedBranch = lastFlakedBranch ;
307346 return this ;
@@ -611,6 +650,7 @@ public boolean equals(Object o) {
611650 && Objects .equals (this .firstFlakedTs , flakyTestAttributes .firstFlakedTs )
612651 && Objects .equals (this .flakyCategory , flakyTestAttributes .flakyCategory )
613652 && Objects .equals (this .flakyState , flakyTestAttributes .flakyState )
653+ && Objects .equals (this .history , flakyTestAttributes .history )
614654 && Objects .equals (this .lastFlakedBranch , flakyTestAttributes .lastFlakedBranch )
615655 && Objects .equals (this .lastFlakedSha , flakyTestAttributes .lastFlakedSha )
616656 && Objects .equals (this .lastFlakedTs , flakyTestAttributes .lastFlakedTs )
@@ -635,6 +675,7 @@ public int hashCode() {
635675 firstFlakedTs ,
636676 flakyCategory ,
637677 flakyState ,
678+ history ,
638679 lastFlakedBranch ,
639680 lastFlakedSha ,
640681 lastFlakedTs ,
@@ -660,6 +701,7 @@ public String toString() {
660701 sb .append (" firstFlakedTs: " ).append (toIndentedString (firstFlakedTs )).append ("\n " );
661702 sb .append (" flakyCategory: " ).append (toIndentedString (flakyCategory )).append ("\n " );
662703 sb .append (" flakyState: " ).append (toIndentedString (flakyState )).append ("\n " );
704+ sb .append (" history: " ).append (toIndentedString (history )).append ("\n " );
663705 sb .append (" lastFlakedBranch: " ).append (toIndentedString (lastFlakedBranch )).append ("\n " );
664706 sb .append (" lastFlakedSha: " ).append (toIndentedString (lastFlakedSha )).append ("\n " );
665707 sb .append (" lastFlakedTs: " ).append (toIndentedString (lastFlakedTs )).append ("\n " );
0 commit comments