Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
"Bash(docker compose run:*)",
"Bash(docker compose up:*)",
"Bash(find:*)",
"Bash(git add:*)",
"Bash(git checkout:*)",
"Bash(git commit:*)",
"Bash(git push:*)",
"Bash(golangci-lint run:*)",
"Bash(java:*)",
"Bash(make lint:*)",
Expand Down
2 changes: 1 addition & 1 deletion src/csharp/LampControlApi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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.
var mode = args.FirstOrDefault(arg => arg.StartsWith("--mode="))?.Split('=')[1] ?? "serve";
var mode = args.FirstOrDefault(arg => arg.StartsWith("--mode="))?.Split('=')[1] ?? "serve-only";

// Handle migrate-only mode
if (mode == "migrate")
Expand Down
2 changes: 1 addition & 1 deletion src/go/cmd/lamp-control-api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func initializeRepository(ctx context.Context, runMigrations bool, requireDB boo
func main() {
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.
flag.Parse()

// Handle migrate-only mode
Expand Down
8 changes: 4 additions & 4 deletions src/java/src/main/java/org/openapitools/ApplicationMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ public class ApplicationMode {
private static final Logger logger = LoggerFactory.getLogger(ApplicationMode.class);

public enum Mode {
SERVE, // Default: run migrations then start server
MIGRATE, // Run migrations only and exit
SERVE_ONLY // Start server without running migrations
SERVE_ONLY, // Default: start server without running migrations
SERVE, // Run migrations then start server
MIGRATE // Run migrations only and exit
}

/** Run migrations only and exit */
Expand Down Expand Up @@ -88,7 +88,7 @@ public static Mode parseMode(String[] args) {
}
}
}
return Mode.SERVE; // Default mode
return Mode.SERVE_ONLY; // Default mode
}

/** Configure Spring properties based on the mode */
Expand Down
2 changes: 1 addition & 1 deletion src/kotlin/src/main/kotlin/com/lampcontrol/Application.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ private val logger = LoggerFactory.getLogger("Application")

fun main(args: Array<String>) {
// Parse command line arguments
val mode = args.find { it.startsWith("--mode=") }?.substringAfter("=") ?: "serve"
val mode = args.find { it.startsWith("--mode=") }?.substringAfter("=") ?: "serve-only"

when (mode) {
"migrate" -> runMigrationsOnly()
Expand Down
10 changes: 5 additions & 5 deletions src/python/src/openapi_server/cli.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Command-line interface for Lamp Control API.

This module provides CLI commands for running the application in different modes:
- serve: Run migrations and start the server (default)
- serve-only: Start server without running migrations (default)
- serve: Run migrations and start the server
- migrate: Run migrations only
- serve-only: Start server without running migrations
"""

import argparse
Expand Down Expand Up @@ -94,9 +94,9 @@ def main():
parser.add_argument(
"--mode",
choices=["serve", "migrate", "serve-only"],
default="serve",
help="Operation mode: serve (default, migrate and start server), "
"migrate (run migrations only), serve-only (start server without migrations)",
default="serve-only",
help="Operation mode: serve-only (default, start server without migrations), "
"serve (migrate and start server), migrate (run migrations only)",
)
parser.add_argument(
"--log-level",
Expand Down
6 changes: 3 additions & 3 deletions src/typescript/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* Command-line interface for Lamp Control API
*
* Supports three operation modes:
* - serve: Run migrations and start server (default)
* - serve-only: Start server without migrations (default)
* - serve: Run migrations and start server
* - migrate: Run migrations only
* - serve-only: Start server without migrations
*/

import { execSync } from 'child_process';
Expand Down Expand Up @@ -77,7 +77,7 @@ async function startServer(runMigrations: boolean): Promise<void> {
async function main(): Promise<void> {
const args = process.argv.slice(2);
const modeArg = args.find((arg) => arg.startsWith('--mode='));
const mode = modeArg ? modeArg.split('=')[1] : 'serve';
const mode = modeArg ? modeArg.split('=')[1] : 'serve-only';

switch (mode) {
case 'migrate':
Expand Down
Loading