Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pulsar/common/topics.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,7 @@ const (

// scan failure topic
ScanFailureTopic = "scan-failure-v1"

// incident classification topics
IncidentClassificationRequestTopic = "incident-classification-request-v1"
)
Comment on lines +56 to 58
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find all usages of the new constant
rg -n --hidden --glob '!**/vendor/**' 'IncidentClassificationRequestTopic' .

# Also sanity-check for the raw topic string to catch any hard-coded mismatches
rg -n --hidden --glob '!**/vendor/**' 'incident-classification-request-v1' .

Repository: kubescape/messaging

Length of output: 271


🏁 Script executed:

# Check the recent changes around this constant and look for any producer/consumer implementation
cd pulsar/common && head -n 80 topics.go | tail -n 40

# Also check if there are any recent changes in producer/consumer files
fd -t f -e go | grep -i -E '(producer|consumer|classifier)' | head -20

Repository: kubescape/messaging

Length of output: 1487


🏁 Script executed:

# Search for any files that might contain producer/consumer logic
fd -t f -e go | xargs rg -l 'incident|classify' --max-count=5

# Check if there are any references to incident classification in other ways
rg -n 'incident.*classif|classif.*incident' --ignore-case

Repository: kubescape/messaging

Length of output: 323


🏁 Script executed:

# Check the files that mention incident/classify for any integration wiring
rg -A 5 -B 5 'incident.*classif|classif.*incident' --ignore-case -t go pulsar/common/userinput/commands.go pulsar/common/kdr/datastructures.go

# Also check if the constant is used anywhere via string matching on producer/consumer patterns
rg -n 'NewProducer|NewConsumer|Subscribe|Produce' -t go | grep -i -E '(incident|classif)' || echo "No matches found"

# Look for any recent code that constructs topics similar to how this constant should be used
rg -n 'BuildPersistentTopic|BuildTopic' -t go | head -20

Repository: kubescape/messaging

Length of output: 1104


🏁 Script executed:

# Let's examine the files that mention incident/classify to understand context
cat -n pulsar/common/userinput/commands.go | grep -A 10 -B 5 -i 'incident\|classif'

# Check kdr/datastructures.go as well
cat -n pulsar/common/kdr/datastructures.go | grep -A 10 -B 5 -i 'incident\|classif'

Repository: kubescape/messaging

Length of output: 4644


Integration wiring for IncidentClassificationRequestTopic is not yet implemented in the codebase.

The constant is defined in pulsar/common/topics.go:57, but no producer or consumer implementations exist. Ensure producer and consumer code are added with proper topic construction using BuildPersistentTopic(...) before deploying this constant.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pulsar/common/topics.go` around lines 56 - 58, The new constant
IncidentClassificationRequestTopic is defined but never wired into messaging;
add a producer and a consumer that use BuildPersistentTopic(...) with
IncidentClassificationRequestTopic to construct the full topic name, implement a
producer (e.g., in the existing producer factory or Pulsar producer registration
code) that publishes classification requests to
BuildPersistentTopic(IncidentClassificationRequestTopic), and implement a
consumer (e.g., in the subscriber/consumer setup code) that subscribes to
BuildPersistentTopic(IncidentClassificationRequestTopic) and routes received
messages to the existing incident classification handler; ensure the
producer/consumer follow the same configuration, error handling, and metrics
conventions used by other topics in the codebase (reuse existing
producer/consumer setup helpers).

Loading