Skip to content

docs: add Cursor Cloud dev environment setup notes - #926

Closed
crspeller wants to merge 1 commit into
masterfrom
cursor/setup-dev-environment-cffa
Closed

docs: add Cursor Cloud dev environment setup notes#926
crspeller wants to merge 1 commit into
masterfrom
cursor/setup-dev-environment-cffa

Conversation

@crspeller

@crspeller crspeller commented Jul 24, 2026

Copy link
Copy Markdown
Member

Summary

Sets up and verifies the full development environment for this repo in Cursor Cloud and records the non-obvious, durable caveats in AGENTS.md under a new ## Cursor Cloud specific instructions section. No application/source code is changed.

What was verified end-to-end in the environment (all green):

Task Command Result
Lint make check-style ✅ 0 issues (Go + webapp)
Unit tests make test ✅ 3744 Go tests (100 skipped) + 276 webapp jest
Build MM_SERVICESETTINGS_ENABLEDEVELOPER=1 make dist dist/mattermost-ai-*.tar.gz
Run (e2e) cd e2e && npx playwright test --config=playwright.aimock-smoke.config.ts ✅ 5 passed, 1 skipped

The "hello world" run boots a real Mattermost 11.9 + pgvector + a deterministic mock-LLM sidecar (aimock) via testcontainers, deploys the freshly built plugin bundle, and confirms an agent replies in the Agents RHS panel — no LLM API keys needed.

Key setup learnings captured in AGENTS.md:

  • Go toolchain must be pinned to go1.26.4 (go env -w GOTOOLCHAIN=go1.26.4) or the pinned golangci-lint v2.0.2 builds with go1.25.12 and refuses the go 1.26.4 module — the golangci-lint analogue of the existing mattermost-govet gotcha.
  • Node is fixed at v22.14 / npm 10.9.7 (/exec-daemon/node overrides nvm); use npm ci to avoid cosmetic package-lock.json drift that would trip make check-locks.
  • Docker (installed) is required for postgres/ unit tests and all e2e; start it with sudo service docker start.

mattermost_agents_live_demo.mp4

Ticket Link

NONE

Release Note

NONE

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

Summary by CodeRabbit

  • Documentation
    • Added setup guidance for the cloud development environment.
    • Documented required tool versions and configuration for consistent builds and linting.
    • Added prerequisites and instructions for running PostgreSQL tests and end-to-end checks.
    • Included a faster build option and lightweight browser smoke-test workflow.
    • Clarified expected build artifacts and browser installation requirements.

Co-authored-by: Christopher Speller <crspeller@users.noreply.github.com>
@crspeller crspeller closed this Jul 24, 2026
@github-actions

Copy link
Copy Markdown

🤖 LLM Evaluation Results

OpenAI

⚠️ Overall: 21/28 tests passed (75.0%)

Provider Total Passed Failed Pass Rate
⚠️ OPENAI 28 21 7 75.0%

❌ Failed Evaluations

Show 7 failures

OPENAI

1. TestReactEval/[openai]_react_cat_message

  • Score: 0.00
  • Rubric: The word/emoji is a cat emoji or a heart/love emoji
  • Reason: The output is the text string "heart_eyes_cat", not an actual cat emoji (e.g., 😺/🐱) or a heart/love emoji (e.g., ❤️/😍).

2. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: is a list of bugs
  • Reason: The output provides a template and asks the user to paste bugs, but it does not actually contain a list of bugs (no specific bug items are listed).

3. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: includes a description of each bug
  • Reason: The output provides a blank template and asks the user to paste bug items; it does not include descriptions of each specific bug.

4. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: attributes each bug to a user
  • Reason: The output provides a template with a 'Reported by' column but does not actually attribute any specific bug to a user, since no bugs/users are listed or filled in.

5. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: attributes the bug about trying to save without a color and the save button not doing anything to @maria.nunez
  • Reason: The output provides a generic request for the bug list and a table template, but it does not attribute any specific bug ("trying to save without a color" / "save button not doing anything") to @maria.nunez.

6. TestConversationMentionHandling/[openai]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: the bug about the end user being able to change channel banner is attributed to @maria.nunez
  • Reason: The output does not mention @maria.nunez or attribute any specific bug (including the one about an end user being able to change the channel banner) to her; it only provides a generic template and asks for the list of bugs.

7. TestDirectMessageConversations/[openai]_bot_dm_tool_introspection

  • Score: 0.00
  • Rubric: mentions Github and refers to the documentation
  • Reason: The output refers to documentation via a docs.mattermost.com link, but it does not mention GitHub anywhere. Since the rubric requires both mentioning GitHub and referring to the documentation, it fails.

Anthropic

⚠️ Overall: 21/28 tests passed (75.0%)

Provider Total Passed Failed Pass Rate
⚠️ ANTHROPIC 28 21 7 75.0%

❌ Failed Evaluations

Show 7 failures

ANTHROPIC

1. TestReactEval/[anthropic]_react_cat_message

  • Score: 0.00
  • Rubric: The word/emoji is a cat emoji or a heart/love emoji
  • Reason: The output is the text string "heart_eyes_cat", not an actual cat emoji (e.g., 😺) or heart/love emoji (e.g., ❤️).

2. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: is a list of bugs
  • Reason: The output does not provide a list of bugs; it states an inability to access trackers and suggests places to look and how to compile the list.

3. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: includes a description of each bug
  • Reason: The output states it cannot access bug trackers and suggests where to look, but it does not list any bugs or provide descriptions of each bug.

4. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: attributes each bug to a user
  • Reason: The output does not list any bugs at all, nor does it attribute each bug to a user. It instead states lack of access and suggests where to look for bugs.

5. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: attributes the bug about trying to save without a color and the save button not doing anything to @maria.nunez
  • Reason: The output does not mention @maria.nunez and does not attribute the specific bug (saving without a color causing the save button to do nothing) to anyone. It only states it cannot access trackers and suggests where to look.

6. TestConversationMentionHandling/[anthropic]_conversation_from_attribution_long_thread.json

  • Score: 0.00
  • Rubric: the bug about the end user being able to change channel banner is attributed to @maria.nunez
  • Reason: The output does not mention the specific bug about an end user being able to change the channel banner, nor does it attribute that bug to @maria.nunez. It only states inability to access trackers and suggests where to look.

7. TestDirectMessageConversations/[anthropic]_bot_dm_tool_introspection

  • Score: 0.50
  • Rubric: mentions Github and refers to the documentation
  • Reason: The output refers to documentation at docs.mattermost.com, satisfying the documentation reference, but it does not mention GitHub anywhere.

This comment was automatically generated by the eval CI pipeline.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

AGENTS.md adds Cursor Cloud-specific instructions covering pinned toolchains, Docker prerequisites, a reduced dist build, and a lightweight Playwright e2e smoke-test workflow.

Changes

Cursor Cloud setup

Layer / File(s) Summary
Cursor Cloud environment and test instructions
AGENTS.md
Documents Go and Node/npm version requirements, Docker setup for PostgreSQL tests and e2e tests, a reduced make dist configuration, and Playwright smoke-test commands with expected dist/ artefacts.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested labels: Setup Cloud Test Server

🚥 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 clearly summarizes the documentation update adding Cursor Cloud development environment setup notes.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/setup-dev-environment-cffa

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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 `@AGENTS.md`:
- Line 104: Update the “Fast dist build” documentation to use
`MM_SERVICESETTINGS_ENABLEDEVELOPER=1 make dist-ci`, referencing the Makefile’s
`dist-ci` target for the Linux amd64-only build instead of `make dist`.
- Line 103: Update the Docker setup guidance in AGENTS.md to remove chmod 666 as
the default socket workaround. Prefer rootless Docker or adding the user to the
Docker group, and mention chmod 666 only as a temporary, explicitly
security-sensitive fallback.
🪄 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: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: df88a758-cbfa-4544-a92e-66abb51dbc20

📥 Commits

Reviewing files that changed from the base of the PR and between ccc3c69 and 6460396.

📒 Files selected for processing (1)
  • AGENTS.md

Comment thread AGENTS.md

- **Go toolchain pin is required for lint.** The base `go` is 1.22.2 (auto-upgrades to 1.26.4 per `go.mod`). Without `GOTOOLCHAIN=go1.26.4`, `make install-go-tools` builds the pinned `golangci-lint` (v2.0.2) with go1.25.12, which then refuses this go 1.26.4 module (`the Go language version used to build golangci-lint is lower than the targeted Go version`). This is the `golangci-lint` analogue of the `mattermost-govet` gotcha above. The pin is set persistently via `go env -w`; if lint ever fails with that message, re-run `go env -w GOTOOLCHAIN=go1.26.4`. `make test`/`go test` are unaffected (they only shell out through gotestsum).
- **Node is fixed at v22.14 / npm 10.9.7.** `/exec-daemon/node` is forced to the front of `PATH`, so `nvm use` cannot override it despite AGENTS listing Node 24.11. Build, jest, and e2e all work on it. Use `npm ci` (not `npm install`): npm 10 rewrites `package-lock.json` cosmetically (drops `"peer": true`) vs the committed lockfiles generated by npm 11, which would trip `make check-locks`. `npm ci` installs from the lockfile without rewriting it.
- **Docker is required for `postgres/` unit tests and all e2e** (both use testcontainers). The daemon is installed but not auto-started on a fresh boot: run `sudo service docker start`, and if the socket denies access run `sudo chmod 666 /var/run/docker.sock`. Tests pull public images (`mattermostdevelopment/mattermost-enterprise-edition:release-11.9`, `pgvector/pgvector:pg15`, `ghcr.io/copilotkit/aimock`, `testcontainers/ryuk`).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Do not document a world-writable Docker socket as the default workaround.

sudo chmod 666 /var/run/docker.sock grants every local user access to Docker, which is effectively host-root control. Prefer rootless Docker or a narrowly scoped Docker-group setup, and describe this command only as a temporary, security-sensitive fallback.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~103-~103: Possible missing comma found.
Context: ...docker start, and if the socket denies access run sudo chmod 666 /var/run/docker.soc...

(AI_HYDRA_LEO_MISSING_COMMA)

🤖 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 `@AGENTS.md` at line 103, Update the Docker setup guidance in AGENTS.md to
remove chmod 666 as the default socket workaround. Prefer rootless Docker or
adding the user to the Docker group, and mention chmod 666 only as a temporary,
explicitly security-sensitive fallback.

Comment thread AGENTS.md
- **Go toolchain pin is required for lint.** The base `go` is 1.22.2 (auto-upgrades to 1.26.4 per `go.mod`). Without `GOTOOLCHAIN=go1.26.4`, `make install-go-tools` builds the pinned `golangci-lint` (v2.0.2) with go1.25.12, which then refuses this go 1.26.4 module (`the Go language version used to build golangci-lint is lower than the targeted Go version`). This is the `golangci-lint` analogue of the `mattermost-govet` gotcha above. The pin is set persistently via `go env -w`; if lint ever fails with that message, re-run `go env -w GOTOOLCHAIN=go1.26.4`. `make test`/`go test` are unaffected (they only shell out through gotestsum).
- **Node is fixed at v22.14 / npm 10.9.7.** `/exec-daemon/node` is forced to the front of `PATH`, so `nvm use` cannot override it despite AGENTS listing Node 24.11. Build, jest, and e2e all work on it. Use `npm ci` (not `npm install`): npm 10 rewrites `package-lock.json` cosmetically (drops `"peer": true`) vs the committed lockfiles generated by npm 11, which would trip `make check-locks`. `npm ci` installs from the lockfile without rewriting it.
- **Docker is required for `postgres/` unit tests and all e2e** (both use testcontainers). The daemon is installed but not auto-started on a fresh boot: run `sudo service docker start`, and if the socket denies access run `sudo chmod 666 /var/run/docker.sock`. Tests pull public images (`mattermostdevelopment/mattermost-enterprise-edition:release-11.9`, `pgvector/pgvector:pg15`, `ghcr.io/copilotkit/aimock`, `testcontainers/ryuk`).
- **Fast dist build:** `MM_SERVICESETTINGS_ENABLEDEVELOPER=1 make dist` builds only linux-amd64 (the arch the e2e Mattermost container needs) instead of all five arches.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win

Use the amd64-only build target for the fast path.

The supplied Makefile defines dist as the regular multi-stage build and dist-ci as the target that invokes server-ci for Linux amd64 only. Document MM_SERVICESETTINGS_ENABLEDEVELOPER=1 make dist-ci here; the current command does not guarantee the reduced-architecture build it claims to provide.

🤖 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 `@AGENTS.md` at line 104, Update the “Fast dist build” documentation to use
`MM_SERVICESETTINGS_ENABLEDEVELOPER=1 make dist-ci`, referencing the Makefile’s
`dist-ci` target for the Linux amd64-only build instead of `make dist`.

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