[PR #7] [MERGED] fix(cli): populate required parameters when creating services in wizard #13

Closed
opened 2026-03-02 05:12:31 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/gotempsh/temps/pull/7
Author: @dviejokfs
Created: 2/17/2026
Status: Merged
Merged: 2/17/2026
Merged by: @dviejokfs

Base: mainHead: fix/cli-service-creation-parameters


📝 Commits (1)

  • 2c91a83 fix(cli): populate required parameters when creating services in wizard

📊 Changes

1 file changed (+99 additions, -19 deletions)

View changed files

📝 apps/temps-cli/src/lib/service-setup.ts (+99 -19)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/gotempsh/temps/pull/7 **Author:** [@dviejokfs](https://github.com/dviejokfs) **Created:** 2/17/2026 **Status:** ✅ Merged **Merged:** 2/17/2026 **Merged by:** [@dviejokfs](https://github.com/dviejokfs) **Base:** `main` ← **Head:** `fix/cli-service-creation-parameters` --- ### 📝 Commits (1) - [`2c91a83`](https://github.com/gotempsh/temps/commit/2c91a8360545b5c301e81851d4ac49708fe94d47) fix(cli): populate required parameters when creating services in wizard ### 📊 Changes **1 file changed** (+99 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `apps/temps-cli/src/lib/service-setup.ts` (+99 -19) </details> ### 📄 Description ## 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-mlqhtf4m` → `postgres_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` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 05:12:31 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/temps#13
No description provided.