Page MenuHomePhorge

2022-04-05
Updated 951 Days AgoPublic

Meeting notes for {E2}

Attendees:

  1. Action item check-in
    • @avivey Set up a table of the Phorge applications, organizing the effort to being rebranding (Completed)
    • @speck Update the strategy for how we're going to approach the rebrand so others can contribute (Completed)
    • @avivey Communicate our strategy with the upstream (Completed)
    • @speck Update meeting notes, organize into Phriction pages (Completed)
    • @Matthew Set up new recurring meeting (Completed)
  2. High priority task: Rebranding
    • T15077: Rebrand: Tracking task
    • No diffs yet.
    • Problem: A ton of work...
    • Wikimedia has a translation importer/exporter tool that could perhaps help here. https://phabricator.wikimedia.org/source/phabricator-translations/
    • Diviner: Perhaps we can add a banner stating that Phorge is derived from Phabricator to our public-facing documentation. This might buy some time for us to complete the rebrand.
    • Dan wants to investigate Rector to see if it will make rebrand easier. Handed as an action item.
  3. Spammers
    • Automated deployment from our own git repo?
    • https://phabricator.wikimedia.org/source/phabricator-ava/ - Useful, potential to migrate into upstream at a future date.
    • It's a really good idea to limit users before they're part of Trusted Contributors
    • Another useful tool is Askimet: https://github.com/aag/mwakismet - Perhaps we can integrate that into the Phorge code with a configuration option?
    • T15084: Discussion: Maniphest vs Ponder for user support might also perhaps help. We should lock down most everything to Trusted Contributors on this install, except perhaps Ponder.
    • Better moderation tools also help
      • Unbundling of Administrator tools might be useful? WMF does that.
      • We could use Projects for that - WMF does that. This gives more granular control but is something we would need to code.
      • How do we support open source better? Phabricator is designed closed-source first, but open-source projects have adopted it. Open-Source support is a high priority.

Action Items

Last Author
Matthew
Last Edited
May 3 2022, 19:33

Event Timeline

Matthew changed the title from 2022-05-05 to 2022-04-05.May 3 2022, 19:33
Matthew moved this document from 2022-05-05.
Matthew added subscribers: dcog, 20after4, avivey and 2 others.

Referencing a comment from the earlier document:

https://we.phorge.it/w/planning_meetings/april_5%2C_2022/#224

This is regarding initial findings on Rector


Installation:

mkdir rector-test && cd rector-test
git clone https://github.com/phacility/arcanist.git
git clone https://github.com/phacility/phabricator.git
composer require rector/rector --dev

Create rector.php in same directory. Example:

<?php

declare(strict_types=1);

use Rector\Core\Configuration\Option;
use Rector\Renaming\Rector\FuncCall\RenameFunctionRector;
use Rector\Renaming\Rector\Name\RenameClassRector;
use Rector\Renaming\Rector\String_\RenameStringRector;
//use Rector\Set\ValueObject\LevelSetList;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $containerConfigurator): void {
	$parameters = $containerConfigurator->parameters();
	$parameters->set(Option::PATHS, [
		__DIR__ . '/arcanist',
		__DIR__ . '/phabricator',
	]);

	// Define what rule sets will be applied
	//$containerConfigurator->import(LevelSetList::UP_TO_PHP_81);

	// Configure services / rectors
	$services = $containerConfigurator->services();

	$services->set(RenameStringRector::class)
		->configure([
			'Phabricator' => 'Phorge',
		]);

	$services->set(RenameClassRector::class)
		->configure([
			'PhabricatorHandleQuery' => 'PlatformHandleQuery',
			'PhabricatorAuthSSHKeyQuery' => 'PlatformAuthSSHKeyQuery',
			'PhabricatorPolicyInterface' => 'PlatformPolicyInterface'
		]);

	$services->set(RenameFunctionRector::class)
		->configure([
			'phabricator_date' => 'platform_date',
			'phabricator_time' => 'platform_time',
			'phabricator_read_config_file' => 'platform_read_config_file',
			'phabricator_startup' => 'platform_startup',
		]);
};

Do a dry run:

vendor/bin/rector process --dry-run

Wait a while, watching as your CPU weeps and moans in agony (make sure to save other files first in case it comes to a halt for a few minutes). If it can handle it eventually, you'll see a large amount of output like this:

image.png (957×538 px, 70 KB)

Also got a lot of these errors:

[ERROR] Could not process "phabricator/src/view/page/PhabricatorStandardPageView.php" file, due to: "PHPStan\BetterReflection\Reflection\ReflectionClass "AphrontResponseProducerInterface" could not be found in the located source". On line: 26

I think this is because it's not seeing the connection between the arcanist and phabricator directories. Fairly certain I saw somewhere that there's a way to have it autoload or look in other directories, so there's still more digging to do on setting up the rector.php file.. hopefully the way those two directories interact is supported in Rector