Skip to content

Hardcoded "TODO" subject in CloudEvents NATS driver #6250

@Amit-Matth

Description

@Amit-Matth

Describe the issue

Summary

In the NATS eventing driver (internal/events/nats/natschannel.go), the subject field for outgoing CloudEvents is currently hardcoded to the literal string "TODO". This field should instead uniquely identify the specific entity (such as a repository, project, or artifact) that the event is about.

Impact

  • Event Filtering: NATS JetStream relies on subjects for efficient event routing and filtering. Hardcoding the subject to "TODO" makes it impossible for consumers to efficiently filter events.
  • Spec Compliance: It violates the CloudEvents specification, which expects the subject to refer to a specific resource.

To Reproduce

  1. Open the file internal/events/nats/natschannel.go.
  2. Locate the sendEvent function (around line 203).
  3. Observe line 209: event.SetSubject("TODO").
  4. Note the developer comment: // This *should* represent the entity, but we don't have a standard field for it yet.

What version are you using?

Latest main branch (v0.1.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions