Class GitLabInboundMapper

java.lang.Object
io.agentscope.extensions.channel.gitlab.GitLabInboundMapper

public final class GitLabInboundMapper extends Object
Maps a GitLab Note Hook payload into an InboundMessage.

Only Issue and MergeRequest notes are mapped in MVP; Commit and Snippet notes are dropped. System notes (label changes, status changes) are skipped via object_attributes.system.

Peer model:

  • peerKind = PeerKind.THREAD
  • peerId = "<project.path_with_namespace>#<iid>:<noteable_type>" — the trailing :Issue|MergeRequest is essential for the outbound dispatcher to pick the correct endpoint.
  • Constructor Details

    • GitLabInboundMapper

      public GitLabInboundMapper(String channelId)
  • Method Details

    • extractNoteId

      public static Optional<Long> extractNoteId(com.fasterxml.jackson.databind.JsonNode payload)
      Returns the object_attributes.id used as the idempotency key.
    • extractAuthorId

      public static Optional<Long> extractAuthorId(com.fasterxml.jackson.databind.JsonNode payload)
      Returns the user.id used for bot-loop self-detection.
    • map

      public Optional<io.agentscope.harness.agent.gateway.channel.InboundMessage> map(com.fasterxml.jackson.databind.JsonNode payload)
      Maps a Note Hook payload into an InboundMessage. Returns empty for unsupported noteable types (Commit / Snippet), system notes, or malformed payloads.