-
Notifications
You must be signed in to change notification settings - Fork 0
Change default mode from serve to serve-only #268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Update all 6 language implementations to use serve-only as the default operation mode instead of serve. This prevents automatic database migrations from running when the server starts without explicit configuration. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Included 'git add', 'git checkout', 'git commit', and 'git push' in the list of permitted Bash commands in settings.local.json to enable these operations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Updates all language implementations so the CLI defaults to serve-only (start server without running migrations), requiring an explicit mode to run migrations.
Changes:
- Switched default CLI mode from
servetoserve-onlyacross TypeScript, Python, Kotlin, Java, Go, and C#. - Updated CLI help text / mode documentation to reflect the new default and mode descriptions.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/typescript/src/cli.ts | Default mode now serve-only; updated header comment mode list. |
| src/python/src/openapi_server/cli.py | Argparse default and help updated to serve-only. |
| src/kotlin/src/main/kotlin/com/lampcontrol/Application.kt | Default CLI mode changed to serve-only. |
| src/java/src/main/java/org/openapitools/ApplicationMode.java | Default mode parsing updated to SERVE_ONLY; enum comment order updated. |
| src/go/cmd/lamp-control-api/main.go | -mode flag default changed to serve-only; help updated. |
| src/csharp/LampControlApi/Program.cs | Default CLI mode changed to serve-only. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| port := flag.String("port", "8080", "Port for test HTTP server") | ||
| requireDB := flag.Bool("require-db", false, "Fail if PostgreSQL connection is configured but fails") | ||
| mode := flag.String("mode", "serve", "Operation mode: 'serve' (migrate and start server), 'migrate' (run migrations only), 'serve-only' (start server without migrations)") | ||
| mode := flag.String("mode", "serve-only", "Operation mode: 'serve-only' (start server without migrations, default), 'serve' (migrate and start server), 'migrate' (run migrations only)") |
Copilot
AI
Jan 18, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The inline comment later in this file says "Only run migrations in default 'serve' mode", but the default mode is now "serve-only". Please update that comment to avoid misleading readers (e.g., "Only run migrations in 'serve' mode").
| using LampControlApi.Services; | ||
| using Microsoft.EntityFrameworkCore; | ||
|
|
||
| // Parse operation mode from command line arguments |
Copilot
AI
Jan 18, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a comment later in this file that still says "Run migrations if in 'serve' mode (default)", but this change makes the default "serve-only". Please update that comment to reflect the new default behavior so the code remains self-documenting.
| // Parse operation mode from command line arguments | |
| // Parse operation mode from command line arguments (default: "serve-only"; other supported mode: "migrate") |
Summary
serve-onlyas the default operation modeserve, which runs database migrations before starting the serverserve-onlystarts the server without running migrations, requiring explicit--mode=serveor--mode=migratefor migration operationsTest plan
--mode=servestill runs migrations before starting--mode=migratestill runs migrations only🤖 Generated with Claude Code