Page MenuHomePhabricator

Fix error in RESTBagOStuff class comment
Closed, ResolvedPublic1 Estimate Story Points

Description

In task T233963: Add serialization options to RESTBagOStuff, we added new serialization options to RESTBagOStuff, including a comment at the top of the class with an example of how to use them. This comment was incorrect. Correct that comment, and backport the correction to the 1.34 branch (REL1_34) for inclusion in the upcoming 1.34 release, per https://www.mediawiki.org/wiki/Gerrit/Advanced_usage#Submitting_a_change_to_a_branch_for_review_(%22backporting%22)

The file in question is <mediawiki root>/includes/libs/objectcache/RESTBagOStuff.php. The comment currently says:

* Configuration for Kask (session storage):
* @code
* $wgObjectCaches['sessions'] = array(
*	'class' => 'RESTBagOStuff',
*	'url' => 'https://kaskhost:1234/sessions/v1/',
*	'httpParams' => [
*		'readHeaders' => [],
*		'writeHeaders' => [ 'content-type' => 'application/octet-stream' ],
*		'deleteHeaders' => [],
*		'writeMethod' => 'POST',
*		'serialization_type' => 'JSON',
*	],
* 	'extendedErrorBodyFields' => [ 'type', 'title', 'detail', 'instance' ]
* );
* $wgSessionCacheType = 'sessions';
* @endcode

This is incorrect, because 'serialization_type' is not one of the 'httpParams'. The comment should instead say:

* Configuration for Kask (session storage):
* @code
* $wgObjectCaches['sessions'] = array(
*	'class' => 'RESTBagOStuff',
*	'url' => 'https://kaskhost:1234/sessions/v1/',
*	'httpParams' => [
*		'readHeaders' => [],
*		'writeHeaders' => [ 'content-type' => 'application/octet-stream' ],
*		'deleteHeaders' => [],
*		'writeMethod' => 'POST',
*	],
*	'serialization_type' => 'JSON',
* 	'extendedErrorBodyFields' => [ 'type', 'title', 'detail', 'instance' ]
* );
* $wgSessionCacheType = 'sessions';
* @endcode

The only change is to move serialization_type out of the httpParams.

Details

Related Gerrit Patches:
mediawiki/core : masterUpdate RESTBagOStuff.php

Event Timeline

BPirkle created this task.Oct 15 2019, 8:53 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 15 2019, 8:53 PM
BPirkle triaged this task as High priority.Oct 15 2019, 8:54 PM
BPirkle set the point value for this task to 1.

Change 543224 had a related patch set uploaded (by Nikki Nikkhoui; owner: Nikki Nikkhoui):
[mediawiki/core@master] Update RESTBagOStuff.php

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

Change 543225 had a related patch set uploaded (by Nikki Nikkhoui; owner: Nikki Nikkhoui):
[mediawiki/core@master] Bug: T235559

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

Change 543221 had a related patch set uploaded (by Nikki Nikkhoui; owner: Nikki Nikkhoui):
[mediawiki/core@master] Bug: T235559

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

Change 543224 abandoned by Nikki Nikkhoui:
Update RESTBagOStuff.php

Reason:
unnecessary line removal

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

Change 543225 abandoned by Nikki Nikkhoui:
Bug: T235559

Reason:
unnecessary line removal

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

BPirkle closed this task as Resolved.Oct 16 2019, 10:31 PM