Skip to content

Conversation

@davideme
Copy link
Owner

Summary

  • Updates all 6 language implementations (TypeScript, Java, Python, Go, Kotlin, C#) to use serve-only as the default operation mode
  • Previously the default was serve, which runs database migrations before starting the server
  • The new default serve-only starts the server without running migrations, requiring explicit --mode=serve or --mode=migrate for migration operations

Test plan

  • Verify each implementation starts without migrations by default
  • Verify --mode=serve still runs migrations before starting
  • Verify --mode=migrate still runs migrations only

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings January 18, 2026 17:22
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.
Copy link
Contributor

Copilot AI left a 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 serve to serve-only across 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)")
Copy link

Copilot AI Jan 18, 2026

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").

Copilot uses AI. Check for mistakes.
using LampControlApi.Services;
using Microsoft.EntityFrameworkCore;

// Parse operation mode from command line arguments
Copy link

Copilot AI Jan 18, 2026

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.

Suggested change
// Parse operation mode from command line arguments
// Parse operation mode from command line arguments (default: "serve-only"; other supported mode: "migrate")

Copilot uses AI. Check for mistakes.
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