Page MenuHomeDevCentral

Avoid Phabricator URL in classes constructors
ClosedPublic

Authored by dereckson on Aug 24 2016, 00:30.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 16, 05:12
Unknown Object (File)
Thu, Dec 12, 18:34
Unknown Object (File)
Wed, Dec 11, 14:17
Unknown Object (File)
Wed, Dec 11, 14:17
Unknown Object (File)
Wed, Dec 11, 14:17
Unknown Object (File)
Wed, Dec 11, 14:01
Unknown Object (File)
Wed, Dec 11, 13:41
Unknown Object (File)
Wed, Dec 11, 13:02
Subscribers

Details

Summary

The notifications center works with gates (services)
and doors (services instances).

b42260e53626 introduced a notifications:payload command to
output a notification from a payload and those information.

To use this command with Phabricator too, we need to be able
to build the classes Phabricator want from only the instance
name, not from the full URL.

This refactoring allows to simplify constructors when handling
a Phabricator payload.

Test Plan
$ php artisan config:show

+-------------+-----------+----------------------------------+--------------------------+
| Gate        | Door      | Instance                         | Status                   |
+-------------+-----------+----------------------------------+--------------------------+
| GitHub      | Nasqueron | ø                                | ✓                        |
| Phabricator | Nasqueron | https://devcentral.nasqueron.org | Projects map not cached. |
+-------------+-----------+----------------------------------+--------------------------+
$ php artisan phabricator:projectsmap
Querying projects map for https://devcentral.nasqueron.org
+--------------------------------+-------------------------------------+
| PHID                           | Project name                        |
+--------------------------------+-------------------------------------+
| PHID-PROJ-6dg6ogx5pjmk24ur4tp4 | Accounts                            |
| PHID-PROJ-cztcgpvqr6smnnekotq7 | Agora                               |
| PHID-PROJ-3iew3cqf3htpazfyzb5a | architecture                        |
| PHID-PROJ-ypzex6tkmmv7tt44nknw | assets.nasqueron.org                |
| PHID-PROJ-yxslhjbugwycl2ul4n6n | Auth Grove                          |

$ php artisan config:show

+-------------+-----------+----------------------------------+--------+
| Gate        | Door      | Instance                         | Status |
+-------------+-----------+----------------------------------+--------+
| GitHub      | Nasqueron | ø                                | ✓      |
| Phabricator | Nasqueron | https://devcentral.nasqueron.org | ✓      |
+-------------+-----------+----------------------------------+--------+

Diff Detail

Repository
rNOTIF Notifications center
Lint
Lint Passed
Unit
Tests Passed
Branch
PhabricatorStory-constructor

Event Timeline

dereckson retitled this revision from to Let construct PhabricatorStory without URL.
dereckson updated this object.
dereckson edited the test plan for this revision. (Show Details)
dereckson added a reviewer: dereckson.
dereckson edited edge metadata.

Revert use change in PhabricatorGateController, as we handle if the service exists or not in GateController parent class.

dereckson retitled this revision from Let construct PhabricatorStory without URL to Avoid Phabricator URL in classes constructors.
dereckson updated this object.
dereckson edited edge metadata.
dereckson edited edge metadata.
This revision is now accepted and ready to land.Aug 24 2016, 00:38
This revision was automatically updated to reflect the committed changes.