Skip to content

fix(cli): populate required parameters when creating services in wizard#7

Merged
dviejokfs merged 1 commit intomainfrom
fix/cli-service-creation-parameters
Feb 17, 2026
Merged

fix(cli): populate required parameters when creating services in wizard#7
dviejokfs merged 1 commit intomainfrom
fix/cli-service-creation-parameters

Conversation

@dviejokfs
Copy link
Copy Markdown
Contributor

Summary

  • Fixed createNewServiceOfType() in the setup wizard sending empty parameters: {}, which caused PostgreSQL and MongoDB service creation to fail with 'database' is required validation errors
  • Added automatic parameter population: fetches the parameter schema from the API, discovers required fields, and auto-generates sensible defaults (database and username derived from the sanitized service name)
  • Added retry logic: if service creation fails, the user is prompted to retry instead of silently continuing the wizard with no service attached

Details

Root cause: The wizard's createNewServiceOfType() always sent parameters: {}. The backend (PostgresParameterStrategy::validate_for_creation) requires database and username for PostgreSQL (and MongoDB). Redis and S3 don't require any parameters.

Fix approach:

  1. Fetch GET /external-services/types/{service_type}/parameters to get the JSON Schema
  2. Extract the required array from the schema
  3. Auto-generate values: database and username are derived from the service name (e.g., postgres-mlqhtf4mpostgres_mlqhtf4m)
  4. Non-required fields (password, port, docker_image) are left to the backend's auto_generate_missing()
  5. On failure, prompt user to retry (up to 2 attempts) instead of silently returning null

Files changed: apps/temps-cli/src/lib/service-setup.ts

The setup wizard's createNewServiceOfType() was sending empty parameters {},
causing PostgreSQL and MongoDB service creation to fail with validation errors
('database' is required, 'username' is required).

Now fetches the parameter schema from the API to discover required fields,
auto-generates sensible defaults (database/username derived from service name),
and includes retry logic if creation fails.
@dviejokfs dviejokfs merged commit 4a7af16 into main Feb 17, 2026
4 of 5 checks passed
@dviejokfs dviejokfs deleted the fix/cli-service-creation-parameters branch February 25, 2026 20:10
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.

1 participant