Skip to content

Slack plugin support #95

@ewega

Description

@ewega

Summary

Add Slack as a supported DevOps tool in the CLI. Slack is the dominant workplace messaging platform, and its DevLake plugin collects channel message data useful for measuring communication patterns, incident response coordination, and team collaboration metrics.

Upstream Plugin

slack in incubator-devlake/backend/plugins/slack/

Property Value
Plugin slug slack
Auth AccessToken (OAuth access token)
Scope type Channels (SlackChannel)
Scope ID field id
Default endpoint https://open.slack.cn/open-apis/
Remote-scope API Yes — lists and searches channels with cursor-based pagination
Connection test Yes

Dependencies

Blocked by:

Not blocked by #85 — Slack uses AccessToken, compatible with current auth model.

Changes

  • Add ConnectionDef for slack in connectionRegistry:
    • Endpoint: "https://open.slack.cn/open-apis/"
    • SupportsTest: true
    • TokenPrompt: "Slack Bot/User OAuth token"
    • EnvVarNames: []string{"SLACK_TOKEN", "SLACK_BOT_TOKEN"}
    • EnvFileKeys: []string{"SLACK_TOKEN", "SLACK_BOT_TOKEN"}
    • ScopeIDField: "id"
    • ScopeFunc: scopeSlackHandler
  • Implement scopeSlackHandler:
    • Use client.ListRemoteScopes("slack", connID, "", "") to list channels
    • Use client.SearchRemoteScopes("slack", connID, search, ...) for search
    • Let user select channels interactively
    • PUT selected channels as scopes
  • Set Available: true

Acceptance Criteria

  • gh devlake configure connection add --plugin slack creates a Slack connection
  • Slack appears in interactive plugin picker
  • Slack scopes list channels for selection
  • Connection test works
  • go build ./..., go test ./..., go vet ./... pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions