Parent issue: #2337283: Add a composer.json file to every component

Problem/Motivation

Part of the parent parent issue: #1826054: [Meta] Expose Drupal Components outside of Drupal

Each of the \Drupal\Component\ namespaces need their own composer.json file, so that they can eventually be offered to the world as a library.

Proposed resolution

Add the LICENSE.txt, README.txt, TESTING.txt, and composer.json files from the template in this patch: https://www.drupal.org/node/2337283#comment-9706563

Verify the various dependencies of the component, so they can be included as requirements.

Add the component's directory to \Drupal\Tests\ComposerIntegrationTest:: getPaths().

Use composer validate in the component directory to make sure the composer.json file is valid.

Remaining tasks

User interface changes

API changes

Contributor tasks needed
Task Novice task? Contributor instructions Complete?
Create a patch Instructions
Reroll the patch if it no longer applies. Instructions
Update the issue summary noting if allowed during the rc Template
Update the patch to incorporate feedback from reviews (include an interdiff) Instructions
Manually test the patch Novice Instructions
Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standards Instructions

Comments

Mile23 created an issue. See original summary.

mile23’s picture

Title: Add composer.json to \Drupal\Component\Annotation component. » Add composer.json to \Drupal\Component\Assertion component.
rakesh.gectcr’s picture

Status: Active » Needs review
StatusFileSize
new20.72 KB
timofej.dod’s picture

Status: Needs review » Reviewed & tested by the community

Tested locally, patch applied correctly, tests for core passing.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 3: 2600716-1.patch, failed testing.

sdstyles’s picture

Status: Needs work » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 3: 2600716-1.patch, failed testing.

rakesh.gectcr’s picture

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

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/lib/Drupal/Component/Assertion/TESTING.txt
    @@ -0,0 +1,19 @@
    +$ cd ./core
    +$ ./vendor/bin/phpunit --group Assertion
    

    Same test running problem. Should be:

    $ ./vendor/bin/phpunit -c core/ --group Assertion

  2. +++ b/core/lib/Drupal/Component/Assertion/composer.json
    @@ -0,0 +1,15 @@
    +  "description": "Assertion.",
    

    Let's say:

    "Provides runtime assertions similar to those in PHP 7, under PHP 5."

  3. +++ b/core/tests/Drupal/Tests/ComposerIntegrationTest.php
    @@ -53,6 +53,7 @@ protected function getPaths() {
           $this->root . '/core/lib/Drupal/Component/Utility',
    +      $this->root . '/core/lib/Drupal/Component/Assertion',
    

    Alphabetical order, please.

rakesh.gectcr’s picture

Assigned: Unassigned » rakesh.gectcr
rakesh.gectcr’s picture

Status: Needs work » Needs review
StatusFileSize
new20.82 KB
new1.17 KB

@Mile23
I have done the changes

mile23’s picture

Status: Needs review » Needs work

Thanks for sticking with it. :-)

+++ b/core/lib/Drupal/Component/Assertion/TESTING.txt
@@ -0,0 +1,19 @@
+
+$ cd ./core
+$ ./vendor/bin/phpunit --group Assertion

Still needs the test running change. This should be:

$ ./vendor/bin/phpunit -c core/ --group Assertion

naveenvalecha’s picture

StatusFileSize
new20.83 KB

$ ./vendor/bin/phpunit -c core/ --group Assertion

I got the chance to looked at it . The Assertion group is not showing while doing the tests listing ../vendor/bin/phpunit --list-groups when you will list up the stuff.
The group name in InspectorTest.php is Inspector. So this needs a slight changes. Interdiff attached.

$ ./vendor/bin/phpunit -c core/ --group Inspector
PHPUnit 4.8.11 by Sebastian Bergmann and contributors.

................................

Time: 8.69 seconds, Memory: 138.25Mb

OK (32 tests, 74 assertions)

+++ b/core/lib/Drupal/Component/Assertion/TESTING.txt
@@ -0,0 +1,19 @@
+$ cd ./core
+$ ./vendor/bin/phpunit --group Assertion

We need to remove cd here and replace it with
$ ./vendor/bin/phpunit -c core/ --group Inspector

Open questions :

  1. Now changing the group name in InspectorTest.php is 8.0.x eligible ?

P.S. I am getting issues while uploading files on d.o. so not able to upload the patch and interdiff. I have raised the issue for it in drupal_infra #2621028: Getting issues while uploading files to d.o. randomly

naveenvalecha’s picture

StatusFileSize
new536 bytes

Attached interdiff for the above . Seems file upload is a random failure

rakesh.gectcr’s picture

Status: Needs work » Needs review
alexpott’s picture

Version: 8.0.x-dev » 8.1.x-dev
Status: Needs review » Closed (duplicate)

Closing this in favour of a single patch on #2600720: Add composer.json to \Drupal\Component\Datetime component. as all the patches listed on the meta issue are going to conflict.