Add inline action button sample with mm_blocks_actions - #211
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds the ChangesInline Action Integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: ⚪ Minimal · up to This PR adds an inline action example and triage dialog flow; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant User
participant Mattermost
participant PluginCommand
participant MattermostAPI
User->>PluginCommand: Run /demo_plugin inline_action
PluginCommand->>MattermostAPI: Create post with triage action
MattermostAPI-->>Mattermost: Render issue table and action
User->>Mattermost: Click triage action
Mattermost->>MattermostAPI: Send PostActionIntegrationRequest
MattermostAPI->>PluginCommand: Invoke /inline_action/triage
PluginCommand->>MattermostAPI: Open triage dialog
MattermostAPI-->>User: Display triage dialog
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@server/http_hooks.go`:
- Around line 517-525: The intro always prefixes assignee with '@', producing
"`@unassigned`"; change to build a display value that only prepends '@' for real
assignees. Create a local assigneeDisplay (or similar) based on assignee (e.g.,
if assignee == "unassigned" or empty then assigneeDisplay = "unassigned" else
assigneeDisplay = "@"+assignee) and use that in the fmt.Sprintf that builds
intro (referencing assignee, assigneeDisplay, and the existing fmt.Sprintf call
that builds intro using issueID, project, title, priority).
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e4cd24d6-f7ce-4326-be60-a3c0f70bf03a
📒 Files selected for processing (2)
server/command_hooks.goserver/http_hooks.go
Per coderabbit review Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Add MCP demo tools Expose demo MCP tools through the Agents plugin helper so cross-plugin MCP registration can be exercised from this plugin. Co-authored-by: Cursor <cursoragent@cursor.com> * Update server/mcp_tools_test.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update MCP demo for pluginmcp helper Co-authored-by: Cursor <cursoragent@cursor.com> * Synchronize MCP server initialization Co-authored-by: Cursor <cursoragent@cursor.com> * Address MCP review feedback Co-authored-by: Cursor <cursoragent@cursor.com> * Remove MCP lifecycle test seams Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
server/activate_hooks.go (1)
88-92: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueTear down resources in reverse order of activation.
In
OnActivate, the core plugin is activated first, followed by the MCP server registration. To ensure clean teardown and avoid potential dependencies on core services during unregistration, it's a best practice to unregister the MCP server before deactivating the core plugin.♻️ Proposed refactor to reverse teardown order
func (p *Plugin) OnDeactivate() error { - err := p.onDeactivateCore() p.unregisterMCPServerBestEffort() - return err + return p.onDeactivateCore() }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@server/activate_hooks.go` around lines 88 - 92, Update Plugin.OnDeactivate to call unregisterMCPServerBestEffort before p.onDeactivateCore, preserving the existing error return from the core deactivation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@server/activate_hooks.go`:
- Around line 88-92: Update Plugin.OnDeactivate to call
unregisterMCPServerBestEffort before p.onDeactivateCore, preserving the existing
error return from the core deactivation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0518ec82-f343-4b24-9c64-1c09a965b3b0
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (8)
go.modserver/activate_hooks.goserver/http_hooks.goserver/http_hooks_test.goserver/mcp.goserver/mcp_tools.goserver/mcp_tools_test.goserver/plugin.go
🚧 Files skipped from review as they are similar to previous changes (1)
- server/http_hooks.go
|
/update-branch |
|
|
||
| // Build introduction text showing key identifiers passed via mmaction:// | ||
| intro := fmt.Sprintf( | ||
| "**Issue:** %s | **Project:** %s\n**Title:** %s | **Priority:** %s | **Assignee:** %s", |

Summary
/inline_actionslash command that posts a markdown issue-tracker table whosemmaction://triage?...links open a per-row triage dialog.mm_blocks_actionspost prop (with requiredtype: "external") and per-click parameters carried in the link query string (id,title,priority,assignee) merged into the upstream URL byMergeQueryIntoURL. Static fields (project) still come throughrequest.Context./inline_action/triageHTTP handler that opens a follow-up dialog populated from those query params and the static context.Ticket Link
Fixes https://mattermost.atlassian.net/browse/MM-68387
Test plan
/inline_actionposts the 5-row issue table.id/title/priority/assigneeplus the staticproject=Demo Project.Requires mattermost/mattermost#36219 to test.