Skip to content

Commit 7258ff8

Browse files
chore: remove InventoryID from AdvisoryUpdateEvent
This field is no longer required as part of the AdvisoryUpdateEvent structure. Updated tests accordingly. Added a TODO for future system context changes in notifications.
1 parent e91c723 commit 7258ff8

3 files changed

Lines changed: 4 additions & 7 deletions

File tree

base/mqueue/advisory_update_event.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
type AdvisoryUpdateEvent struct {
1313
RhAccountID int `json:"rh_account_id"`
1414
WorkspaceID uuid.UUID `json:"workspace_id"`
15-
InventoryID uuid.UUID `json:"inventory_id"`
1615
AdvisoryIDs []int64 `json:"advisory_ids"`
1716
ProducedAt types.Rfc3339Timestamp `json:"produced_at"`
1817
}

base/mqueue/advisory_update_event_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ func TestAdvisoryUpdateEventMarshal(t *testing.T) {
2020
event := AdvisoryUpdateEvent{
2121
RhAccountID: 1,
2222
WorkspaceID: testWorkspaceID,
23-
InventoryID: uuid.New(),
2423
AdvisoryIDs: []int64{101, 202, 303},
2524
ProducedAt: testNow,
2625
}
@@ -33,7 +32,6 @@ func TestAdvisoryUpdateEventMarshal(t *testing.T) {
3332
assert.NoError(t, err)
3433
assert.Equal(t, event.RhAccountID, parsed.RhAccountID)
3534
assert.Equal(t, event.WorkspaceID, parsed.WorkspaceID)
36-
assert.Equal(t, event.InventoryID, parsed.InventoryID)
3735
assert.Equal(t, event.AdvisoryIDs, parsed.AdvisoryIDs)
3836
assert.NotNil(t, parsed.ProducedAt)
3937
}
@@ -45,14 +43,12 @@ func TestAdvisoryUpdateEventsWriteEvents(t *testing.T) {
4543
{
4644
RhAccountID: 1,
4745
WorkspaceID: testWorkspaceID,
48-
InventoryID: uuid.New(),
4946
AdvisoryIDs: []int64{100, 200},
5047
ProducedAt: testNow,
5148
},
5249
{
5350
RhAccountID: 2,
5451
WorkspaceID: testWorkspaceID,
55-
InventoryID: uuid.New(),
5652
AdvisoryIDs: []int64{300},
5753
ProducedAt: testNow,
5854
},
@@ -69,7 +65,6 @@ func TestAdvisoryUpdateEventsWriteEvents(t *testing.T) {
6965
assert.NoError(t, err)
7066
assert.Equal(t, events[0].RhAccountID, firstEvent.RhAccountID)
7167
assert.Equal(t, events[0].WorkspaceID, firstEvent.WorkspaceID)
72-
assert.Equal(t, events[0].InventoryID, firstEvent.InventoryID)
7368
assert.Equal(t, events[0].AdvisoryIDs, firstEvent.AdvisoryIDs)
7469
assert.NotNil(t, firstEvent.ProducedAt)
7570

@@ -78,7 +73,6 @@ func TestAdvisoryUpdateEventsWriteEvents(t *testing.T) {
7873
assert.NoError(t, err)
7974
assert.Equal(t, events[1].RhAccountID, secondEvent.RhAccountID)
8075
assert.Equal(t, events[1].WorkspaceID, secondEvent.WorkspaceID)
81-
assert.Equal(t, events[1].InventoryID, secondEvent.InventoryID)
8276
assert.Equal(t, events[1].AdvisoryIDs, secondEvent.AdvisoryIDs)
8377
assert.NotNil(t, secondEvent.ProducedAt)
8478
}

base/notification/notification.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ const (
1515
Application = "patch"
1616
)
1717

18+
// TODO: Remove Context after migrating to the new aggregator component
19+
// Advisories apply to multiple systems, so for aggregated notifications, system-specific context is unnecessary
20+
// See: https://redhat.atlassian.net/browse/RHINENG-26543
21+
1822
type Context struct {
1923
InventoryID string `json:"inventory_id"`
2024
DisplayName string `json:"display_name"`

0 commit comments

Comments
 (0)