Cygnus issueshttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues2018-02-11T12:06:21Zhttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/80Change return format of patrol and rollback2018-02-11T12:06:21ZLuke081515luke081515@tools.wmflabs.orgChange return format of patrol and rollbackBoth are using a mix of strings etc, but they can use more simple values, which are taking less ressources to compare later. These methods where introduced in the current alpha, so changing it is no breaking change.Both are using a mix of strings etc, but they can use more simple values, which are taking less ressources to compare later. These methods where introduced in the current alpha, so changing it is no breaking change.Version 2.1Luke081515luke081515@tools.wmflabs.orgLuke081515luke081515@tools.wmflabs.orghttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/79Use similar layout for the docu2018-01-29T01:19:19ZLuke081515luke081515@tools.wmflabs.orgUse similar layout for the docuCurrently the order of @param, @author etc. is different, it would be useful to make that similar.
I'd say we can do:
```php
/** method name
* Short description
* @author Authorname
* @param $param - text here
* @param $param - [default: default value] - text
* @return type: text
*/
```Currently the order of @param, @author etc. is different, it would be useful to make that similar.
I'd say we can do:
```php
/** method name
* Short description
* @author Authorname
* @param $param - text here
* @param $param - [default: default value] - text
* @return type: text
*/
```Version 2.1Luke081515luke081515@tools.wmflabs.orgLuke081515luke081515@tools.wmflabs.orghttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/78Suppress UA at Unit-tests2018-01-31T21:36:41ZLuke081515luke081515@tools.wmflabs.orgSuppress UA at Unit-tests```
+ phpunit --version
$ bash ci/phpunitBasic.sh
PHPUnit 5.7.26 by Sebastian Bergmann and contributors.
.
Used UserAgent: 'User:UTAccount - TestCore - Cygnus-Framework V2.1 alpha'
.
Used UserAgent: 'User:UTAccount - TestCore - Cygnus-Framework V2.1 alpha'
```
The version is already suppressed, now the UA should get suppressed as well.```
+ phpunit --version
$ bash ci/phpunitBasic.sh
PHPUnit 5.7.26 by Sebastian Bergmann and contributors.
.
Used UserAgent: 'User:UTAccount - TestCore - Cygnus-Framework V2.1 alpha'
.
Used UserAgent: 'User:UTAccount - TestCore - Cygnus-Framework V2.1 alpha'
```
The version is already suppressed, now the UA should get suppressed as well.Version 2.1Luke081515luke081515@tools.wmflabs.orgLuke081515luke081515@tools.wmflabs.orghttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/77Remove ununsed vars2018-02-11T14:55:28ZLuke081515luke081515@tools.wmflabs.orgRemove ununsed varsOften there are action like this:
```php
$result = $this->ApiRequest();
$resultUs = unserialize($result);
```
$result gets then not used again, but consumes ram. This should get removed.Often there are action like this:
```php
$result = $this->ApiRequest();
$resultUs = unserialize($result);
```
$result gets then not used again, but consumes ram. This should get removed.Version 2.1Luke081515luke081515@tools.wmflabs.orgLuke081515luke081515@tools.wmflabs.orghttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/76Use identical var names at API-Requests2018-01-31T21:36:41ZLuke081515luke081515@tools.wmflabs.orgUse identical var names at API-RequestsWhen fetching the API results, the same varname scheme should get used. This should get checked.When fetching the API results, the same varname scheme should get used. This should get checked.Version 2.1Luke081515luke081515@tools.wmflabs.orgLuke081515luke081515@tools.wmflabs.orghttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/75Put generic API-params in a function2018-01-30T12:43:13ZLuke081515luke081515@tools.wmflabs.orgPut generic API-params in a functionEach function needs maxlag. Each function needs assert, or at least most. It would be nice if we can put this to a function that get called on each api-call.Each function needs maxlag. Each function needs assert, or at least most. It would be nice if we can put this to a function that get called on each api-call.Version 2.2Luke081515luke081515@tools.wmflabs.orgLuke081515luke081515@tools.wmflabs.orghttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/74BlockGlobal can not handle errors2018-01-16T21:05:14ZLuke081515luke081515@tools.wmflabs.orgBlockGlobal can not handle errors```
Give me the IP:<already blocked ip>
PHP Notice: Undefined index: code in /home/luke/Scripts/Cygnus/BotCore.php on line 1283
PHP Stack trace:
PHP 1. {main}() /home/luke/Scripts/GlobalMassBlock.php:0
PHP 2. GlobalMassBlock->__construct() /home/luke/Scripts/GlobalMassBlock.php:24
PHP 3. GlobalMassBlock->blockGlobal() /home/luke/Scripts/GlobalMassBlock.php:15
Not blocked!
``````
Give me the IP:<already blocked ip>
PHP Notice: Undefined index: code in /home/luke/Scripts/Cygnus/BotCore.php on line 1283
PHP Stack trace:
PHP 1. {main}() /home/luke/Scripts/GlobalMassBlock.php:0
PHP 2. GlobalMassBlock->__construct() /home/luke/Scripts/GlobalMassBlock.php:24
PHP 3. GlobalMassBlock->blockGlobal() /home/luke/Scripts/GlobalMassBlock.php:15
Not blocked!
```Version 2.1Luke081515luke081515@tools.wmflabs.orgLuke081515luke081515@tools.wmflabs.orghttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/73Write a generic query continue2018-01-09T19:41:46ZLuke081515luke081515@tools.wmflabs.orgWrite a generic query continue!77 inspired me. What do you think of:
**A generic query continue!**
The concept itself is simple and nice, implementation may be not.
# What the function does
## Conditions for using
Query functions often have more results then the limit allows, so continue is needed. Currently the functions are doing this until all results are fetched. This may be useless if the user only needs 7000 for example.
## Calling it
Functions are reciving the continue. This continue has a name as well (if using rawcontinue, we may switch to the other continue), so the continue engine can get called, with the params `continuename `and `api-call url` at least. The function will start fetching everything then. It would be useful to implement that recursive, but PHP allows only 50 levels of recursive functions IIRC
# Nice additional features
The user can specify a limit, and the function tries to fetch as much as possible data, if [limit] > [limit of data to fetch in one request]. Then, the function will continue, until the limit is reached.
Please share your opinion on this proposal with me.!77 inspired me. What do you think of:
**A generic query continue!**
The concept itself is simple and nice, implementation may be not.
# What the function does
## Conditions for using
Query functions often have more results then the limit allows, so continue is needed. Currently the functions are doing this until all results are fetched. This may be useless if the user only needs 7000 for example.
## Calling it
Functions are reciving the continue. This continue has a name as well (if using rawcontinue, we may switch to the other continue), so the continue engine can get called, with the params `continuename `and `api-call url` at least. The function will start fetching everything then. It would be useful to implement that recursive, but PHP allows only 50 levels of recursive functions IIRC
# Nice additional features
The user can specify a limit, and the function tries to fetch as much as possible data, if [limit] > [limit of data to fetch in one request]. Then, the function will continue, until the limit is reached.
Please share your opinion on this proposal with me.Version 2.2https://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/72Check if a page contains a template2018-01-16T21:05:14ZLuke081515luke081515@tools.wmflabs.orgCheck if a page contains a templateWrite a function that checks if a template is present on a page.Write a function that checks if a template is present on a page.Version 2.1Luke081515luke081515@tools.wmflabs.orgLuke081515luke081515@tools.wmflabs.orghttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/71Replace unneeded whiles with for2018-01-13T22:33:44ZLuke081515luke081515@tools.wmflabs.orgReplace unneeded whiles with forwhile's that don't need to be while's should be for.while's that don't need to be while's should be for.Version 2.1Luke081515luke081515@tools.wmflabs.orgLuke081515luke081515@tools.wmflabs.orghttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/70ban goto2018-01-31T21:36:40ZLuke081515luke081515@tools.wmflabs.orgban gotoIt would be useful to ban this not so good piece of coding, which is only used at some places.It would be useful to ban this not so good piece of coding, which is only used at some places.Version 2.1Luke081515luke081515@tools.wmflabs.orgLuke081515luke081515@tools.wmflabs.orghttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/69checkResult: Handle "protectedpage"2017-12-29T19:07:00ZLuke081515luke081515@tools.wmflabs.orgcheckResult: Handle "protectedpage"`protectedpage` is a common error code, and should get handeled as well.`protectedpage` is a common error code, and should get handeled as well.Version 2.1Luke081515luke081515@tools.wmflabs.orgLuke081515luke081515@tools.wmflabs.orghttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/68Echo useragent2018-01-05T22:18:39ZLuke081515luke081515@tools.wmflabs.orgEcho useragentTo find your bot at Special:ApiFeatureUsage, you need the useragent, so we should make it easy to find.To find your bot at Special:ApiFeatureUsage, you need the useragent, so we should make it easy to find.Version 2.1Luke081515luke081515@tools.wmflabs.orgLuke081515luke081515@tools.wmflabs.orghttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/67Debug: let the user retry2018-01-31T21:36:41ZLuke081515luke081515@tools.wmflabs.orgDebug: let the user retryIf you need to specify the function to debug, and you mistyped it, it would be useful if you can try it again without needing to relogin.If you need to specify the function to debug, and you mistyped it, it would be useful if you can try it again without needing to relogin.Version 2.1Luke081515luke081515@tools.wmflabs.orgLuke081515luke081515@tools.wmflabs.orghttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/66Debug: better visualisation for null2018-01-13T22:33:44ZLuke081515luke081515@tools.wmflabs.orgDebug: better visualisation for nullIf any functions returns `null` that should get visualized instead of returning an empty row.If any functions returns `null` that should get visualized instead of returning an empty row.Version 2.1Luke081515luke081515@tools.wmflabs.orgLuke081515luke081515@tools.wmflabs.orghttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/65getPageID returns not the pageID2018-01-13T22:33:44ZLuke081515luke081515@tools.wmflabs.orggetPageID returns not the pageIDLooks like it is returning a non-existant variable. A unit test would be nice to prevent that as well.Looks like it is returning a non-existant variable. A unit test would be nice to prevent that as well.Version 2.1Luke081515luke081515@tools.wmflabs.orgLuke081515luke081515@tools.wmflabs.orghttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/64params wrongly seperated: movePage2018-01-13T22:33:44ZLuke081515luke081515@tools.wmflabs.orgparams wrongly seperated: movePage```
Result for action=move&format=json&assert=botmaxlag=5&from=Selenium+Echo+link+test+0.7641617008345213+0.7641617008345213&to=Selenium+Echo+link+test+0.7641617008345213+0.764161700834521&reason=test&bot=0&movetalk=0&noredirect=0&token=610ac57ce10bf82c412600dc05b360715a4580de%2B%5C:
'{"error":{"code":"unknown_assert","info":"Unrecognized value for parameter \"assert\": botmaxlag=5.","*":"See https://en.wikipedia.beta.wmflabs.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."},"servedby":"deployment-mediawiki05"}'
``````
Result for action=move&format=json&assert=botmaxlag=5&from=Selenium+Echo+link+test+0.7641617008345213+0.7641617008345213&to=Selenium+Echo+link+test+0.7641617008345213+0.764161700834521&reason=test&bot=0&movetalk=0&noredirect=0&token=610ac57ce10bf82c412600dc05b360715a4580de%2B%5C:
'{"error":{"code":"unknown_assert","info":"Unrecognized value for parameter \"assert\": botmaxlag=5.","*":"See https://en.wikipedia.beta.wmflabs.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."},"servedby":"deployment-mediawiki05"}'
```Version 2.1Luke081515luke081515@tools.wmflabs.orgLuke081515luke081515@tools.wmflabs.orghttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/63config error at Debug.php2018-01-13T22:33:44ZLuke081515luke081515@tools.wmflabs.orgconfig error at Debug.php```
Starting the function call of movePage...PHP Notice: Undefined offset: 3 in /home/luke/Cygnus/Debug.php on line 223
PHP Stack trace:
PHP 1. {main}() /home/luke/Cygnus/Debug.php:0
PHP 2. Debug->__construct() /home/luke/Cygnus/Debug.php:715
PHP 3. Debug->debug() /home/luke/Cygnus/Debug.php:24
PHP Notice: Undefined offset: 4 in /home/luke/Cygnus/Debug.php on line 223
PHP Stack trace:
PHP 1. {main}() /home/luke/Cygnus/Debug.php:0
PHP 2. Debug->__construct() /home/luke/Cygnus/Debug.php:715
PHP 3. Debug->debug() /home/luke/Cygnus/Debug.php:24
PHP Notice: Undefined offset: 5 in /home/luke/Cygnus/Debug.php on line 223
PHP Stack trace:
PHP 1. {main}() /home/luke/Cygnus/Debug.php:0
PHP 2. Debug->__construct() /home/luke/Cygnus/Debug.php:715
PHP 3. Debug->debug() /home/luke/Cygnus/Debug.php:24
``````
Starting the function call of movePage...PHP Notice: Undefined offset: 3 in /home/luke/Cygnus/Debug.php on line 223
PHP Stack trace:
PHP 1. {main}() /home/luke/Cygnus/Debug.php:0
PHP 2. Debug->__construct() /home/luke/Cygnus/Debug.php:715
PHP 3. Debug->debug() /home/luke/Cygnus/Debug.php:24
PHP Notice: Undefined offset: 4 in /home/luke/Cygnus/Debug.php on line 223
PHP Stack trace:
PHP 1. {main}() /home/luke/Cygnus/Debug.php:0
PHP 2. Debug->__construct() /home/luke/Cygnus/Debug.php:715
PHP 3. Debug->debug() /home/luke/Cygnus/Debug.php:24
PHP Notice: Undefined offset: 5 in /home/luke/Cygnus/Debug.php on line 223
PHP Stack trace:
PHP 1. {main}() /home/luke/Cygnus/Debug.php:0
PHP 2. Debug->__construct() /home/luke/Cygnus/Debug.php:715
PHP 3. Debug->debug() /home/luke/Cygnus/Debug.php:24
```Version 2.1Luke081515luke081515@tools.wmflabs.orgLuke081515luke081515@tools.wmflabs.orghttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/62readPage fails to identify missing pages2018-01-13T22:33:44ZLuke081515luke081515@tools.wmflabs.orgreadPage fails to identify missing pages```
Result for action=query&prop=revisions&format=json&rvprop=content&rvlimit=1&rvcontentformat=text%2Fx-wiki&titles=User%3Asgfdsfsd&rvdir=older&assert=bot&maxlag=5&rawcontinue=&indexpageids=1:
'{"query":{"normalized":[{"from":"User:sgfdsfsd","to":"Benutzer:Sgfdsfsd"}],"pageids":["-1"],"pages":{"-1":{"ns":2,"title":"Benutzer:Sgfdsfsd","missing":""}}}}'PHP Notice: Undefined index: revisions in /home/luke/Cygnus/BotCore.php on line 356
PHP Stack trace:
PHP 1. {main}() /home/luke/Cygnus/Debug.php:0
PHP 2. Debug->__construct() /home/luke/Cygnus/Debug.php:715
PHP 3. Debug->debug() /home/luke/Cygnus/Debug.php:24
PHP 4. Debug->readPage() /home/luke/Cygnus/Debug.php:40
PHP 5. Debug->readPageEngine() /home/luke/Cygnus/BotCore.php:369
Function call succeeded
``````
Result for action=query&prop=revisions&format=json&rvprop=content&rvlimit=1&rvcontentformat=text%2Fx-wiki&titles=User%3Asgfdsfsd&rvdir=older&assert=bot&maxlag=5&rawcontinue=&indexpageids=1:
'{"query":{"normalized":[{"from":"User:sgfdsfsd","to":"Benutzer:Sgfdsfsd"}],"pageids":["-1"],"pages":{"-1":{"ns":2,"title":"Benutzer:Sgfdsfsd","missing":""}}}}'PHP Notice: Undefined index: revisions in /home/luke/Cygnus/BotCore.php on line 356
PHP Stack trace:
PHP 1. {main}() /home/luke/Cygnus/Debug.php:0
PHP 2. Debug->__construct() /home/luke/Cygnus/Debug.php:715
PHP 3. Debug->debug() /home/luke/Cygnus/Debug.php:24
PHP 4. Debug->readPage() /home/luke/Cygnus/Debug.php:40
PHP 5. Debug->readPageEngine() /home/luke/Cygnus/BotCore.php:369
Function call succeeded
```Version 2.1Luke081515luke081515@tools.wmflabs.orgLuke081515luke081515@tools.wmflabs.orghttps://gitlab.wmflabs.org/Cygnus/Cygnus/-/issues/61Implement action "patrol"2018-02-11T12:06:21ZLuke081515luke081515@tools.wmflabs.orgImplement action "patrol"It should be possible to patrol a page, since we already have flaggedrefs included.It should be possible to patrol a page, since we already have flaggedrefs included.Version 2.1Luke081515luke081515@tools.wmflabs.orgLuke081515luke081515@tools.wmflabs.org