Repository navigation
refactor: use ddev composer create-project in the code, for #6920 - #7027
Conversation
|
Download the artifacts for this pull request:
See Testing a PR. |
|
I know this is 100% great but it touches so many things I'll have to spend a little time with it. |
|
The "solution" section of the linked issue starts
Is 43% enough? I'm worried that over half of users are still on earlier versions. |
|
I can update everything for now without touching This way, it will be an easy switch in the future, allowing us to make changes step by step. |
63e7e99 to
4b093d6
Compare
ddev composer create-project everywhere, fixes #6920ddev composer create-project in the code, for #6920
|
Thanks, @GuySartorelli! The changes made here should be easy to understand now, and it will be much simpler to update our quickstarts later without needing to review a massive PR. |
|
And note that the changes to the quickstart don't go to "stable", the only place we expect them to show up, until the next release (late March, hopefully). Today's situation: https://app.amplitude.com/analytics/share/a0fde21314e34378831943af7f9dd022 |
ChloeSartorelli
left a comment
There was a problem hiding this comment.
Looks good to me, thanks!
…hand ## Short Summary (TL;DR) The all-project-types job is the only CI job that runs tests with `GOTEST_SHORT` unset, and it ran a hand-kept list that had fallen behind, so 16 tests that skip or shrink under `GOTEST_SHORT` never ran in full anywhere. The list is now generated from the tests themselves, so it can't fall behind again. ## The Issue Found while working on ddev#7904, which changes `TestDebugRebuildCmd`: CI logs show `--- SKIP: TestDebugRebuildCmd` in every job, because Buildkite and `test-reusable.yml` set `GOTEST_SHORT=16` and apache-fpm sets `5`. The list came from ddev#6693 and broke in three ways: - ddev#7027 renamed `TestComposerCreateCmd` to `TestComposerCreateProjectCmd`, so that entry has matched nothing since. - ddev#8028 added `GOTEST_SHORT` skips to `TestDebugRebuildCmd`, `TestDdevImportDB`, `TestDdevRestoreSnapshot`, `TestProcessHooks`, and `TestWebserverMariaMySQLDBClient`, and later PRs did the same for `TestEphemeralPortsReusedOnRestart` (ddev#7992), `TestRouterPortSubstitutionPersistsAcrossProjects` (ddev#8653), `TestSnapshotUncompressed` (ddev#8704), `TestDebugDeleteVolumeCmd` (ddev#8756), and `TestDdevExportDB` (ddev#8798), none of them updating the list. - `TestComposerVersionConfig`, `TestHttpsRedirection`, `TestMysqlCommand`, `TestDdevStartMultipleHostnames`, and `TestProjectAutocompletionForExecCmd` already did less under `GOTEST_SHORT` when ddev#6693 wrote the list, and weren't on it. ## How This PR Solves The Issue Tests use three `testcommon` helpers instead of reading `GOTEST_SHORT`: `SkipIfGotestShort(t)`, `IsGotestShort(t)`, and `UsesAllTestSites(t)`, a marker for tests that loop over every test site. `.github/workflows/all-project-types-tests.sh` finds the tests that call them and prints the `-run` pattern, and fails if a test other than `TestMain` reads `GOTEST_SHORT` itself. The pattern is anchored, so prefix matches such as every `TestCmdStart*` test or `TestAutocompleteServiceForServiceFlag` no longer ride along; like `TestAppdirAlreadyInUse` and `TestConfigValidate`, which also leave the list, they don't depend on `GOTEST_SHORT` and run in every job. The `GOTEST_SHORT` branches that ddev#8028 made unreachable in `TestComposerCreateProjectCmd` and `TestDdevAllDatabases` are removed. ## Manual Testing Instructions ```bash .github/workflows/all-project-types-tests.sh # Expect ^(TestAutocompletionForDescribeCmd|...|TestWriteDrushConfig)\b with the 42 tests below ``` Adding `if os.Getenv("GOTEST_SHORT") != "" { t.Skip() }` to any test makes the script print that file and line and exit non-zero. ## Automated Testing Overview In the all-project-types job, the "Compute TESTARGS" step of `prepare-testargs` should print a `-run '^(...)\b'` pattern with exactly these 42 tests, and the test log should show each of them running, none skipped because of `GOTEST_SHORT`: ```text TestAutocompletionForDescribeCmd TestAutocompletionForStartCmd TestAutocompletionForStopCmd TestAvailableUpdates TestCmdDescribe TestCmdDescribeAppFunction TestCmdDescribeAppUsingSitename TestCmdList TestCmdStart TestCmdStop TestComposerCreateProjectCmd TestComposerVersionConfig TestConfigDatabaseVersion TestDdevAllDatabases TestDdevExportDB TestDdevFullSiteSetup TestDdevImportDB TestDdevImportFiles TestDdevImportFilesCustomUploadDir TestDdevImportFilesDir TestDdevRestoreSnapshot TestDdevStartMultipleHostnames TestDdevUploadDirNoPackage TestDdevXdebugEnabled TestDdevXhprofPrependEnabled TestDdevXhprofXhguiEnabled TestDebugDeleteVolumeCmd TestDebugRebuildCmd TestEphemeralPortsReusedOnRestart TestGetApps TestGetAppsEmpty TestHardenedStart TestHttpsRedirection TestMysqlCommand TestPHPConfig TestPHPWebserverType TestProcessHooks TestProjectAutocompletionForExecCmd TestRouterPortSubstitutionPersistsAcrossProjects TestSnapshotUncompressed TestWebserverMariaMySQLDBClient TestWriteDrushConfig ``` Some of the 16 tests that never ran in full may fail after being skipped this long; this PR's run is where that should show up. 🤖 Developed with assistance from [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…hand ## Short Summary (TL;DR) The all-project-types job is the only CI job that runs tests with `GOTEST_SHORT` unset, and it ran a hand-kept list that had fallen behind, so 16 tests that skip or shrink under `GOTEST_SHORT` never ran in full anywhere. The list is now generated from the tests themselves, so it can't fall behind again. ## The Issue Found while working on ddev#7904, which changes `TestDebugRebuildCmd`: CI logs show `--- SKIP: TestDebugRebuildCmd` in every job, because Buildkite and `test-reusable.yml` set `GOTEST_SHORT=16` and apache-fpm sets `5`. The list came from ddev#6693 and broke in three ways: - ddev#7027 renamed `TestComposerCreateCmd` to `TestComposerCreateProjectCmd`, so that entry has matched nothing since. - ddev#8028 added `GOTEST_SHORT` skips to `TestDebugRebuildCmd`, `TestDdevImportDB`, `TestDdevRestoreSnapshot`, `TestProcessHooks`, and `TestWebserverMariaMySQLDBClient`, and later PRs did the same for `TestEphemeralPortsReusedOnRestart` (ddev#7992), `TestRouterPortSubstitutionPersistsAcrossProjects` (ddev#8653), `TestSnapshotUncompressed` (ddev#8704), `TestDebugDeleteVolumeCmd` (ddev#8756), and `TestDdevExportDB` (ddev#8798), none of them updating the list. - `TestComposerVersionConfig`, `TestHttpsRedirection`, `TestMysqlCommand`, `TestDdevStartMultipleHostnames`, and `TestProjectAutocompletionForExecCmd` already did less under `GOTEST_SHORT` when ddev#6693 wrote the list, and weren't on it. ## How This PR Solves The Issue Tests use three `testcommon` helpers instead of reading `GOTEST_SHORT`: `SkipIfGotestShort(t)`, `IsGotestShort(t)`, and `UsesAllTestSites(t)`, a marker for tests that loop over every test site. `.github/workflows/all-project-types-tests.sh` finds the tests that call them and prints the `-run` pattern, and fails if a test other than `TestMain` reads `GOTEST_SHORT` itself. The pattern is anchored, so prefix matches such as every `TestCmdStart*` test or `TestAutocompleteServiceForServiceFlag` no longer ride along; like `TestAppdirAlreadyInUse` and `TestConfigValidate`, which also leave the list, they don't depend on `GOTEST_SHORT` and run in every job. The `GOTEST_SHORT` branches that ddev#8028 made unreachable in `TestComposerCreateProjectCmd` and `TestDdevAllDatabases` are removed. ## Manual Testing Instructions ```bash .github/workflows/all-project-types-tests.sh # Expect ^(TestAutocompletionForDescribeCmd|...|TestWriteDrushConfig)\b with the 42 tests below ``` Adding `if os.Getenv("GOTEST_SHORT") != "" { t.Skip() }` to any test makes the script print that file and line and exit non-zero. ## Automated Testing Overview In the all-project-types job, the "Compute TESTARGS" step of `prepare-testargs` should print a `-run '^(...)\b'` pattern with exactly these 42 tests, and the test log should show each of them running, none skipped because of `GOTEST_SHORT`: ```text TestAutocompletionForDescribeCmd TestAutocompletionForStartCmd TestAutocompletionForStopCmd TestAvailableUpdates TestCmdDescribe TestCmdDescribeAppFunction TestCmdDescribeAppUsingSitename TestCmdList TestCmdStart TestCmdStop TestComposerCreateProjectCmd TestComposerVersionConfig TestConfigDatabaseVersion TestDdevAllDatabases TestDdevExportDB TestDdevFullSiteSetup TestDdevImportDB TestDdevImportFiles TestDdevImportFilesCustomUploadDir TestDdevImportFilesDir TestDdevRestoreSnapshot TestDdevStartMultipleHostnames TestDdevUploadDirNoPackage TestDdevXdebugEnabled TestDdevXhprofPrependEnabled TestDdevXhprofXhguiEnabled TestDebugDeleteVolumeCmd TestDebugRebuildCmd TestEphemeralPortsReusedOnRestart TestGetApps TestGetAppsEmpty TestHardenedStart TestHttpsRedirection TestMysqlCommand TestPHPConfig TestPHPWebserverType TestProcessHooks TestProjectAutocompletionForExecCmd TestRouterPortSubstitutionPersistsAcrossProjects TestSnapshotUncompressed TestWebserverMariaMySQLDBClient TestWriteDrushConfig ``` Some of the 16 tests that never ran in full may fail after being skipped this long; this PR's run is where that should show up. 🤖 Developed with assistance from [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since ddev#8234 moved app.Exec to the docker-compose library, Exec returns the command's output instead of writing it to UserOut, so the CaptureUserOut in isValidComposerOption always read an empty string. Every option then failed validation for `run-script`, which dropped `--no-dev` and `-vvv` from the post-root-package-install and post-create-project-cmd runs, and no unknown option was ever rejected for `create-project`. It now reads the stderr that Exec returns, where Composer prints the "option does not exist" error. TestComposerCreateProjectCmd caught this in the all-project-types job, which hadn't run it since ddev#7027 renamed it in March 2025. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Issue
ddev composer create-projecteverywhere #692043% of people are already using v1.24.2 and we expect more people to upgrade to v1.24.3.
https://app.amplitude.com/analytics/share/a0fde21314e34378831943af7f9dd022
How This PR Solves The Issue
Hides
ddev composer createfrom autocompletion andddev help composer.Adds
ddev composer create-projectto autocompletion andddev help composer.Replaces this in the code (excluding quickstarts):
Adds exclusions for ".idea", ".vscode" in addition to ".ddev", ".git", ".tarballs".
Manual Testing Instructions
Automated tests should just pass.
Automated Testing Overview
Release/Deployment Notes