fix folder missing in the event key (#112698)

This commit is contained in:
Georges Chaudy
2025-10-21 10:40:56 +00:00
committed by GitHub
parent a107e7db6b
commit 7be30abab0
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -142,7 +142,7 @@ func (n *eventStore) Save(ctx context.Context, event Event) error {
Name: event.Name,
ResourceVersion: event.ResourceVersion,
Action: event.Action,
//TODO why isnt folder part of the key?
Folder: event.Folder,
}
if err := eventKey.Validate(); err != nil {
@@ -206,6 +206,7 @@ func TestEventStore_Save_Get(t *testing.T) {
Name: event.Name,
ResourceVersion: event.ResourceVersion,
Action: event.Action,
Folder: event.Folder,
}
retrievedEvent, err := store.Get(ctx, eventKey)
@@ -518,6 +519,7 @@ func TestEventStore_CleanupOldEvents(t *testing.T) {
Name: oldEvent.Name,
ResourceVersion: oldEvent.ResourceVersion,
Action: oldEvent.Action,
Folder: oldEvent.Folder,
})
require.NoError(t, err)
@@ -528,6 +530,7 @@ func TestEventStore_CleanupOldEvents(t *testing.T) {
Name: recentEvent.Name,
ResourceVersion: recentEvent.ResourceVersion,
Action: recentEvent.Action,
Folder: recentEvent.Folder,
})
require.NoError(t, err)
@@ -555,6 +558,7 @@ func TestEventStore_CleanupOldEvents(t *testing.T) {
Name: recentEvent.Name,
ResourceVersion: recentEvent.ResourceVersion,
Action: recentEvent.Action,
Folder: recentEvent.Folder,
})
require.NoError(t, err, "Recent event should still exist")
}
@@ -592,6 +596,7 @@ func TestEventStore_CleanupOldEvents_NoOldEvents(t *testing.T) {
Name: event.Name,
ResourceVersion: event.ResourceVersion,
Action: event.Action,
Folder: event.Folder,
})
require.NoError(t, err, "Recent event should still exist")
}