Enhance container management and UI with version info and fixes - #464
Enhance container management and UI with version info and fixes#464cmyers-mieweb wants to merge 4 commits into
Conversation
PUT /containers/:id no longer enqueues an implicit restart job when env/entrypoint change - a restart happens only when restart:true is sent. The edit form now shows a confirmation modal before saving with restart enabled, and the response/toast tell the user saved changes apply on the next restart.
The Back button linked to '..' which resolves to /jobs (no route). It now returns to the current site's containers list, falling back to /sites.
GET /api/v1/health now includes the startup-cached git version info. New AppFooter shows the version (linked to its commit) plus a Report a bug link that pre-fills the GitHub bug template with the current URL, username, and version.
There was a problem hiding this comment.
Pull request overview
This PR improves the operator/user experience around container changes by (a) making container restarts strictly explicit (no more implicit restarts on config changes), and (b) enhancing the UI with version reporting + easier bug reporting, plus a small navigation improvement on job details.
Changes:
- Backend: update-container no longer enqueues restart jobs due to env/entrypoint changes unless
restart: trueis explicitly provided; addspendingRestartto the update response. - Frontend: adds a global footer showing running version + a prefilled “Report a bug” link; adds a restart confirmation modal on edit when “restart after saving” is enabled; improves jobs “Back” navigation.
- Docs: updates OpenAPI container update endpoint docs to reflect the explicit-restart behavior and
pendingRestart.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| create-a-container/routers/api/v1/index.js | Extends /health response to include cached server version info for the SPA footer. |
| create-a-container/routers/api/v1/containers.js | Makes restart enqueue strictly opt-in; returns pendingRestart and updated messaging. |
| create-a-container/openapi.v1.yaml | Updates container PUT docs to reflect explicit restart behavior and documents pendingRestart. |
| create-a-container/client/src/pages/jobs/JobDetailPage.tsx | Adjusts Back navigation to go to the current site’s containers (or sites list fallback). |
| create-a-container/client/src/pages/containers/ContainerFormPage.tsx | Adds restart confirmation modal and surfaces pending-restart messaging on save. |
| create-a-container/client/src/lib/auth.ts | Adds VersionInfo typing and wires /health’s version into the typed ServerInfo. |
| create-a-container/client/src/app/AppLayout.tsx | Adds the new footer to the app layout. |
| create-a-container/client/src/app/AppFooter.tsx | New footer component with version link + “Report a bug” issue-form prefill. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| toast.success( | ||
| isEdit | ||
| ? pendingRestart | ||
| ? 'Container updated — changes take effect on the next restart' | ||
| : 'Container updated' |
| containerId: { type: integer } | ||
| jobId: { type: integer, nullable: true, description: 'Restart job id, when a restart was enqueued' } | ||
| dnsWarnings: { type: array, items: { type: string } } | ||
| pendingRestart: { type: boolean, description: 'true when env/entrypoint changes were saved but no restart was requested — they apply on the next restart' } | ||
| message: { type: string } |
| isDev: process.env.NODE_ENV !== 'production', | ||
| oidcEnabled: isOidcEnabled(), | ||
| banner, | ||
| // Cached at startup in app.locals (see app.js); the SPA footer shows it. |
There was a problem hiding this comment.
The server-side getVersionInfo relies on the local filesystem the server is running from being a git repository. This assumption does not hold once the software is packaged and deployed to the live system. As it stands, the source of truth for the current version would be the version of the installed deb package, but trying to read that would be overkill. Since the server and client are distributed in the same package, we should bake the version into the client build in the packaging workflow.
- A release is generated with the version in the tag
.github/workflows/release.ymlbuildsimages/builderwhich generates the deb packages- Within
images/builder,make debis ran from the repo root make debdelegates to the Makefile in each major component, the create-a-container Makefile runsnpm buildfor the client componentnpm buildin the client delegates tovite build
https://github.com/mieweb/ozwell-studio also uses vite build and a Github-releases driven versioning. This sets the version in the package.json just before the final build and bakes the value into the final artifact so there is no live-query required.
Implement this same idea in the build workflow here, then remove the existing logic to interogate the version from the local git repo.
| const needsRestart = forceRestart || envChanged || entrypointChanged; | ||
| // Never restart implicitly (issue #449): a restart job is enqueued only | ||
| // when the caller explicitly asks for one. Saved env/entrypoint changes | ||
| // are applied by reconfigure-container.js on the next restart. |
There was a problem hiding this comment.
I know this is doing exactly what the ticket asked for but I don't fully agree with the logic. The real problem with the implicit restart is that if, for example, the admin changed the default container vars, that would queue a restart regardless of the change the user made (possibly even if they made no changes). In reality, the implicit restart is good if the user intentionally changes entrypoint/environment because otherwise they may be left to wonder why their changes didn't take effect. Really there's 2 problems here:
- Invisible (to the user) changes by the admin can make a restart nessecary
- The user is not properly informed of changes requiring a restart
We can hook into this new solution to fix both of these, but we need one more layer on top. We keep this new "no restarts by default" logic to keep admin changes from bleeding into the container lifecycle behavior BUT if the user makes environment or entrypoint changes (or anything else requiring a restart) then some sort of noticable but unobtrusive UI affordance informs the user that this change requires a restart and the "restart" toggle is switched on. The user can still switch this off manually afterwards but another warning (under the toggle maybe) "this change requires a restart but a restart will not be performed".
…start-requiring edits Per PR #464 review (runleveldev): - Version: the deployed system has no git checkout, so getVersionInfo (runtime git interrogation) is removed. The packaging build now writes the release version into the client package.json (new 'node' semver format in package-version, applied in the create-a-container Makefile build target) and vite bakes it into the bundle as __APP_VERSION__. The footer shows it (dev builds show 'Development build') and /health no longer returns version. - Restart UX: saving still never restarts implicitly, but when the user edits env vars or the entrypoint the 'Restart after saving' toggle switches on automatically; turning it back off shows an inline warning that the change only applies on the next restart. Also per copilot review: the save toast now uses the server's message so update-status wording lives in one place.
Recent changes in commit
|
Resolves:
#358
#449
#453
This pull request introduces two main improvements: (1) a new application footer that displays the running version and provides a "Report a bug" link pre-filled with contextual information, and (2) a significant change to container update behavior, ensuring containers are only restarted when the user explicitly requests it, never implicitly. It also improves user feedback and API documentation to reflect this behavior, and enhances navigation in the job detail page.
User Interface Enhancements:
AppFootercomponent to the UI, which displays the running version (linked to its GitHub commit) and a "Report a bug" link that pre-fills the GitHub issue template with the current URL, username, and version. The footer is now included in the main layout. (AppFooter.tsx,AppLayout.tsx,auth.ts,index.js) [1] [2] [3] [4] [5] [6]JobDetailPage.tsx) [1] [2] [3]Container Update and Restart Behavior:
containers.js,openapi.v1.yaml) [1] [2] [3]pendingRestartflag when changes are saved but not yet applied, and the user interface displays clear feedback when changes require a restart to take effect. (containers.js,ContainerFormPage.tsx,openapi.v1.yaml) [1] [2] [3] [4] [5]ContainerFormPage.tsx) [1] [2] [3] [4]API and Documentation Updates:
pendingRestartresponse property. (openapi.v1.yaml) [1] [2] [3]/healthendpoint now includes version information for the frontend footer. (index.js) [1] [2]