fix: Fixed issue with upgrade openresty failed - #13470
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes OpenResty upgrade/rollback failures caused by missing WEBSITE_DIR during env rendering (refs #13469), by ensuring WEBSITE_DIR is always derived and normalized to an absolute path during upgrade env generation.
Changes:
- Update
renderUpgradeEnvto accept*model.AppInstall, allowing it to persist env adjustments (notablyWEBSITE_DIR) back intoinstall.Envfor OpenResty upgrades. - Preserve selected OpenResty build-related env keys from the original
.envand ensureWEBSITE_DIRis set (fallback to settings) and absolute.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 40bb4b6871
ℹ️ 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".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (1)
agent/app/service/app_upgrade.go:709
renderUpgradeEnvnow parses the existing.envcontent for all upgrades and returns an error if parsing fails. Previously,.envparsing wasn't required for non-OpenResty upgrades (and OpenResty parsing was effectively best-effort), so a user-edited/legacy.envthat Docker Compose can still tolerate could now block upgrades entirely. Consider treating original env parsing as best-effort (fall back to empty map on parse errors), or scoping parsing to the OpenResty-specific branch where it's actually needed.
if len(original) > 0 {
var err error
originalEnv, err = godotenv.UnmarshalBytes(original)
if err != nil {
return nil, err
Refs #13469