Skip to content

feat: apps support multi dev modes#1175

Open
raistlin042 wants to merge 1 commit into
larksuite:mainfrom
raistlin042:feat/lark-apps-dev
Open

feat: apps support multi dev modes#1175
raistlin042 wants to merge 1 commit into
larksuite:mainfrom
raistlin042:feat/lark-apps-dev

Conversation

@raistlin042
Copy link
Copy Markdown
Collaborator

@raistlin042 raistlin042 commented May 29, 2026

Summary

Add a fullstack app type to apps +create alongside the existing HTML. When --app-type fullstack, a new --message flag is required and forwarded verbatim in the create request body so the server can generate the app from the user's description. For HTML, --message is silently ignored. The lark-apps skill now routes between HTML and fullstack based on the user's intent.

Changes

  • Add fullstack to the app-type allow-list and a new --message flag in shortcuts/apps/apps_create.go; conditional validation (fullstack requires non-blank message) and request-body injection of message only for fullstack.
  • Add unit tests in shortcuts/apps/apps_create_test.go: fullstack success, required/blank message rejection, HTML message-ignore, dry-run, and case-sensitive rejection.
  • Document HTML vs fullstack intent routing, --message, the fullstack scenario, and skill description trigger words in skills/lark-apps/SKILL.md and skills/lark-apps/references/lark-apps-create.md.

Test Plan

  • make unit-test passed (./shortcuts/apps/ green)
  • validate passed (build / vet / unit / integration)
  • local-eval passed (E2E 4/4 dry-run, skillave 5/5)
  • acceptance-reviewer passed (9/9 cases)
  • manual verification: lark-cli apps +create --name "团队任务看板" --app-type fullstack --message "带登录和数据库的任务看板" --dry-run --as user — request body carries app_type: fullstack and message; missing message exits 2
  • skipped: real backend round-trip — the server-side fullstack interface is not deployed yet and the request-body field name (message) is tentative; real create verification is deferred until the backend ships

Related Issues

N/A

Summary by CodeRabbit

  • New Features

    • Extended app creation to support fullstack applications in addition to HTML apps
    • Added new --message flag (required for fullstack apps) to specify app details
  • Tests

    • Added comprehensive test coverage for fullstack app creation, message validation, and edge cases
  • Documentation

    • Updated user guides with fullstack app creation examples and decision guidance for choosing between HTML and fullstack app types

Review Change Stack

* feat: accept fullstack app-type and require --message for it

* feat: inject message into fullstack create request body

* refactor: align fullstack message injection with existing body-build style

* docs: document fullstack app-type and --message for apps +create

* docs: keep scene numbering consistent in lark-apps-create reference

* docs: add HTML/fullstack intent routing to lark-apps SKILL.md

* docs: cover fullstack in lark-apps skill description and clarify HTML flow step

* test: assert fullstack in allow-list error and reject wrong-cased fullstack
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

📝 Walkthrough

Walkthrough

This PR extends the Lark CLI app creation workflow to support fullstack applications alongside existing HTML apps. A new --message flag captures build instructions for fullstack type, with updated validation, expanded test coverage, and documentation reflecting the new intent selection and workflow patterns.

Changes

Fullstack App Type Support

Layer / File(s) Summary
CLI flags and validation rules
shortcuts/apps/apps_create.go
New --message flag for app build instructions; --app-type help text and validation updated to list allowed values (HTML, fullstack); validation enforces non-empty message for fullstack type.
Request payload building and enum
shortcuts/apps/apps_create.go
validAppTypes enum expanded to include fullstack; request body builder conditionally includes message field only when app-type is fullstack with non-empty message.
Validation and behavior tests
shortcuts/apps/apps_create_test.go
Updated existing validation test to expect fullstack in error list; new tests verify case-sensitive rejection of fullstack, message requirement enforcement (missing and blank values), fullstack request body fields, HTML message omission, and fullstack dry-run output.
Skill metadata and workflow guidance
skills/lark-apps/SKILL.md
Skill description updated; fullstack example added to common usage section; app creation workflow guidance clarified with intent-based --app-type selection rules; shortcuts table updated to document fullstack capability and message requirement.
Reference documentation for CLI usage
skills/lark-apps/references/lark-apps-create.md
CLI examples extended to show fullstack creation with required --message; field semantics section clarified (case-sensitive app_type, message verbatim pass-through for fullstack only); intent selection guidance expanded with HTML vs fullstack decision rules; new fullstack scenario added with post-creation local development setup warning.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

domain/ccm, size/M

Suggested reviewers

  • liangshuo-1
  • kongenpei

Poem

A fullstack rabbit hops with glee, 🐰
With --message for apps so free,
HTML or fullstack, the choice is clear,
Validation guards what's brought here,
Tests and docs all unified near! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'feat: apps support multi dev modes' is vague and does not clearly reflect the main change of adding fullstack app type support with message flag. Use a more specific title such as 'feat: add fullstack app type with message support' to clearly communicate the primary change.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description comprehensively follows the repository template with Summary, Changes, Test Plan, and Related Issues sections all properly completed with sufficient detail.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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.

❤️ Share

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

@github-actions github-actions Bot added the size/M Single-domain feat or fix with limited business impact label May 29, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
shortcuts/apps/apps_create.go (1)

41-41: 💤 Low value

Allowed-values list is duplicated across three sites and can drift.

The supported types now appear in the flag help text (Line 27: "HTML or fullstack"), the validation error (Line 41: "allowed: HTML, fullstack"), and the validAppTypes map (Lines 67-70). Adding a future type means editing all three, and a missed edit produces a misleading user-facing error. Consider deriving the allowed-values string from the map (sorted for deterministic output).

♻️ Example: derive the list from validAppTypes
func allowedAppTypes() string {
	keys := make([]string, 0, len(validAppTypes))
	for k := range validAppTypes {
		keys = append(keys, k)
	}
	sort.Strings(keys)
	return strings.Join(keys, ", ")
}
-			return output.ErrValidation(fmt.Sprintf("--app-type %q is not supported (allowed: HTML, fullstack)", appType))
+			return output.ErrValidation(fmt.Sprintf("--app-type %q is not supported (allowed: %s)", appType, allowedAppTypes()))
🤖 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 `@shortcuts/apps/apps_create.go` at line 41, The error message and flag help
duplicate the allowed app types; derive the user-facing list from the canonical
validAppTypes map instead of hardcoding: add a helper (e.g., allowedAppTypes())
that collects keys from validAppTypes, sorts them deterministically, and returns
a comma-separated string, then use that helper in the flag help text and in the
validation error inside the code that returns
output.ErrValidation(fmt.Sprintf("--app-type %q is not supported (allowed: %s)",
appType, allowedAppTypes())). Ensure you reference validAppTypes when building
the list so future type additions only require updating that map.
🤖 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 `@shortcuts/apps/apps_create.go`:
- Line 41: The error message and flag help duplicate the allowed app types;
derive the user-facing list from the canonical validAppTypes map instead of
hardcoding: add a helper (e.g., allowedAppTypes()) that collects keys from
validAppTypes, sorts them deterministically, and returns a comma-separated
string, then use that helper in the flag help text and in the validation error
inside the code that returns output.ErrValidation(fmt.Sprintf("--app-type %q is
not supported (allowed: %s)", appType, allowedAppTypes())). Ensure you reference
validAppTypes when building the list so future type additions only require
updating that map.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 392d9f38-c111-4570-b3f0-3cd6e06760f6

📥 Commits

Reviewing files that changed from the base of the PR and between 1ba107d and 06a77dc.

📒 Files selected for processing (4)
  • shortcuts/apps/apps_create.go
  • shortcuts/apps/apps_create_test.go
  • skills/lark-apps/SKILL.md
  • skills/lark-apps/references/lark-apps-create.md

@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.92%. Comparing base (176d452) to head (06a77dc).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1175      +/-   ##
==========================================
+ Coverage   68.78%   68.92%   +0.14%     
==========================================
  Files         628      629       +1     
  Lines       58680    58767      +87     
==========================================
+ Hits        40363    40508     +145     
+ Misses      15021    14952      -69     
- Partials     3296     3307      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@06a77dcc68ef9222fd06c6783cd24d0b586d43fc

🧩 Skill update

npx skills add raistlin042/cli#feat/lark-apps-dev -y -g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant