Skip to content

feat: add IncidentClassificationRequestTopic constant#104

Merged
slashben merged 1 commit into
mainfrom
feat/add-incident-classification-topic
Apr 28, 2026
Merged

feat: add IncidentClassificationRequestTopic constant#104
slashben merged 1 commit into
mainfrom
feat/add-incident-classification-topic

Conversation

@slashben
Copy link
Copy Markdown
Contributor

@slashben slashben commented Apr 28, 2026

Adds IncidentClassificationRequestTopic constant for the incident AI classification Pulsar topic, used by cadashboardbe's reclassify-ai endpoint.

Summary by CodeRabbit

  • New Features
    • Added incident classification request messaging support to enable new system capabilities.

Signed-off-by: Ben <ben@armosec.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

📝 Walkthrough

Walkthrough

A new Pulsar topic constant IncidentClassificationRequestTopic with value "incident-classification-request-v1" is added to the common topics configuration file.

Changes

Cohort / File(s) Summary
Topic Configuration
pulsar/common/topics.go
Added new exported constant for incident classification request topic messaging channel.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested reviewers

  • YakirOren
  • BenMic5
  • matthyx

Poem

🐰 A whisker-twitch of joy today,
A constant finds its way,
New topics for the messages to flow,
Incident classifications steal the show! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add IncidentClassificationRequestTopic constant' directly and accurately describes the main change—adding a new constant for incident classification request topic messages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-incident-classification-topic

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pulsar/common/topics.go`:
- Around line 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).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 502b35e3-4414-4087-80ff-b43308b4ea91

📥 Commits

Reviewing files that changed from the base of the PR and between be189a0 and 504d3a3.

📒 Files selected for processing (1)
  • pulsar/common/topics.go

Comment thread pulsar/common/topics.go
Comment on lines +56 to 58
// incident classification topics
IncidentClassificationRequestTopic = "incident-classification-request-v1"
)
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).

@github-actions
Copy link
Copy Markdown

Summary:

  • License scan: failure
  • Credentials scan: skipped
  • Vulnerabilities scan: skipped
  • Unit test: success
  • Go linting: success

@slashben slashben merged commit 6594674 into main Apr 28, 2026
8 checks passed
@slashben slashben deleted the feat/add-incident-classification-topic branch April 28, 2026 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants