diff --git a/TODO.md b/TODO.md index 3b56966..000eb48 100644 --- a/TODO.md +++ b/TODO.md @@ -20,6 +20,11 @@ regress. # Completed Steps +- 2026-10-01: The hint under the app page's environment variable editor now says + changes take effect at the next deploy or rollback, in the page's warning + style, instead of asking for a container restart, which keeps the old values + (#255). + - 2026-10-01: An app's first deploy no longer fails when a volume's host path does not exist yet: upaas asks Docker to create a missing host path when the app's container starts and to leave an existing one alone, so nobody has to diff --git a/internal/handlers/app_page_env_var_hint_test.go b/internal/handlers/app_page_env_var_hint_test.go new file mode 100644 index 0000000..2fbcf3c --- /dev/null +++ b/internal/handlers/app_page_env_var_hint_test.go @@ -0,0 +1,38 @@ +package handlers_test + +import ( + "net/http" + "net/http/httptest" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "sneak.berlin/go/upaas/internal/service/app" +) + +// TestAppPageEnvVarHint checks that the environment variable editor says +// changes take effect at the next deploy or rollback, in the warning style. +func TestAppPageEnvVarHint(t *testing.T) { + t.Parallel() + + testCtx := setupTestHandlers(t) + + createdApp, err := testCtx.appSvc.CreateApp(t.Context(), app.CreateAppInput{ + Name: "env-hint-app", + RepoURL: "git@example.com:user/env-hint-app.git", + }) + require.NoError(t, err) + + request := httptest.NewRequestWithContext( + t.Context(), http.MethodGet, "/apps/"+createdApp.ID, nil, + ) + request = addChiURLParams(request, map[string]string{"id": createdApp.ID}) + recorder := httptest.NewRecorder() + + testCtx.handlers.HandleAppDetail().ServeHTTP(recorder, request) + + require.Equal(t, http.StatusOK, recorder.Code) + assert.Contains(t, recorder.Body.String(), + `
Environment variable changes take effect at the next deploy or rollback.
`) +} diff --git a/templates/app_detail.html b/templates/app_detail.html index eb6f146..a8a3b62 100644 --- a/templates/app_detail.html +++ b/templates/app_detail.html @@ -178,7 +178,7 @@ -⚠ Container restart needed after env var changes.
+Environment variable changes take effect at the next deploy or rollback.