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

Add support for checking core_version_requirement #120

Closed
goba opened this issue Dec 11, 2019 · 1 comment
Closed

Add support for checking core_version_requirement #120

goba opened this issue Dec 11, 2019 · 1 comment

Comments

@goba
Copy link
Sponsor

goba commented Dec 11, 2019

I don't know exactly (a) how this fits into the philosophy of drupal-check and (b) where in the dependencies it would exactly fit. That said, we did a custom check in Upgrade Status in https://www.drupal.org/project/upgrade_status/issues/3080986 for core_version_requirement values. Since many people use drupal-check as a Drupal 9 compatibility checker and its dependencies as Drupal 9 deprecation removal tracking, adding support for checking for core_version_requirement in one of these dependencies would be best.

For reference, in the runtime in Upgrade Status we did mostly this:

+use Composer\Semver\Semver;

[...]
 
+    // Manually add on info file incompatibility to phpstan results.
+    $info = $extension->info;
+    if (!isset($info['core_version_requirement'])) {
+      $result['data']['files'][$extension->getFilename()]['messages'] = [
+        [
+          'message' => 'Add <code>core_version_requirement: ^8 || ^9</code> to ' . $extension->getFilename() . ' to designate that the module is compatible with Drupal 9. See https://www.drupal.org/node/3070687.',
+          'line' => 0,
+        ],
+      ];
+      $result['data']['totals']['errors']++;
+      $result['data']['totals']['file_errors']++;
+    }
+    elseif (!Semver::satisfies('9.0.0', $info['core_version_requirement'])) {
+      $result['data']['files'][$extension->getFilename()]['messages'] = [
+        [
+          'message' => "The current value  <code>core_version_requirement: {$info['core_version_requirement']}</code> in {$extension->getFilename()} is not compatible with Drupal 9.0.0. See https://www.drupal.org/node/3070687.",
+          'line' => 0,
+        ],
+      ];
+      $result['data']['totals']['errors']++;
+      $result['data']['totals']['file_errors']++;
+    }
@mglaman
Copy link
Owner

mglaman commented Feb 4, 2022

I don't think Drupal Check should be responsible for this (anymore) when Upgrade Status can become the tool for stateful inspections.

@mglaman mglaman closed this as completed Feb 4, 2022
@mglaman mglaman unpinned this issue Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants