feat: publish startup warnings for deployment checks - #4739
Conversation
Track actionable warnings per container in the shared data volume, refresh their heartbeat, and remove reports during orderly shutdown.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 91fb2def20
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| echo "Starting Weblate $WEBLATE_VERSION..." | ||
|
|
||
| prepare_runtime_files | ||
| initialize_startup_warning_report "$@" |
There was a problem hiding this comment.
Start the heartbeat before long-running startup work
When startup takes more than five minutes—for example, while run_startup_maintenance performs a large migration—this initializes the only heartbeat before the warning-producing checks, but the heartbeat process is not started until start_supervisord at the end of runserver_main. The report therefore becomes stale and stops appearing in deployment checks during the slow startup, and another container's expiry cleanup can remove it. Start the helper earlier or refresh the heartbeat throughout pre-supervisor startup.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is not a big deal, in most cases the long startup is in the single container, so there will be nothing consuming the checks.
| WEBLATE_DOCKER_WARNING_HOSTNAME=${HOSTNAME:-unknown} | ||
| WEBLATE_DOCKER_WARNING_SERVICE=${WEBLATE_SERVICE:-all} | ||
| WEBLATE_DOCKER_WARNING_MESSAGES= | ||
| if ! mkdir -p "$WEBLATE_DOCKER_WARNING_REPORT"; then |
There was a problem hiding this comment.
Make the shared warning root group-writable
When the shared data volume is reused by containers running different arbitrary UIDs, as supported for OpenShift-style deployments, the first mkdir -p creates .docker-startup-warnings with the normal 0755 mode and ownership of that container's UID. A later container with another UID but the shared root group cannot create its report beneath that directory, so this path prints the initialization error and silently disables warning publication and stale-report cleanup. Create the shared root with group-write permissions consistent with /app/data before creating the per-container directory.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I don't think we actually support such setups.
|
To be merged after WeblateOrg/weblate#21455 so that we can actually test the container. |
Track actionable warnings per container in the shared data volume, refresh their heartbeat, and remove reports during orderly shutdown.