Page MenuHomePhabricator

Migrate wgFlaggedRevsTags for hewikisource
Closed, ResolvedPublic

Description

Anyone know any active users on hewikisource?

wgFlaggedRevsTags in the current config is long deprecated, and we want to remove the deprecated stuff from MediaWiki-extensions-FlaggedRevs itself... (ala https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/FlaggedRevs/+/518781/ )

Current config:

		$wgFlaggedRevsTags = [ 'completeness' => 3, 'accuracy' => 3, 'formatting' => 3 ];

Which FR turns into... (FILL ME IN)

Proposed new config... (FILL ME IN ALSO)

See docs: https://www.mediawiki.org/wiki/Extension:FlaggedRevs#Basic_settings $wgFlaggedRevsTags part

Event Timeline

reedy@deploy1001:/srv/mediawiki-staging$ mwscript eval.php hewikisource
> var_dump( (new ReflectionClass('FlaggedRevs'))->getStaticProperties() );
array(12) {
  ["dimensions"]=>
  array(0) {
  }
  ["minSL"]=>
  array(0) {
  }
  ["minQL"]=>
  array(0) {
  }
  ["minPL"]=>
  array(0) {
  }
  ["qualityVersions"]=>
  bool(false)
  ["pristineVersions"]=>
  bool(false)
  ["tagRestrictions"]=>
  array(0) {
  }
  ["binaryFlagging"]=>
  bool(true)
  ["reviewNamespaces"]=>
  array(0) {
  }
  ["restrictionLevels"]=>
  array(0) {
  }
  ["autoReviewConfig"]=>
  int(0)
  ["loaded"]=>
  bool(false)
}
wmf-config hewikisource
$wgFlaggedRevsTags = [ 'completeness' => 3, 'accuracy' => 3, 'formatting' => 3 ];
FlaggedRevs.class.php BC
			if ( is_array( $levels ) ) {
				$ratingLevels = $levels['levels'];
				$minQL = $levels['quality'];
				$minPL = $levels['pristine'];
			} else { # B/C, $levels is just an integer (minQL)
				global $wgFlaggedRevPristine, $wgFlaggedRevValues;
				$ratingLevels = $wgFlaggedRevValues ?? 1;
				$minQL = $levels; // an integer
				$minPL = $wgFlaggedRevPristine ?? $ratingLevels + 1;
				wfWarn( 'Please update the format of $wgFlaggedRevsTags in config.' );
			}

So, I would guess:

$wgFlaggedRevsTags = [
  'completeness' => [ 'levels' => 1, 'quality' => 3, 'pristine' => 2 ],
  'accuracy' => [ 'levels' => 1, 'quality' => 3, 'pristine' => 2 ],
  'formatting' => [ 'levels' => 1, 'quality' => 3, 'pristine' => 2 ],
];

There's a bunch of processing between this line of code and the actual static members, though. So don't know if it would produce the same state or not...

We can just make the change on deploy1001 and do var_dump( (new ReflectionClass('FlaggedRevs'))->getStaticProperties() ); again against the wiki to see if the resultant static properties end up the same...

wmf-config hewikisource
$wgFlaggedRevsTags = [ 'completeness' => 3, 'accuracy' => 3, 'formatting' => 3 ];
FlaggedRevs.class.php BC
			if ( is_array( $levels ) ) {
				$ratingLevels = $levels['levels'];
				$minQL = $levels['quality'];
				$minPL = $levels['pristine'];
			} else { # B/C, $levels is just an integer (minQL)
				global $wgFlaggedRevPristine, $wgFlaggedRevValues;
				$ratingLevels = $wgFlaggedRevValues ?? 1;
				$minQL = $levels; // an integer
				$minPL = $wgFlaggedRevPristine ?? $ratingLevels + 1;
				wfWarn( 'Please update the format of $wgFlaggedRevsTags in config.' );
			}

So, I would guess:

$wgFlaggedRevsTags = [
  'completeness' => [ 'levels' => 1, 'quality' => 3, 'pristine' => 2 ],
  'accuracy' => [ 'levels' => 1, 'quality' => 3, 'pristine' => 2 ],
  'formatting' => [ 'levels' => 1, 'quality' => 3, 'pristine' => 2 ],
];

There's a bunch of processing between this line of code and the actual static members, though. So don't know if it would produce the same state or not...

You missed $wgFlaggedRevValues = 4; too (because I've moved it today in prep for getting rid)

So... s/1/4/?

$wgFlaggedRevsTags = [
  'completeness' => [ 'levels' => 4, 'quality' => 3, 'pristine' => 2 ],
  'accuracy' => [ 'levels' => 4, 'quality' => 3, 'pristine' => 2 ],
  'formatting' => [ 'levels' => 4, 'quality' => 3, 'pristine' => 2 ],
];
reedy@deploy1001:/srv/mediawiki-staging$ mwscript eval.php hewikisource
> var_dump( (new ReflectionClass('FlaggedRevs'))->getStaticProperties() );
array(12) {
  ["dimensions"]=>
  array(0) {
  }
  ["minSL"]=>
  array(0) {
  }
  ["minQL"]=>
  array(0) {
  }
  ["minPL"]=>
  array(0) {
  }
  ["qualityVersions"]=>
  bool(false)
  ["pristineVersions"]=>
  bool(false)
  ["tagRestrictions"]=>
  array(0) {
  }
  ["binaryFlagging"]=>
  bool(true)
  ["reviewNamespaces"]=>
  array(0) {
  }
  ["restrictionLevels"]=>
  array(0) {
  }
  ["autoReviewConfig"]=>
  int(0)
  ["loaded"]=>
  bool(false)
}

Guess it'd help if I loaded the config first. gj

reedy@deploy1001:/srv/mediawiki-staging$ mwscript eval.php hewikisource
> FlaggedRevs::binaryTagName();

> var_dump( (new ReflectionClass('FlaggedRevs'))->getStaticProperties() );
array(12) {
  ["dimensions"]=>
  array(3) {
    ["completeness"]=>
    array(5) {
      [0]=>
      string(14) "completeness-0"
      [1]=>
      string(14) "completeness-1"
      [2]=>
      string(14) "completeness-2"
      [3]=>
      string(14) "completeness-3"
      [4]=>
      string(14) "completeness-4"
    }
    ["accuracy"]=>
    array(5) {
      [0]=>
      string(10) "accuracy-0"
      [1]=>
      string(10) "accuracy-1"
      [2]=>
      string(10) "accuracy-2"
      [3]=>
      string(10) "accuracy-3"
      [4]=>
      string(10) "accuracy-4"
    }
    ["formatting"]=>
    array(5) {
      [0]=>
      string(12) "formatting-0"
      [1]=>
      string(12) "formatting-1"
      [2]=>
      string(12) "formatting-2"
      [3]=>
      string(12) "formatting-3"
      [4]=>
      string(12) "formatting-4"
    }
  }
  ["minSL"]=>
  array(3) {
    ["completeness"]=>
    int(1)
    ["accuracy"]=>
    int(1)
    ["formatting"]=>
    int(1)
  }
  ["minQL"]=>
  array(3) {
    ["completeness"]=>
    int(3)
    ["accuracy"]=>
    int(3)
    ["formatting"]=>
    int(3)
  }
  ["minPL"]=>
  array(3) {
    ["completeness"]=>
    int(5)
    ["accuracy"]=>
    int(5)
    ["formatting"]=>
    int(5)
  }
  ["qualityVersions"]=>
  bool(true)
  ["pristineVersions"]=>
  bool(false)
  ["tagRestrictions"]=>
  array(3) {
    ["completeness"]=>
    array(2) {
      ["review"]=>
      int(3)
      ["autoreview"]=>
      int(3)
    }
    ["accuracy"]=>
    array(2) {
      ["review"]=>
      int(3)
      ["autoreview"]=>
      int(3)
    }
    ["formatting"]=>
    array(2) {
      ["review"]=>
      int(3)
      ["autoreview"]=>
      int(3)
    }
  }
  ["binaryFlagging"]=>
  bool(false)
  ["reviewNamespaces"]=>
  array(10) {
    [0]=>
    int(0)
    [1]=>
    int(6)
    [2]=>
    int(10)
    [3]=>
    int(828)
    [4]=>
    int(100)
    [5]=>
    int(104)
    [6]=>
    int(106)
    [7]=>
    int(108)
    [8]=>
    int(110)
    [9]=>
    int(112)
  }
  ["restrictionLevels"]=>
  array(1) {
    [1]=>
    string(5) "sysop"
  }
  ["autoReviewConfig"]=>
  int(1)
  ["loaded"]=>
  bool(true)
}
$wgFlaggedRevsTags = [
  'completeness' => [ 'levels' => 4, 'quality' => 3, 'pristine' => 5 ],
  'accuracy' => [ 'levels' => 4, 'quality' => 3, 'pristine' => 5 ],
  'formatting' => [ 'levels' => 4, 'quality' => 3, 'pristine' => 5 ],
];

Pristine is 5 apparently

Change 518801 had a related patch set uploaded (by Reedy; owner: Reedy):
[operations/mediawiki-config@master] Migrate hewikisource $wgFlaggedRevsTags config

https://gerrit.wikimedia.org/r/518801

Change 518801 merged by jenkins-bot:
[operations/mediawiki-config@master] Migrate hewikisource $wgFlaggedRevsTags config

https://gerrit.wikimedia.org/r/518801

Reedy claimed this task.
Reedy removed a project: Patch-For-Review.

Hi, as per the request by Reedy at he.wikisource I came to this page. What exactly should we know about changes to Flagged Reviews at he.wikisource?

Hi, as per the request by Reedy at he.wikisource I came to this page. What exactly should we know about changes to Flagged Reviews at he.wikisource?

Thanks! We did some digging around and we think we made the config the same as it would've been automatically using the old settings...

Can you check/confirm that the article tagging is as you expect/as it was previously?

Thanks!

Thanks very much!
I checked a bit at a few random pages, and it seems to be functioning normally.
Question: If we want to remove the Flagged Reviews function from one specific namespace (עמוד), where do we need to turn to for that?

Question: If we want to remove the Flagged Reviews function from one specific namespace (עמוד), where do we need to turn to for that?

File a request under Wikimedia-Site-requests basically requesting that (giving the NS number would be helpful) and a link to local consensus to do so :)

Should be a trivial request to action