Persist job history and show model usage stats
Test, build, and deploy ComfyUI Jobs / test-build (push) Successful in 5m14s
Test, build, and deploy ComfyUI Jobs / deploy (push) Successful in 16s
Test, build, and deploy ComfyUI Jobs / browser-test (push) Successful in 1m58s
Test, build, and deploy ComfyUI Jobs / qa-gate (push) Successful in 5s

This commit is contained in:
2026-10-26 17:19:11 +00:00
parent ba34d33308
commit 2f7f2cc375
8 changed files with 252 additions and 6 deletions
+7 -1
View File
@@ -16,9 +16,15 @@ The first run seeds `data/users.json` from `ADMIN_USERNAME` and `ADMIN_PASSWORD`
Gitea Actions deploys `develop`, `qa`, and `main` to the existing ComfyUiPortal target directories and preserves the existing 7002/6002/5002 port contract. On first startup of a fresh data directory, provide `ADMIN_USERNAME` and `ADMIN_PASSWORD` in the deployment host environment. Existing target data is retained during repository cutover.
After validation succeeds, the workflow builds one immutable image tagged with the source commit SHA on the Docker host and publishes it to the Gitea container registry. The deploy stage only pulls that exact image and restarts the service; it does not build. If the SHA-tagged image already exists, the workflow reuses it instead of rebuilding. Configure the masked `REGISTRY_USERNAME` and `REGISTRY_PASSWORD` repository Actions secrets with a Gitea account/token that can write container packages. Compose receives the exact image reference through `IMAGE_REF`, so the same artifact can be redeployed or promoted without rebuilding.
## Persistent job and model history
Each successful `/api/jobs` read synchronises the returned ComfyUI history and currently running job into `data/job-history.json`. The prompt ID is the stable key, so repeated polling and server restarts do not count the same job twice. The deployment Compose files mount `data/` from the environment-specific host directory and the deployment cleanup explicitly preserves it.
The store retains job status, title, timestamps, output count, and the distinct model names extracted from each prompt. Model usage is counted once per model per prompt ID. `GET /api/model-stats` returns the tracked job count and model ranking used by the **Most used models** panel. This endpoint is authenticated and read-only. Removing the environment's `data/job-history.json` intentionally resets the history.
## Automated testing
The project maintains both server tests and Playwright browser tests. The browser suite runs after deployment on develop and qa only; production is never browser-tested automatically. It covers authentication, protected-route redirects, the job monitor's stable states, sign-out, and mobile layout overflow.
The project maintains both server tests and Playwright browser tests. The browser suite runs after deployment on develop and qa only; production is never browser-tested automatically. It covers authentication, protected-route redirects, persistent model statistics, server/job/asset states, Manager UI behavior using mocked control requests, sign-out, and mobile layout overflow.
Configure these masked repository Actions secrets before enabling the browser job: