[go: up one dir, main page]

Page MenuHomePhabricator

Add a type selector to the ipinfo log
Closed, ResolvedPublicFeature

Description

Feature summary (what you would like to be able to do and where):
On the 'ipinfo' log, add a type selector to filter output. There are only a few types of actions logged here, so a drop down should do.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
The log is very noisy, being able to look for only certain components (such as enabling/disabling access) requires lots of "next"ing.

Benefits (why should this be implemented?):
Consistent with other types of special:log's that have a set of actions.

Event Timeline

Xaosflux triaged this task as Lowest priority.May 27 2022, 3:29 PM
Aklapper renamed this task from FR: Add a type selector to the ipinfo log to Add a type selector to the ipinfo log.May 27 2022, 4:16 PM

Change 805824 had a related patch set uploaded (by MarcoAurelio; author: MarcoAurelio):

[mediawiki/extensions/IPInfo@master] Allow filtering the IPInfo log by type of actions

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

MarcoAurelio changed the task status from Open to In Progress.Jun 19 2022, 9:45 AM
MarcoAurelio added subscribers: Tchanders, Niharika.

Tested my above patch. The ipinfo logs appears to correctly filter by type of action:

Unfiltered log
imagen.png (1×1 px, 151 KB)
Enable/Disable own access
imagen.png (1×1 px, 131 KB)
View infobox
imagen.png (1×1 px, 114 KB)
View popup
imagen.png (1×1 px, 115 KB)

Note: IP addresses displayed there are not real.

Pings to @Tchanders and @Niharika for further review/patch approval if appropriate.

Thanks.

Change 805824 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] Allow filtering the IPInfo log by type of actions

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

@MarcoAurelio Trying to access the IPInfo logs on beta (https://en.wikipedia.beta.wmflabs.org/wiki/Special:Log?type=ipinfo&user=&page=&wpdate=&tagfilter=&wpfilters%5B%5D=newusers) I get the exception:

[YrXCZWGXEEzZDXncyWtEDQAAAAk] /wiki/Special:Log?type=ipinfo&user=&page=&wpdate=&tagfilter=&wpfilters%5B%5D=newusers InvalidArgumentException: Invalid IP address

Backtrace:

from /srv/mediawiki/php-master/includes/user/UserFactory.php(112)
#0 /srv/mediawiki/php-master/extensions/IPInfo/src/Logging/IPInfoLogFormatter.php(34): MediaWiki\User\UserFactory->newAnonymous(string)
#1 /srv/mediawiki/php-master/includes/logging/LogFormatter.php(493): MediaWiki\IPInfo\Logging\IPInfoLogFormatter->getMessageParameters()
#2 /srv/mediawiki/php-master/includes/logging/LogFormatter.php(468): LogFormatter->getActionMessage()
#3 /srv/mediawiki/php-master/includes/logging/LogEventsList.php(383): LogFormatter->getActionText()
#4 /srv/mediawiki/php-master/includes/logging/LogPager.php(451): LogEventsList->logLine(stdClass)
#5 /srv/mediawiki/php-master/includes/pager/ReverseChronologicalPager.php(115): LogPager->formatRow(stdClass)
#6 /srv/mediawiki/php-master/includes/pager/IndexPager.php(634): ReverseChronologicalPager->getRow(stdClass)
#7 /srv/mediawiki/php-master/includes/specials/SpecialLog.php(294): IndexPager->getBody()
#8 /srv/mediawiki/php-master/includes/specials/SpecialLog.php(176): SpecialLog->show(FormOptions, array)
#9 /srv/mediawiki/php-master/includes/specialpage/SpecialPage.php(688): SpecialLog->execute(NULL)
#10 /srv/mediawiki/php-master/includes/specialpage/SpecialPageFactory.php(1418): SpecialPage->run(NULL)
#11 /srv/mediawiki/php-master/includes/MediaWiki.php(316): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)
#12 /srv/mediawiki/php-master/includes/MediaWiki.php(911): MediaWiki->performRequest()
#13 /srv/mediawiki/php-master/includes/MediaWiki.php(570): MediaWiki->main()
#14 /srv/mediawiki/php-master/index.php(50): MediaWiki->run()
#15 /srv/mediawiki/php-master/index.php(46): wfIndexMain()
#16 /srv/mediawiki/w/index.php(3): require(string)
#17 {main}

I have not been able to reproduce this locally yet.

Actually, I don't think this is related to this change. Instead, I think it has something to do with T310815. There are records in the logs of IPInfo lookups which are not of actual IP addresses.

dom_walden added a subscriber: Prtksxna.

Due to the above error I couldn't test this on beta but I have tested it locally.

Here is what the form looks like now:

ipinfo_log_type_dropdown.png (605×765 px, 30 KB)

I looked at the SQL query that was being made when selecting various options from the dropdown.

For the "All" option, the query is exactly the same as the query we used to make before this code change.

Moving to Design Review as @Niharika and @Prtksxna may want to review the exact wording we are using for the dropdown options:

  • Type of IPInfo operation:
  • Enable or disable of tool
  • View of infobox data
  • View of popup data

Test environment: local docker IP Info 0.0.0 (f689140) 10:30, 24 June 2022.

Thanks for your tests and comments @dom_walden:

The language was proposed by @STran in the patch (see previous and updated wording side-by-side). If you all think another wording is better, please let me know, I can upload another patch to change it.

I can't reproduce the MW Exception on Meta-Wiki Beta Cluster, where the log and the type selector seems to work fine ( see here); however I am indeed able to reproduce the error you quoted on the enwiki Beta Cluster. I am not sure why though.

Best regards.

The language was proposed by @STran in the patch (see previous and updated wording side-by-side). If you all think another wording is better, please let me know, I can upload another patch to change it.

I think they are fine, but I will let @Niharika and @Prtksxna have the final say, just to make sure we are being consistent with our wording.

I can't reproduce the MW Exception on Meta-Wiki Beta Cluster, where the log and the type selector seems to work fine ( see here); however I am indeed able to reproduce the error you quoted on the enwiki Beta Cluster. I am not sure why though.

I think it is because enwiki beta has some rows in the logging table which it should not do (targets which are not IP addresses when it expects them to be), due to T310815. These probably don't exist on other (less commonly used) beta wikis.

I think they are fine, but I will let @Niharika and @Prtksxna have the final say, just to make sure we are being consistent with our wording.

Based on the changes we're making in T311683, let's use the "IP Information" for the product name. Let's use the past tense for logged actions:

MessageCurrentProposed
log-action-filter-ipinfoType of IPInfo operation:Type of IP Information operation:
log-action-filter-ipinfo-change_accessEnable or disable of toolTool enabled or disabled
log-action-filter-ipinfo-view_infoboxView of infobox dataData viewed in information box
log-action-filter-ipinfo-view_popupView of popup dataData viewed in popup

Change 811665 had a related patch set uploaded (by MarcoAurelio; author: MarcoAurelio):

[mediawiki/extensions/IPInfo@master] i18n: Amend log-action-filter-* messages

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

Change 811665 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] i18n: Amend log-action-filter-* messages

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

MarcoAurelio changed the task status from In Progress to Open.Jul 8 2022, 12:25 PM

Patches merged. Leaving open just in case further QA/checks are required.