Comments

lomasr created an issue. See original summary.

lomasr’s picture

StatusFileSize
new1.93 KB

Added a patch for core field type modules.Please review thanks.

lomasr’s picture

Status: Active » Needs review
lomasr’s picture

StatusFileSize
new1.93 KB

typo error. adding the patch again.

The last submitted patch, 2: 2821499_2.patch, failed testing.

Andy_D’s picture

Assigned: Unassigned » Andy_D
Issue tags: +mssprintjan17

Will review

Andy_D’s picture

Status: Needs review » Reviewed & tested by the community

Patch applies fine. I did a quick search of the core modules folder and found 151 matches in 142 files so there must be similar issues for other modules. Will scan the queue and raise issues as applicable. https://www.drupal.org/node/1935708 should probably be updated in line with this issue too.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

If we do this ewe do this all in one go. Doing this per module is against the scoping advice. See https://www.drupal.org/core/scope for guidelines and examples for Drupal core issue scope.

Andy_D’s picture

@alexpott: no problem, I am happy to apply this to all core modules. Are you happy with reviewing 142 patch files?

alexpott’s picture

@Andy_D it would be good to have some idea of what we gain. One thing I can see is a good example but when the dependency is inside the same project the project part is not required. This information is primarily for testbot to sort out dependencies.

Andy_D’s picture

Component: field system » other
StatusFileSize
new19.53 KB

Re-rolled patch to encompass all relevant modules. Note: I have ignored tests and sub-modules.

Andy_D’s picture

StatusFileSize
new15.02 KB

Well that didn't go well. SimplyTest.Me couldn't even build due to missing dependencies on profiles. Removed and re-rolled patch.

Andy_D’s picture

Assigned: Andy_D » Unassigned
Andy_D’s picture

Status: Needs work » Needs review
alexpott’s picture

We'd have to do all the test modules too.

The last submitted patch, 11: namespaced_dependencies-2821499-11.patch, failed testing.

Andy_D’s picture

Assigned: Unassigned » Andy_D
Status: Needs review » Needs work

Re-re-rolling as I have all set-up, ready to go.

Andy_D’s picture

Status: Needs work » Needs review
StatusFileSize
new59.2 KB

Try this bad boy!

Andy_D’s picture

Assigned: Andy_D » Unassigned
Andy_D’s picture

Hiding previous patches

sophie.sk’s picture

Status: Needs review » Reviewed & tested by the community

Patch applies cleanly. Tested by enabling some of the changed modules (forum, content moderation) and they both enabled and configured correctly.

Marking as RTBC again.

alexpott’s picture

@Andy_D can you relate the coder issue to this one. We need to postpone on getting that done and agreed. So if we do this we don't introduce regressions.

Andy_D’s picture

@alexpott Issue added as requested. Thanks again for your help on this.

alexpott’s picture

Status: Reviewed & tested by the community » Postponed

So until #2842706: Add a test for dependencies for *.info.yml files. in added to coder we can't really do this because it will be super simple to regress.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mtodor’s picture

One consideration. *.info.yml files for profiles should be adjusted too.

When I run code sniffer provided in #2842706: Add a test for dependencies for *.info.yml files. I get following issue:

FILE: ...sites/drupal_2821499/core/profiles/standard/standard.info.yml
----------------------------------------------------------------------
FOUND 0 ERRORS AND 33 WARNINGS AFFECTING 33 LINES
----------------------------------------------------------------------
  8 | WARNING | All dependencies must be prefixed with the project
    |         | name, for example "drupal:"
  9 | WARNING | All dependencies must be prefixed with the project
    |         | name, for example "drupal:"

When I try (just for first module) to set prefix I get following error during installation:

Required modules not found.
The following modules are required but were not found. Move them into the appropriate modules subdirectory, such as /modules. Missing modules: Drupal:node

I don't know is there already issue for that or it should be solved here.

mile23’s picture

Status: Postponed » Needs work
andypost’s picture

Lal_’s picture

StatusFileSize
new59.19 KB

Rerolled and works perfectly on 8.4.x

Lal_’s picture

Status: Needs work » Needs review
kporras07’s picture

I'm not sure how to test this. I applied the patch and reinstalled site and it works. If my testing is ok, this could be marked as RTBC.

andypost’s picture

Status: Needs review » Postponed

I prefer issues in #28 solved first

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

afi13’s picture

Status: Postponed » Needs work
anya_m’s picture

StatusFileSize
new14.02 KB

Rerolled for 8.7.x

pazhyn’s picture

Status: Needs work » Needs review
andypost’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +KharkivCS

Good to go, only sniffers issue from #28 needs to be committed

alexpott’s picture

I would still argue that we need the coding standards issues to land so we can enable the rule in core in this issue.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 37: 2821499-37.patch, failed testing. View results

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

ravi.shankar’s picture

Status: Needs work » Needs review
StatusFileSize
new13.52 KB

Here is re-roll of patch #37

bbombachini’s picture

The patch applied evenly and it's working as expected. Moving to reviewed.

bbombachini’s picture

Status: Needs review » Reviewed & tested by the community
mile23’s picture

#2842706: Add a test for dependencies for *.info.yml files. is marked fixed and added to the 8.x-3.x branch in January of 2017, but that sniff is not present in coder 3.7, released December 2019.

So we can't add it to phpcs.xml.dist, per #40.

Is it maybe a victim of that time someone deleted the github for Coder?

mile23’s picture

Status: Reviewed & tested by the community » Needs work

Turns out the sniff was moved in #2854781: NamespacedDependencySniff can have false positives for custom modules.

So we need to add the DrupalPractice.InfoFiles.NamespacedDependency sniff to core.phpcs.yml in order to prevent regressions, per #40.

tapaswini sahoo’s picture

Assigned: Unassigned » tapaswini sahoo
tapaswini sahoo’s picture

Assigned: tapaswini sahoo » Unassigned
jungle’s picture

Edited: Sorry, self-referenced

jungle’s picture

Title: Use namespaced dependencies in .info.yml (field types modules) » Use namespaced dependencies in all .info.yml

Just closed #3116077: All dependencies must be prefixed with the project name as this one was filed earlier. Even though both expanded the scope in the middle. Changing the title to meet the scope.

jungle’s picture

Issue tags: +Needs reroll

Would be great having a new patch combining the patch from #3116077 and here for further review. For this purpose, adding a Needs reroll tag

leolandotan’s picture

I'm working on re-rolling this issue at Drupal Camp Manila 2020.

leolandotan’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll

I could apply the latest patch cleanly against the latest 8.9.x codebase, so no reroll is needed. Removing the Needs reroll tag.

Hope everything is in order.

Thank you!

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

bbombachini’s picture

Re-rolled patch for 9.1.x

shaktik’s picture

Patch #58 LGTM + 1 RTBC

jhodgdon’s picture

Status: Needs review » Needs work

This patch is not correct. Something happened... The patch in #29 was correct. The "reroll" in #37, and all the patches since then, are incorrect.

The project should be "drupal" everywhere, not things like

+++ b/core/modules/config/tests/config_install_fail_test/config_install_fail_test.info.yml
@@ -4,4 +4,4 @@ package: Testing
 version: VERSION
 core: 8.x
 dependencies:
-  - drupal:config_test
+  - config_test:config_test
jungle’s picture

StatusFileSize
new9.4 KB

Let's start with a newer patch from the duplicate issue #3116077, comment #18, by @vsujeetkumar. Just renamed the patch and reuploading here.

jungle’s picture

The phpcs snifif existed is DrupalPractice.InfoFiles.NamespacedDependency probably.

jungle’s picture

StatusFileSize
new3.78 KB

Rerolled from #61 partially, -- dropped conflicts.

nikitagupta’s picture

StatusFileSize
new6.98 KB

Re-rolled patch for 9.1.x

nikitagupta’s picture

StatusFileSize
new6.21 KB
shaktik’s picture

Assigned: Unassigned » shaktik
nikitagupta’s picture

Assigned: shaktik » nikitagupta
nikitagupta’s picture

as per as drupal naming convention https://www.drupal.org/docs/8/creating-custom-modules/let-drupal-8-know-... dependencies should be like {module}:{submodule}.in case of failed test cases "Failed asserting that exception of type "Drupal\Core\Extension\ModuleUninstallValidatorException" is thrown." array return project name and module name for the installation of the module, but test cases work only on the name.

nikitagupta’s picture

Assigned: nikitagupta » Unassigned
Status: Needs work » Needs review
Rkumar’s picture

Status: Needs review » Needs work

I am not able to understand what's h going on here.
The huge differences between the sizes of the patch. As the title mentioned it should for all info.yml.
Please help me to understand the journey from #29 to #68

jungle’s picture

Title: Use namespaced dependencies in all .info.yml » Enable phpcs rule DrupalPractice.InfoFiles.NamespacedDependency
Status: Needs work » Needs review
StatusFileSize
new6.24 KB
new2.55 KB

Re #70 changing the title that it's enough to make sense to you, I think, and 2821499-71-test-only.patch will show you how many to fix.

I do not think an interdiff is necessary, so ignored on purpose.

alexpott credited barone.

alexpott’s picture

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Patch looks good, 21 issues in the test-only patch, all fixed in the green patch.

xjm’s picture

Saving issue credit for reviewers. #37 and #44 weren't correct -- please make sure to understand the goal of the issue before submitting a patch. :) Thanks to everyone who took the time to try and understand this issue and sorry that it was confusing!

xjm credited quietone.

xjm’s picture

More credits from the other issue.

  • xjm committed 7ff1179 on 9.1.x
    Issue #2821499 by jungle, Andy_D, nikitagupta, lomasr, bbombachini,...

  • xjm committed 3ca7552 on 9.0.x
    Issue #2821499 by jungle, Andy_D, nikitagupta, lomasr, bbombachini,...
xjm’s picture

Title: Enable phpcs rule DrupalPractice.InfoFiles.NamespacedDependency » [backport] Enable phpcs rule DrupalPractice.InfoFiles.NamespacedDependency
Version: 9.1.x-dev » 8.9.x-dev
Category: Bug report » Task
Status: Reviewed & tested by the community » Fixed

It looks like most of the non-test modules as well as plenty of test modules were addressed in #2798891: Define project dependencies in core module .info files, and just these few were either missed or have crept in since. It's a good thing we have the coder rule now for that reason.

Committed to 9.1.x and cherry-picked to 9.0.x. I ran composer run phpcs -- -p against both branches to ensure they were passing with the new rule.

The patch did not cherry-pick cleanly to 8.9.x, so needs a backport.

xjm’s picture

Status: Fixed » Patch (to be ported)
jungle’s picture

Assigned: Unassigned » jungle

On it, thanks for the RTBC @longwave, and thanks for committing @xjm!

jungle’s picture

StatusFileSize
new2.41 KB

A test only patch first

jungle’s picture

Assigned: jungle » Unassigned
Status: Patch (to be ported) » Needs review
StatusFileSize
new5.97 KB

22 to fix from #86

jungle’s picture

The sniff is available in 8.8.x, the coder version locked is 8.3.6 -- not the latest, If it's necessary to backport this to 8.8.x, I am happy to make a new patch. But I will not do it without approval.

jungle’s picture

Another random failure? Requeued.

Status: Needs review » Needs work

The last submitted patch, 87: 2821499-87.patch, failed testing. View results

jungle’s picture

Status: Needs work » Needs review
StatusFileSize
new6.8 KB
new844 bytes

Fixing the test.

quietone’s picture

Status: Needs review » Fixed

Since Bugfix support for Drupal 8.9.x is restricted to selected low-disruption major and critical bug-fixes and this was comitted to Drupal 9, changing status to Fixed.

alexpott’s picture

Title: [backport] Enable phpcs rule DrupalPractice.InfoFiles.NamespacedDependency » Enable phpcs rule DrupalPractice.InfoFiles.NamespacedDependency

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

jonathan1055’s picture

Setting parent as this commit added a DrupalPractice sniff to phpcs.xml.dist