Page MenuHomePhorge

April 5, 2022
Updated 752 Days AgoPublic

Version 1 of 3: You are viewing an older version of this document, as it appeared on Apr 5 2022, 18:46.

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
  3. Spammers
    • They've figured out how to create tasks
    • Automated deployment from our own git repo?
Referenced Files
F146502: image.png
Apr 9 2022, 19:43
Tokens
"Mountain of Wealth" token, awarded by 20after4.
Last Author
Matthew
Last Edited
Apr 5 2022, 18:46

Event Timeline

Matthew added subscribers: dcog, 20after4.

Some 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