-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New command: app:new:from:drupal7
#1543
Conversation
…t from it" source code from AMA.
…uch boilerplate! 😄
… and `recommendations.json`.
…uch boilerplate, AGAIN! 😄
…s to actually test the full range of possibilities.
… Drupal 7 instance is impractical in tests.
…o bootstrap Drupal 7. That cannot happen int ests, so adjust the logic in `NewFromDrupal7Command` slightly.
…erent Drupal 7 sites 👍
fbae5c8
to
e1385da
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1543 +/- ##
============================================
- Coverage 91.77% 91.76% -0.02%
- Complexity 1663 1809 +146
============================================
Files 110 124 +14
Lines 5957 6470 +513
============================================
+ Hits 5467 5937 +470
- Misses 490 533 +43
☔ View full report in Codecov by Sentry. |
Hey Wim! Thanks for your contribution. @danepowell is out for ~2 weeks so expect radio silence for a little while. Making visible to @mikemadison13 for AMA efforts. |
Yep, I'm aware 😊 |
🤷 Looks like GitHub Actions is broken today… |
… reflection in the integration test.
…ng `--recommendations`.
…pal7SiteInspector` to increase the reported code coverage; these only operate on live Drupal 7 sites so are by definition untestable.
🥳 91.58% of target 91.56% 😄 |
Aha, looks like there was a failure on Windows too.
Attempted a fix. |
…paths on Windows: it fails on `D:/a/cli/cli/config/…`.
👆 Now paths were formatted in a way accepted by Windows. But our logic to detect absolute paths vs not was wrong. That's what da056f6 is aiming to fix. |
🥳 Green! For fun, I also checked the mutation testing output, which I've never before seen. It's pretty cool, and it shows that the tests catch most things:
Most of these are for the untestable "inspect a live Drupal 7 site" code path. But not all. One of them is pretty silly and is only due to a limitation in PHP <8:
Just switching to PHP >=8's named arguments fixes this! |
Entire codebase with this PR:
☝️ this PR means a net improvement to the mutation score per my previous comment: ~77% vs ~65%. 😊 (Would be cool to have a target to not regress against this too?) |
a9c042e fixes a bug that I found while updating an integration test of a private repo to rely on the new ACLI command being introduced here. That integration test does point to a real, live Drupal 7 site. It crashed like so:
|
@wimleers this looks good to me, but it's still in draft state. Is this ready for review? |
Adam mentioned that we need to wait for approval on this. |
There's absolutely no reason left that it's in draft state 😅 I should've marked this as ready for review ever since #1543 (comment) — sorry! |
The actual tests are still green after merging in upstream, but:
Back in June, the target was |
Motivation
ACLI already has a
app:new:local
command that spins up a brand new Drupal project.Wouldn't it be great if it also helped you spin up a new Drupal 9+ project that helps migrating from Drupal 7?
Proposed changes
Introduce
acli app:new:from:drupal7
.All code has been battle-hardened over years of use in production on Acquia Cloud. Please check the commits in sequence, because I designed them to tell a gradual story:
Until the full set of recommendations is released, this will use only a minimal set of recommendations, primarily consisting of some Drupal 7 → 9 migration recommendations for Acquia modules.
This is a necessary step in the way of open sourcing https://www.acquia.com/products/drupal-cloud/acquia-migrate-accelerate.
Alternatives considered
N/A
Testing steps
Point it at a Drupal 7 site and observe that it generates a valid
composer.json
that results in an installable Drupal 9+ site. See the integration tests for various sample Drupal 7 sites attests/phpunit/src/Commands/App/NewFromDrupal7CommandTest.php
, with fixtures attests/fixtures/drupal7
.