Skip to content
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

Merged
merged 34 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
05b72ee
Copy over the "inspect Drupal 7" source code from AMA.
Jun 13, 2023
5d00739
Adjust namespaces.
wimleers Jun 13, 2023
c1686f6
Mark this namespace as not needing autowiring.
wimleers Jun 13, 2023
d9d2b7b
Copy over the "recommendations and how to generate a Drupal 9+ projec…
Jun 14, 2023
aca3ba3
Adjust namespaces.
wimleers Jun 14, 2023
3b2dc98
Adjust for stricter `phpcs` configuration. Loving the removal of so m…
wimleers Jun 14, 2023
e37555a
Add new `app:new:from:drupal7` command. Include default `config.json`…
wimleers Jun 14, 2023
a9c7307
Copy over the unit tests from AMA.
Jun 14, 2023
91e0c8f
Adjust namespaces.
wimleers Jun 14, 2023
7919758
Adjust for stricter `phpcs` configuration. Loving the removal of so m…
wimleers Jun 14, 2023
32ad92e
`composer require --dev phpspec/prophecy-phpunit ^2.0`
wimleers Jun 14, 2023
bfcfccc
Copy over the integration tests' fixtures + infrastructure from AMA.
Jun 15, 2023
fc6d16e
Adjust for stricter `phpcs` configuration.
wimleers Jun 15, 2023
0cedae0
Expand the default recommendations to allow upcoming integration test…
wimleers Jun 15, 2023
c18efc3
Allow tests to override the inspector used, because setting up a real…
wimleers Jun 15, 2023
733b5c5
The `VERSION` constant can only be made available if it is possible t…
wimleers Jun 15, 2023
f14401a
Integration test for `app:new:from:drupal7` command, tested on 4 diff…
wimleers Jun 15, 2023
d209483
Adjust expectations of `KernelTest` to expect one new entry in `acli …
wimleers Jun 15, 2023
e1385da
`phpstan`
wimleers Jun 15, 2023
5ec7893
Ignore `Drupal7SiteInspector` in code coverage checks.
wimleers Jun 15, 2023
11abf52
Add a silly unit test just to make `codecov` happy 🤷‍♂️
wimleers Jun 16, 2023
c656169
Allow specifying `--recommendations`.
wimleers Jun 16, 2023
d8034fe
Copy over the path processing from AMA.
wimleers Jun 16, 2023
987ce00
Allow specifying `--stored-analysis`, this removes the need for using…
wimleers Jun 16, 2023
9a0814b
`phpunit` expects `@covers` annotations to have differently shaped va…
wimleers Jun 19, 2023
e22a60b
Increase `NewFromDrupal7Command` code coverage by explicitly specifyi…
wimleers Jun 19, 2023
7d88c51
Move two `static` helper methods from `NewFromDrupal7Command` to `Dru…
wimleers Jun 19, 2023
a694e0e
Attempt to make this pass on Windows.
wimleers Jun 19, 2023
da056f6
`strpos($location, "/") === 0` is not a valid way to detect absolute …
wimleers Jun 19, 2023
74f9f70
Remove pointless if-test.
wimleers Jun 19, 2023
e9ba9af
Kill 2 more mutants by using PHP named arguments.
wimleers Jun 19, 2023
a9c042e
`\Symfony\Component\Console\Input\InputInterface::hasOption()` cannot…
wimleers Jun 20, 2023
efc6df3
Merge branch 'main' into app-new-from-drupal7
wimleers Aug 8, 2023
c214e45
Merge branch 'main' into app-new-from-drupal7
danepowell Aug 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ignore:
# It's not feasible to spin up a working Drupal 7 site as part of ACLI's test suite.
- src/Command/App/From/SourceSite/Drupal7SiteInspector.php
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"overtrue/phplint": "^9.0",
"phpro/grumphp": "^1.13.0",
"phpspec/prophecy": "^1.10",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-deprecation-rules": "^1.0",
Expand Down
54 changes: 53 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 75 additions & 0 deletions config/from_d7_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"rootPackageDefinition": {
"type": "project",
"description": "Generated by Acquia CLI's app:new:from:drupal7",
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
],
"require": {
"acquia/acquia-migrate-accelerate": "^1@dev",
"composer/installers": "^1.9",
"cweagans/composer-patches": "^1.7",
"drupal/core-composer-scaffold": "9.0.1",
"drupal/core-project-message": "9.0.1",
"drupal/core-recommended": "9.0.1",
"drush/drush": "*"
},
"config": {
"sort-packages": true,
"allow-plugins": {
"composer/installers": true,
"cweagans/composer-patches": true,
"drupal/core-composer-scaffold": true,
"drupal/core-project-message": true
}
},
"conflict": {
"drupal/drupal": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"enable-patching": true,
"patchLevel": {
"drupal/core": "-p2"
},
"drupal-scaffold": {
"locations": {
"web-root": "docroot/"
}
},
"installer-paths": {
"docroot/core": [
"type:drupal-core"
],
"docroot/libraries/{$name}": [
"type:drupal-library"
],
"docroot/modules/contrib/{$name}": [
"type:drupal-module"
],
"docroot/profiles/contrib/{$name}": [
"type:drupal-profile"
],
"docroot/themes/contrib/{$name}": [
"type:drupal-theme"
],
"drush/Commands/contrib/{$name}": [
"type:drupal-drush"
],
"docroot/modules/custom/{$name}": [
"type:drupal-custom-module"
],
"docroot/profiles/custom/{$name}": [
"type:drupal-custom-profile"
],
"docroot/themes/custom/{$name}": [
"type:drupal-custom-theme"
]
}
}
}
}
235 changes: 235 additions & 0 deletions config/from_d7_recommendations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
{
"data": [
{
"package": null,
"note": "Drupal 7's PHP module is not recommended because it poses a severe security risk without very careful configuration and trusted users.",
"replaces": {
"name": "php"
},
"vetted": true
},
{
"package": null,
"note": "Drupal core is now shipped with the JSON:API and REST modules. In most cases, these completely replace the functionality of the services module.",
"replaces": {
"name": "services"
},
"vetted": true
},
{
"package": null,
"note": "The trigger module was removed from Drupal core and does not have a recommended replacement at this time.",
"replaces": {
"name": "trigger"
},
"vetted": true
},
{
"universal": true,
"install": [
"acquia_migrate"
],
"package": "acquia/acquia-migrate-accelerate",
"constraint": "^1@dev",
"vetted": true
},
{
"universal": true,
"package": "acquia/memcache-settings",
"constraint": "^1",
"replaces": {
"name": "memcache"
},
"vetted": true
},
{
"package": "drupal/acl",
"constraint": "1.0.0-beta1",
"patches": {
"Issue #3231034: Use DrupalSqlBase instead of SqlBase class": "https://www.drupal.org/files/issues/2021-09-02/drupalsqlbase_instead_of_sqlbase-3231034-2.patch"
},
"install": [
"acl"
],
"replaces": {
"name": "acl"
},
"vetted": true
},
{
"package": "drupal/acquia_connector",
"constraint": "^3.0.2",
"install": [
"acquia_connector"
],
"replaces": {
"name": "acquia_agent"
},
"vetted": true
},
{
"package": "drupal/acquia_connector",
"constraint": "^3.0.2",
"install": [
"acquia_connector"
],
"replaces": {
"name": "acquia_connector"
},
"vetted": true
},
{
"package": "drupal/acquia_connector",
"constraint": "^3.0.2",
"install": [
"acquia_connector"
],
"replaces": {
"name": "acquia_spi"
},
"vetted": true
},
{
"package": "drupal/acquia_purge",
"constraint": "^1.2",
"install": [
"acquia_purge_geoip"
],
"replaces": {
"name": "acquia_geoip_vary_by_country"
},
"vetted": true
},
{
"package": "drupal/acquia_purge",
"constraint": "^1.2",
"note": "An automatic migration of settings does not make sense for this module. The Acquia Purge module is mostly 'zero configuration'; the only thing you have to do is add an 'Acquia Cloud' purger in the Purge module. See https://git.drupalcode.org/project/acquia_purge/raw/HEAD/INSTALL.md for detailed instructions.",
"install": [
"acquia_purge"
],
"replaces": {
"name": "acquia_purge"
},
"vetted": true
},
{
"package": "drupal/acquia_search",
"constraint": "3.1.0-beta1",
"patches": {
"[AMA_KEEP] Issue #3218089: Could not retrieve data definition for field": "https://www.drupal.org/files/issues/2021-06-09/acquia_search-could_not_find_field-3218089-fix-only.patch"
},
"note": "Acquia Search will migrate configuration and search indexes. User will have to re-index site data once migration is done. See https://docs.acquia.com/acquia-search/activate/indexing/#re-indexing-your-website.",
"install": [
"acquia_search"
],
"replaces": {
"name": "acquia_search"
},
"vetted": true
},
{
"universal": true,
"package": "drupal/core",
"constraint": "9.3.5",
"patches": {
"Issue #3115073: Convert RDF mapping migration to derived migrations": "https://www.drupal.org/files/issues/2020-02-24/core-derived_rdf_mapping_migration-3115073-7.patch",
"Issue #3122649: Derive path alias migrations per entity type (and bundle)": "https://www.drupal.org/files/issues/2021-02-24/core-derive_path_alias_migrations-3122649-41.patch",
"Issue #3096972: The Drupal 7 ThemeSettings source plugin does not check that the destination site has a valid theme to migrate settings into": "https://www.drupal.org/files/issues/2020-05-18/core-theme_settings_migrate_requirement-3096972-36_0.patch",
"Issue #3204212: Convert remaining widget and formatter type migrations to MigrateField plugins": "https://www.drupal.org/files/issues/2021-12-27/3204212-field-migration-widget-formatter-mapping-41--fix-only.patch",
"Issue #3202462: Provide option for contrib modules to map their D6 / D7 field formatter and widget plugin IDs to the equivalent D9 plugin ID": "https://www.drupal.org/files/issues/2021-04-08/core-allow_map_formatter_migration-3202462-8--on-top-of-3204212.patch",
"Issue #3108302: Field formatter & widget settings: fall back to default if missing plugin": "https://www.drupal.org/files/issues/2021-06-10/core-migrate_field_formatter_widget_with_fallback-3108302-45--on-top-of-3202462-8_0.patch",
"Issue #3097336: Improve the DX for migrating content entities: view modes, fields, formatters, widgets etc should be migrated per entity type + bundle": "https://www.drupal.org/files/issues/2021-06-10/core-derived_field_and_field_display_migrations-3097336-85--compatible-with-3202462-6.patch",
"Issue #3198732: Migrating reference fields: target_bundles may never be empty array": "https://www.drupal.org/files/issues/2021-12-27/3198732-28.patch",
"Issue #3115938: Derive block migration per theme and per block plugin type": "https://www.drupal.org/files/issues/2021-06-10/core-derived_block_config_migrations-3115938-21.patch",
"Issue #3123775: Ensure that migrations of entities with file or image fields depend on private/public files migration": "https://www.drupal.org/files/issues/2021-12-27/core-add_file_migration_dependencies-3123775-12--fix-only--do-not-test.patch",
"Issue #2845340: migrate mapping & messages table names are truncated, can lead to incorrect mapping lookups": "https://www.drupal.org/files/issues/2020-06-16/2845340-16.patch",
"Issue #3151979: System file settings migration (d6_system_file and d7_system_file) assumes that allow_insecure_uploads variable is always set": "https://www.drupal.org/files/issues/2020-12-07/3151979-22.patch",
"Issue #3156083: Route migrate process plugin shouldn't assume that the $options variable is always an array": "https://www.drupal.org/files/issues/2020-07-01/core-route_migrate_process_plugin_options-3156083-2--complete.patch",
"Issue #3051251: Existing menu links show validation issues on migration": "https://www.drupal.org/files/issues/2022-01-10/core-derive_menu_link_migrations_per_entity_type-3051251-59.patch",
"Issue #3154156: Improve migration system performance: statically cache DrupalSqlBase::$systemData": "https://www.drupal.org/files/issues/2020-06-23/3154156-2.patch",
"Issue #3156730: Stubs should only be created if the referenced source row actually exists": "https://www.drupal.org/files/issues/2021-06-10/core-create_stub_only_when_matching_source_row_exists--9.2.x--3156730-41.patch",
"Issue #3156733: File migration's \"owner\" user reference should use migration_lookup": "https://www.drupal.org/files/issues/2020-07-03/3156733-2.patch",
"Issue #3165813: Undefined index: text_processing in Drupal\\text\\Plugin\\migrate\\field\\d7\\TextField": "https://www.drupal.org/files/issues/2020-08-18/3165813-2.patch",
"Issue #3166930: Migrated filters may have invalid/incomplete settings applied": "https://www.drupal.org/files/issues/2020-08-24/3166930-4.patch",
"Issue #3167267: MigrateExecutable should catch not only exceptions, but also fatal errors": "https://www.drupal.org/files/issues/2021-11-04/drupal-3167267-36.patch",
"Issue #3186449: ContentEntity source plugin shouldn't throw exception when the bundle key is missing": "https://www.drupal.org/files/issues/2020-12-08/core-content_entity_source_exception_when_bundle_is_missing-3186449-2.patch",
"Issue #3187334: Drupal 7 color settings migration assumes that theme machine names do not contain underscores": "https://www.drupal.org/files/issues/2020-12-10/core-fix_d7_color_migration-3187334-7.patch",
"Issue #3187419: d7/NodeComplete source plugin adds invalid source \"source_langcode\" for \"content_translation_source\" destination property": "https://www.drupal.org/files/issues/2020-12-09/core-nodecomplete_wrong_source_langcode-3187419-2.patch",
"Issue #3187474: Improve source record count of translation migrate source plugins which use the \"i18n_string\" table": "https://www.drupal.org/files/issues/2020-12-14/core-improve_source_record_count_i18n_string-3187474-9.patch",
"Issue #2985882: Workaround for \"Call to a member function getLabel() after enabling layout_builder\"": "https://www.drupal.org/files/issues/2020-04-08/2985882-field-85.patch",
"Issue #2859314: Highwater condition with unjoined maps skips unprocessed and NEEDS_UPDATE rows": "https://www.drupal.org/files/issues/2021-06-10/2859314-58.patch",
"Issue #3200949: Unpublished entity revisions get published because EntityContentComplete": "https://www.drupal.org/files/issues/2021-03-01/core-allow_migrating_forward_revisions-3200949-9.patch",
"Issue #3204343: Disabling the default search page can make the entire site inaccessible": "https://www.drupal.org/files/issues/2021-03-19/3204343-9.patch",
"Issue #3118262: Calling EntityConfig::import() with multiple destination IDs fails": "https://www.drupal.org/files/issues/2021-12-28/core-fix_entityconfigbase-3118262-52--complete.patch",
"Issue #3213636: Prevent data loss: migrate text fields with conflicting text_processing setting as formatter text fields": "https://gist.githubusercontent.com/zolhorvath/9b8d28df3dd45e3d8a8234e590016aa7/raw/cba7add887d8d20564b1fed45c52ce803575b58d/core-migrate_conflicting_text_fields-3213636-6--9.1.x--fix-and-db-fixture.patch",
"Issue #3218294: Allow altering field value query performed by FieldableEntity": "https://www.drupal.org/files/issues/2021-06-10/core-allow_altering_migrate_field_value_query-3218294-2.patch",
"Issue #3219078: Regression: multilingual taxonomy term migrations are failing if user tries to migrate from Drupal 7.81+ and Entity Translation 7.x-1.1": "https://www.drupal.org/files/issues/2021-11-19/core-fix_et_mapping_of_taxonomy_terms-3219078-13.patch",
"Issue #3226744: Derive statistics module migrations per node type": "https://www.drupal.org/files/issues/2021-10-13/core-derive_statistics_module_migrations-3226744-22.patch",
"Issue #3227361: Fix \\Drupal\\migrate\\Plugin\\migrate\\source\\SqlBase::initializeIterator()'s cross-database joining broken when using particular DB/table names": "https://www.drupal.org/files/issues/2021-08-11/3227361-13.patch",
"Issue #2329253: Allow the ChangedItem to skip updating": "https://www.drupal.org/files/issues/2021-09-29/2329253-drupal-allow-changeditem-skipping-78-9.3.patch",
"Issue #3052115: Mark an entity as 'syncing' during a migration 'update' and possibly test syncing semantics": "https://www.drupal.org/files/issues/2021-11-18/core-migrate_sync-3052115--31--content--fix-only.patch",
"Remove certain default content entity types (node, block_content, taxonomy_term, comment) from Drupal's Standard install profile": "https://gist.githubusercontent.com/narendra-drupal/85ba9ba92816cc53a0cad0caf2bcd079/raw/58572a11df2d30425b6ade68fb7c3030574beee3/standard-remove_default_content_entity_types.patch"
},
"vetted": true
},
{
"package": "drupal/core",
"constraint": "*",
"install": [
"media_library"
],
"universal": true,
"vetted": true
},
{
"package": "drupal/core",
"constraint": "*",
"note": "This module overrides 'administrative listing' pages in Drupal 7 site with equivalent Views for superior usability. Drupal core now contains a superset of its functionality.",
"install": [
"views"
],
"replaces": {
"name": "admin_views"
},
"vetted": true
},
{
"package": "drupal/core",
"constraint": "*",
"note": "This module overrides 'administrative listing' pages in Drupal 7 site with equivalent Views for superior usability. Drupal core now contains a superset of its functionality.",
"install": [
"views"
],
"replaces": {
"name": "admin_views_system_display"
},
"vetted": true
},
{
"package": "drupal/core",
"constraint": "*",
"note": "This module is a little helper to maintain an administrator role which has all available permissions for a Drupal 7 site. Drupal core now contains a superset of its functionality.",
"replaces": {
"name": "adminrole"
},
"vetted": true
},
{
"package": "drupal/core",
"constraint": "*",
"install": [
"aggregator"
],
"replaces": {
"name": "aggregator"
},
"vetted": true
},
{
"universal": true,
"package": "drupal/mysql56",
"constraint": "^1",
"vetted": true
}
]
}
Loading
Loading