Skip to content

Commit e54a55b

Browse files
authored
fix: Included topic.name as it is required for creating a topic entity. (#338)
https://source.datanerd.us/meatballs/backend/blob/f6fe147e6d1be5d12c71976f9b6fdaa34885838e/shared/inventory/metadata.go#L325C37-L325C47 <img width="1712" alt="Screenshot 2025-06-17 at 3 02 46 PM" src="https://github.com/user-attachments/assets/cb5f8c2d-9f66-441c-9bb0-7a45d4221241" /> <img width="1305" alt="Screenshot 2025-06-17 at 4 49 58 PM" src="https://github.com/user-attachments/assets/555c7fbf-a199-4776-bf80-5e299b18e0f2" />
1 parent 3f40909 commit e54a55b

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## Unreleased
99

10+
### enhancements
11+
- Included topic.name as it is required for creating a topic entity
12+
1013
## v3.11.0 - 2025-04-23
1114

1215
### ⛓️ Dependencies

src/topic/topic_collection.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,11 @@ func populateTopicInventory(t *Topic) []error {
261261
errors = append(errors, err)
262262
}
263263

264+
var topicKey, _ = t.Entity.Metadata.Key()
265+
if err := t.Entity.SetInventoryItem("topic.name", "value", topicKey.String()); err != nil {
266+
errors = append(errors, err)
267+
}
268+
264269
// Add topic configs to inventory
265270
for _, config := range t.Configs {
266271
if err := t.Entity.SetInventoryItem("topic."+config.Name, "value", config.Value); err != nil {

src/topic/topic_collection_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ func TestPopulateTopicInventory(t *testing.T) {
115115

116116
i, _ := integration.New("kafka", "1.0.0")
117117
e, _ := i.Entity("testtopic", "topic")
118+
var key, _ = e.Metadata.Key()
118119

119120
myTopic := &Topic{
120121
Entity: e,
@@ -137,6 +138,9 @@ func TestPopulateTopicInventory(t *testing.T) {
137138
"topic.flush.messages": {
138139
"value": "12345",
139140
},
141+
"topic.name": {
142+
"value": key.String(),
143+
},
140144
}
141145

142146
errors := populateTopicInventory(myTopic)

0 commit comments

Comments
 (0)