feat(project): unique COMPOSE_PROJECT_NAME in .env for Docker volumes#1252
Open
RoboShyim (roboshyim) wants to merge 1 commit into
Open
feat(project): unique COMPOSE_PROJECT_NAME in .env for Docker volumes#1252RoboShyim (roboshyim) wants to merge 1 commit into
RoboShyim (roboshyim) wants to merge 1 commit into
Conversation
Docker Compose was deriving the project name from the directory basename, so deleting and recreating a same-named folder (or two projects sharing a basename) reused stale named volumes and skipped the install wizard. - Scaffold --docker writes COMPOSE_PROJECT_NAME=sw-<basename>-<hex> to host .env - Non-docker create still leaves .env empty - flexmigrator.MigrateEnv preserves COMPOSE_PROJECT_NAME in the new .env - Migration wizard ensuring Docker sets the variable when missing - Existing stacks with a name already set are left untouched Closes shopware#1251
6 tasks
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1252 +/- ##
==========================================
+ Coverage 53.63% 53.71% +0.07%
==========================================
Files 303 304 +1
Lines 23325 23392 +67
==========================================
+ Hits 12511 12564 +53
- Misses 10787 10801 +14
Partials 27 27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #1251.
Docker Compose was using the directory basename as the project name, so named volumes (
db-data, …) collided when a project folder was deleted and recreated with the same name (or two trees shared a basename). That madesystem:is-installedsucceed against stale DB data and skip the install wizard.Changes
project create --dockerCOMPOSE_PROJECT_NAME=sw-<basename>-<6hex>to host.env(not.env.local).envstays emptyflexmigrator.MigrateEnvCOMPOSE_PROJECT_NAMEin the new empty.envwhen splitting flex envEnsureComposeProjectNameif missingCompose still runs with
Dir = projectRoot(devtui/compose.go) and picks up.envautomatically — no-p/ composename:key required.Tests
go test ./internal/shop/ ./internal/flexmigrator/ ./internal/devtui/ -run Migration…Checklist
project create --dockerwrites unique name to.env