feat: add Layero deployment rule - #340
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults 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 a Layero deployment rule covering trigger conditions, CLI execution, JSON event handling, redeploys, CI usage, constraints, and references, and adds the rule to the README’s hosting and deployments list. ChangesLayero deployment support
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Agent
participant LayeroCLI
participant Project
Agent->>Project: Check .layero/project.json
Agent->>LayeroCLI: Run npx layero init when config is missing
Agent->>LayeroCLI: Run npx layero@latest deploy --json
LayeroCLI-->>Agent: Emit JSON-lines deployment events
Agent-->>Project: Report authentication, errors, or ready.url
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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
🧹 Nitpick comments (1)
rules/layero-deployment.mdc (1)
79-80: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMake the CI example explicitly use JSON-lines output.
The rule defines
--jsonas the event contract, but the CI example omits it. Add--json(orLAYERO_JSON=1) so CI behavior remains deterministic even when a runner allocates a pseudo-TTY. (docs.layero.ru)Proposed fix
-LAYERO_TOKEN=... npx layero@latest deploy --prod --yes +LAYERO_TOKEN=... npx layero@latest deploy --prod --yes --json🤖 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 `@rules/layero-deployment.mdc` around lines 79 - 80, Update the CI deployment command example near the LAYERO_TOKEN invocation to explicitly enable JSON-lines output by adding the --json flag, preserving the existing production and noninteractive options.Source: MCP tools
🤖 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 `@rules/layero-deployment.mdc`:
- Around line 40-41: Update the Layero deployment guidance to accurately
distinguish isolated previews from deployments that update the default live
branch. Remove the claim that omitting --prod is always isolated, and remove any
recommendation to use the unsupported --branch flag; document the supported
command/options for explicitly targeting previews versus production.
---
Nitpick comments:
In `@rules/layero-deployment.mdc`:
- Around line 79-80: Update the CI deployment command example near the
LAYERO_TOKEN invocation to explicitly enable JSON-lines output by adding the
--json flag, preserving the existing production and noninteractive options.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 73489533-b658-4b7e-b55b-f940b5b8782b
📒 Files selected for processing (2)
README.mdrules/layero-deployment.mdc
CodeRabbit was right on both counts, and both were verified against the live platform rather than the docs: 1. Omitting `--prod` is NOT an isolated preview. For a project created from the CLI, direct uploads auto-promote — every deploy replaces what visitors see. `--prod` only matters for projects with a connected git repository. 2. `--branch` is not a usable flag. It is accepted and silently ignored for direct uploads: the backend files every archive deploy under the reserved `cli` environment. Reproduced on a live project — passing `--branch=probe` created no `probe` environment and changed the live site. Isolated previews come from pushing to a branch of a connected repository, and the rule now says so instead of pointing agents at an unsupported flag. Two more corrections while here: - the CI example used `--prod`; it now uses `--project`, which is what a repeatable pipeline needs. `--name` only labels a project at creation, so a pipeline without a link creates a new project on every run. - reference links pointed at the Russian docs from an English rule; switched to the `/en/` pages (both verified 200).
There was a problem hiding this comment.
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 `@rules/layero-deployment.mdc`:
- Line 42: Update the deployment guidance around the deploy command to reference
the CLI-provided ready.url value instead of constructing or hard-coding a
hostname. Remove the `.layero.app` claim and align the documented visitor URL
with the URL returned by Layero, preserving the existing instruction to rely on
ready.url.
- Line 87: Update the Layero deployment command to include the --json flag,
preserving the existing token, project, and approval options so CI emits
parseable JSON-lines ready/error events.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 54687c20-3c62-4cdd-9e3c-639427038106
📒 Files selected for processing (1)
rules/layero-deployment.mdc
|
Thanks for the review — both points were correct, and both are now fixed in I checked them against the live platform rather than against our own docs, and the docs turned out to be wrong too. That has been corrected on our side as well. 1. Omitting 2. Two more corrections while I was in the file:
Happy to adjust further if anything still reads wrong. |
The rule told readers never to construct a deployment hostname and then printed a host template two paragraphs earlier. Replaced it with the ready.url the previous deploy emitted, which is what the rule already tells agents to read. The CI example omitted --json, so a pipeline had nothing parseable to branch on.
Catalogue scanners (cursor.directory among them) look at the repo root for .mcp.json / rules/*.mdc and report 'no plugin components found' otherwise — the manifest we already had was one level down, inside plugins/layero/. Adds a root .mcp.json pointing at the same remote endpoint, and the Cursor rule for CLI deploys that went through review in PatrickJS/awesome-cursorrules#340.
I listed not_logged_in, project_unlinked and deploy_timed_out from our own docs. Checking against the CLI sources today, those codes appear nowhere in src — they were emitted by an earlier version and the docs never followed. deploy_error and deploy_timed_out cannot occur at all: the code is assembled as deploy_<status> and a deploy only has ready, building, failed and cancelled. Replaced with the set the CLI actually emits, and stated the deploy_<status> rule so the list cannot drift again.
|
Pushed one more correction to this branch ( The rule listed error codes copied from our own documentation: An agent that implemented handling from the old list would have matched nothing, while missing about fourteen codes that do occur — including The rule now lists the codes the CLI actually emits and states the |
Adds a Project Rule for deploying to Layero, plus one line in Hosting and Deployments next to Netlify and Vercel.
Disclosure: I work on Layero.
What the rule covers. Layero is driven from the terminal and its CLI has a JSON-lines mode, so the useful thing to give an agent is not "here is a platform" but the event contract: which events arrive, which fields to read, and which mistakes silently produce a wrong result. Three of them cost real debugging time:
ready.url— addresses live in a dedicated zone and organizations migrate between naming schemes, so a guessed host is simply wrong;npm install -g layero— global installs fail in sandboxed agent terminals;--yesin CI — the confirmation prompt waits forever on a runner with no one to answer it.The rule also states plainly that
--prodmust not be passed unless the user asked for production, since without it a deploy is an isolated preview.Format. One
.mdcunderrules/withdescription,globs,alwaysApply: false, percontributing.md.globstargets framework config files rather than sources, so the rule loads for the project rather than on every file edit.Checks run locally, all passing:
grep -i layeroon the current README returns nothing, so this is not a duplicate.Summary by CodeRabbit