Repository navigation
feat: add experimental canvas-migration template - #236
ivanboring wants to merge 1 commit into
Conversation
Add the canvas-migration template from staging-coder.ddev.com (version migration-v6-skill-launch, by jamieaa64), so that after merge `make push-template-canvas-migration` publishes it to coder.ddev.com. It is a single-project derivative of freeform that installs Drupal CMS with Canvas, Storybook and MCP on first start, for the Canvas AI Migrations workflow. Its display name and README tags mark it as experimental. The staging copy had edited its vendored claude-remote-control module, which `make sync-shared` would overwrite. Those edits are now optional module variables: default_enabled, default_skip_permissions, project_directory and launch_script. With the defaults, the module renders the same startup script as before, so drupal-core, drupal-contrib and freeform are unchanged. Also: - Makefile: add canvas-migration to TEMPLATES, with push and deploy targets and display metadata. RUNNER_TEMPLATES vendors the runner module into it as well as freeform. - CI: add canvas-migration to the validate and staging-push matrices. - Leave out the freeform test scripts the staging copy carried, and rewrite MAINTAINERS.md for maintenance in this repository. - Docs: describe the template in AGENTS.md and on the choosing-a-template page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Previews
The landing-page preview creates workspaces on staging-coder.ddev.com, and its Documentation links open the docs preview. Read the Docs posts its build status and changed pages in its own comment; the docs preview may take a minute or two after a push to update. Updated for 74ee143 |
Documentation build overview
|
rfay
left a comment
There was a problem hiding this comment.
-
I understand after looking at the web launcher why you need a template.
-
I'm not sure all of it needs to be stuffed into the template, though. About 560 of the 686 lines in
canvas-migration/template.tfare a copy of freeform, including the inline startup script, so freeform fixes won't reach this template unless someone copies them over by hand. The migration-specific work (migration-setup.sh, the Claude rules,start-building-ui.sh) doesn't need Terraform. -
Please open additional issues or PRs based on what you learned doing this, thanks.
Claude Code created a workspace from this version on staging with a source URL and the /building-ui switch on. Setup reached ready in about 11 minutes, Drupal and Storybook both answered, and a restart re-ran setup cleanly in about a minute and a half. After Claude login, the pane started /building-ui on the source site as intended.
- The remote-control Claude can't reach the Drupal MCP server: it reported "failed to connect due to a TLS certificate error". The installer puts
NODE_EXTRA_CA_CERTS(the mkcert CA) in~/.bashrc, but the tmux pane doesn't read~/.bashrc, so Claude's process doesn't have it. The staging v6 version had the same problem. With the variable set, Node reacheshttps://migration.ddev.site/mcpfine (401, not a TLS error). Maybe add it to the agentenv, or to the module next toSSH_AUTH_SOCK, so remote control in other templates gets it too?
NODE_EXTRA_CA_CERTS = "/home/coder/.local/share/mkcert/rootCA.pem"The setup check passed anyway because it only tests .mcp.json and the token exchange. A real request with curl --cacert or node would catch this.
- From reading the code (not tried yet): if
migration-setupfails, the startup script stops there because ofset -euo pipefail, so Claude remote control, the runner and~/.coder-startup.shnever start. After a partial install, every later start fails the same way at the missing-marker check, so the user loses Claude right when they'd want it to help repair things. Maybe~/.local/bin/migration-setup || echo "Migration setup failed; see Migration setup log"? - The installer is fetched unpinned (
install.shplus thefeat/coderbranch, with--yolo) on the first start of every workspace, so what users get can change without any change here. Can we pin a tag or commit? - With /building-ui switched on and no source URL, Claude stays stopped. Falling back to the default launch avoids that:
launch_script = data.coder_parameter.start_building_ui.value == "true" && data.coder_parameter.migration_source_url.value != "" ? file("${path.module}/start-building-ui.sh") : ""- Right after a restart, the "Migration setup" status shows
readyfrom the previous run until setup starts again. Maybe reset the status file early in the startup script?
Small things:
- The runner switch can't work here, since remote control is on by default and the runner refuses to run alongside it. Maybe drop it, along with
RUNNER_TEMPLATES? - "(Experimental)" at the end of the display name is easy to miss in the template list. Maybe put it first?
- The setup log shows
ln: failed to create symbolic link '/usr/local/bin/agent-browser': Permission deniedand "Detected 4 configuration error(s)" from the router. Probably for the installer side to fix.
🤖 Reviewed with assistance from Claude Code
There was a problem hiding this comment.
Claude tested this in a workspace created from the template (review236a). I ran /building-ui on the source URL and had Claude rebuild the ddev.com homepage in Storybook as Canvas code components, inspecting the source read-only and making no Drupal writes.
The main flow works. Setup reached ready, and the /building-ui build-approach questions fired and saved to AGENTS.md. Claude built 17 components, which pass canvas validate, and the full test suite passes (124 tests). Result: https://6005--main--review236a--rfay.staging-coder.ddev.com/?path=/story/example-pages-ddev-home--ddev-home
Problems found, grouped by where the fix belongs.
In this template
-
The
drupalMCP server can't connect:UNABLE_TO_VERIFY_LEAF_SIGNATURE. The site certificate comes from the workspace's mkcert CA, which isn't in the host trust store, socurl https://migration.ddev.sitealso needed-k.mkcert -installfollowed byddev poweroff && ddev startfixes curl and other OS tools. That matches the open freeform change to runmkcert -install.
But that isn't enough for Claude Code. Node ignores the system trust store, so a Nodefetchtohttps://migration.ddev.site/mcpstill fails aftermkcert -install. It succeeds (401, waiting for the token) with either of:NODE_EXTRA_CA_CERTS=/home/coder/.local/share/mkcert/rootCA.pemNODE_USE_SYSTEM_CA=1(Node 24; needsmkcert -installfirst)
Adding one of these to the agent
envblock intemplate.tf(next toNODE_NO_WARNINGS) should make/mcpwork without manual steps.NODE_EXTRA_CA_CERTSworks even withoutmkcert -install. -
agent-browser doesn't run on the host. The global
agent-browser's Chrome is missing system libraries (libatk-1.0.so.0,libatk-bridge,libcups,libgbm,libxkbcommon, X11/cairo/pango,libasound). The project'sAGENTS.mdand the QA skill tell agents to use it directly. Onlyddev exec 'npx agent-browser …'inside the web container worked. Either install the Playwright Chromium dependencies in the image (npx playwright install-deps chromiumor the equivalent apt packages) or point the guidance at the container. -
The Coder CLI isn't logged in on the workspace, so the agent can't set "don't autostop" (
coder schedule stop <ws> manual). This matters for workspaces left up for others to review, like this one. Maybe set a long TTL or no autostop by default for this template, or at least document it.
In the installer and skills (aibp.drupalstarforge.ai), probably not this PR
npm run code:fixdamages the repo. This is the most serious one. Its Prettier step covers every file in the repo, and.prettierignoredoesn't excludeweb/,recipes/,.agents/or.claude/. ESLint--fixalso editsweb/coreand contrib code. One run from the host rewrote about 700 tracked files and about 100 gitignored Composer files (web/core,canvas,gin,project_browser, …). It also rewrote the template's own.claude/rules/coder-workspace.md. Recovery tookgit checkoutplusddev composer reinstallof 10 packages.AGENTS.mdpresentscode:checkandcode:fixas routine, so agents will run them. They should be scoped tosrc/(or the ignore files fixed).- The Storybook URL is inconsistent. The installer's
AGENTS.mdMCP section sayshttps://migration.ddev.site:6006from the host. The Coder block appended by this template and.mcp.jsonusehttp://migration.ddev.site:6005. - Brand-kit doesn't fit the sync setting.
AGENTS.mdlistsbrand-kitas a trackablesyncgroup, but the Canvas CLI has nosynckey for it; it's controlled only by theCANVAS_INCLUDE_BRAND_KITenv var. - Minor skill mismatches:
getSlotChildrenreturns parsed data, not renderable children, so it can't be used to wrap slot children (e.g. in<li>).drupal-canvas'sImagelogs a console error for every image without analternateWidthsURL, which means every Storybook asset.
Item 1 is the only one that blocks the template's advertised flow ("check /mcp"). The rest are friction or footguns.
|
Sorry to have introduced merge conflict, but Claude will help you with it :) |
|
Fantastic! "I'm not sure all of it needs to be stuffed into the template, though." Absolutely, to me the purpose of putting something out there is to show how it can work, end-to-end and then figure out where things go. How do we test PRs for this, is it best to build it ourselves? I have the template working on https://staging-coder.ddev.com/workspaces and we were able to use the Agent Browser and get MCP working just fine. Do we set up ddev coder locally?
|
|

Short Summary (TL;DR)
Adds the experimental
canvas-migrationtemplate, which until now existed only on staging, so thatmake push-template-canvas-migrationcan publish it to coder.ddev.com. Its custom Claude behavior moves into optionalclaude-remote-controlvariables, leaving the other templates' output byte-identical.The Issue
The Drupal CMS Canvas Migration template was pushed to staging-coder.ddev.com by hand from outside this repository, so it can't reach coder.ddev.com through the normal deploy path. Its vendored copy of
claude-remote-controlhad also been edited in place, andmake sync-sharedwould overwrite those edits.How This PR Solves The Issue
canvas-migration/from staging versionmigration-v6-skill-launch(by jamieaa64). It is a single-project derivative offreeform. On first start,migration-setup.shinstalls Drupal CMS with Canvas, Storybook and MCP for the Canvas AI Migrations workflow.experimentaltag and a note.claude-remote-controlvariables,default_enabled,default_skip_permissions,project_directoryandlaunch_script, to replace the template's in-place module edits. The Start a migration with /building-ui switch passesstart-building-ui.shaslaunch_script. With the defaults, the module renders the same startup script asmainbyte for byte (checked with remote control off, on, and on with skipped prompts).canvas-migrationtoTEMPLATES, withpush-template-canvas-migration,deploy-canvas-migrationand display metadata. A newRUNNER_TEMPLATESvendors the self-hosted runner module into it as well as freeform.canvas-migrationto thevalidate.ymlandstaging-push.ymlmatrices.main, so the template also gets fix(runner): put Homebrew on every PATH, and report dirty checkouts #234 and fix(claude): give Claude sessions the workspace SSH agent #235.MAINTAINERS.mdfor maintenance in this repository.AGENTS.mdandgetting-started/choosing-a-template.md.Manual Testing Instructions
make push-template-canvas-migration ACTIVATE=falseagainst staging, then create a workspace from the new version.ready. Sign in from the Claude Code app and check/mcp./building-uion that site in~/migration.Automated Testing Overview
terraform fmt -check -recursive,make validateandmake test-templatespass for all templates. Two new template tests cover the default launch and the/building-uilaunch.shellcheckandbats canvas-migration/tests/setup.bats(7 tests) pass locally. CI doesn't run them yet.docs/content. The Zensical build was not run locally.Release/Deployment Notes
make push-template-canvas-migrationagainst coder.ddev.com.aibp.drupalstarforge.aiandgitlab.com/freelygive/canvas-storybook-ai(branchfeat/coder).claude-remote-controlchange is vendored into drupal-core, drupal-contrib and freeform, but their rendered output is unchanged.Known limitations, carried over from staging:
start-building-ui.shrequiresMIGRATION_SOURCE_URL.migration-v6-skill-launchwas never promoted on staging; the active staging version ismigration-v5-workflow.🤖 Generated with Claude Code - MR done from template code vibe coded by jamieaa64