Go to file
Aklapper 1f6ce9d2dc Remove custom go-get / go-import code in Diffusion repositories
Bug: T352322
2024-05-12 15:42:17 +00:00
bin Add a cli tool to roll back transactions 2019-04-02 00:48:35 -05:00
scripts Fix init script so that rollback cli works 2020-09-28 19:21:24 -05:00
src Remove custom go-get / go-import code in Diffusion repositories 2024-05-12 15:42:17 +00:00
.arcconfig Remove 'load' library from .arcconfig 2016-06-07 16:27:41 -05:00
.arclint Add a basic arclint config 2016-05-30 13:19:49 -06:00
.gitignore gitignore the phutil_module_cache 2016-11-29 00:14:33 -06:00
LICENSE Improved README and added LICENSE (apache license 2.0) 2016-05-23 19:53:31 -05:00
README.md Revert rPHEX705c52059f655d6a0b8fddee60e9745b287e7db0 2024-04-15 19:28:39 +00:00
__phutil_library_init__.php don't put phutil module in src/ subdirectory. 2016-03-03 23:56:44 -06:00
__phutil_library_map__.php Remove custom go-get / go-import code in Diffusion repositories 2024-05-12 15:42:17 +00:00

README.md

About this repository

This repository contains miscellaneous extensions to Phabricator which are specialized for the needs of the Wikimedia Foundation's Phabricator instance at https://phabricator.wikimedia.org

These extensions provide some basic custom functionality and integration with Wikimedia's systems.

Installation

This Repository consists of a single libphutil module which can be used in phabricator by simply adding the repository root to the list of library paths specified by the key load-libraries within phabricator's config.

For example:

"load-libraries": [
  "/path/to/this/repository/",
  "/path/to/another/extension/"
]

For more details, see this article in the phabricator documentation.

Overview of extensions

The extensions are under the src/ directory, organized into sub-directories by extension type.

src/oauth

PhabricatorMediaWikiAuthProvider and PhutilMediaWikiAuthAdapter constitute an authentication provider adapter that enables Phabricator to use OAuth federation to offload phabricator logins to Mediawiki's OAuth1 endpoint.

src/customfields

Custom fields are extensions which add a field to various objects in Phabricator. Wikimedia makes use of a few custom fields to extend user profile pages and Differential code review pages.

MediaWikiUserpageCustomField

This custom field is used on phabricator user profile pages, displays a link to a user's wiki userpage. The wiki userpage url is discovered by looking up the link which is created by PhabricatorMediaWikiAuthProvider when a user links their mediawiki login to their phabricator account.

LDAPUserpageCustomField

Another custom field used on phabricator user profile pages which simply displays the ldap username that is associated with the user's phabricator account.

src/gerrit

Migration-related extensions supposed to facilitate the now-canceled migration of Wikimedia code review from Gerrit to Differential.

GerritApplication and GerritProjectController handle redirecting links from gerrit to diffusion repositories.

This would have allowed diffusion to replace gerrit.wikimedia.org as the primary way to browse the source code of various Wikimedia projects. The reason this was necessary is because gerrit projects have a hierarchical structure which doesn't map directly to phabricator's flat repository namespace. So we implemented url routing in phabricator with a static map between the old gerrit urls and the corresponding repository "callsigns." The mapping is a static array contained in src/gerrit/GerritProjectMap.php and GerritProjectListController handles printing the full mapping as a list of html links as seen here.

Security Policy Extensions

See src/policy/README

Transaction Rollback

There is a command line tool in bin/rollback which can be used to roll back transactional edits on Maniphest tasks. Other phabricator applications could be supported with a little effort, however, none are supported currently. See src/workflow/RollbackTransactionsWorkflow.php