Say env var changes take effect at the next deploy or rollback (closes #255)
The hint under the app page's environment variable editor asked for a container restart. Environment variables are set when a container is created, and upaas's restart stops and starts the same container, so it keeps the old values; deploy and rollback each create a new container. The hint now says so in one sentence, styled with badge-warning, the warning style the page already uses: its old text-amber-600 class is not in the built stylesheet. A handler test renders the app page and checks the hint. Model: opus-5-5
This commit is contained in:
@@ -20,6 +20,11 @@ regress.
|
|||||||
|
|
||||||
# Completed Steps
|
# 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
|
- 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
|
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
|
app's container starts and to leave an existing one alone, so nobody has to
|
||||||
|
|||||||
@@ -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(),
|
||||||
|
`<p class="badge-warning mt-1">Environment variable changes take effect at the next deploy or rollback.</p>`)
|
||||||
|
}
|
||||||
@@ -178,7 +178,7 @@
|
|||||||
<button type="submit" class="btn-primary text-sm">Save</button>
|
<button type="submit" class="btn-primary text-sm">Save</button>
|
||||||
<button type="button" @click="editIdx = -1" class="text-gray-500 hover:text-gray-700 text-sm">Cancel</button>
|
<button type="button" @click="editIdx = -1" class="text-gray-500 hover:text-gray-700 text-sm">Cancel</button>
|
||||||
</form>
|
</form>
|
||||||
<p class="text-xs text-amber-600 mt-1">⚠ Container restart needed after env var changes.</p>
|
<p class="badge-warning mt-1">Environment variable changes take effect at the next deploy or rollback.</p>
|
||||||
</td>
|
</td>
|
||||||
</template>
|
</template>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user