Page MenuHomePhabricator

Make it possible to set the IPInfo user preference globally
Closed, ResolvedPublicBUG REPORT

Description

Summary

The IP Info user preference to enable use of the tool currently is set to only be enabled locally. We should allow this to be enabled globally, given that this has been approved by WMF Legal.

Background

  • The IP Info extension has a preference used to enable use of the tool, which asks the user to only use it to respond to abuse
  • This preference can only be enabled locally, which was done because it was unclear if enabling globally was allowed
  • WMF Legal has since approved enabling this preference globally, so we can undo the change to make it local only
  • This is needed to be able to work on the temporary accounts onboarding dialog

Technical notes

Acceptance criteria

  • It is possible to enable the IP Info use agreement preference globally

Original ticket description

What is the problem?

Currently, all the user preferences associated with IPInfo (T264150 and T292802) can be set globally.

We should decide whether this is desirable.

For example, we might prefer that administrators have to explicitly request access on each wiki they want to use IPInfo on.

If we decide to allow the preferences to be set globally, T&S needs to be aware that there are two possible places they need to look at (e.g. if they want to know who has access to IPInfo).

We should also be aware that allowing options to be set globally increases the amount of testing necessary (in my experience by a significant amount).

Steps to reproduce problem

To enable these options globally:

  1. Clone and enable GlobalPreferences extension ( wfLoadExtension("GlobalPreferences"); )
  2. Go to Special:GlobalPreferences (e.g. https://en.wikipedia.beta.wmflabs.org/wiki/Special:GlobalPreferences)
  3. Click on the "Beta features" tab
  4. Scroll down to the "IP Info" checkbox
  5. Click both checkboxes to make it global and turn it on globally
  6. Click Save
  7. Go to the "User profile" tab
  8. Scroll down to the section titled "IP Information"
  9. Check all four checkboxes to enable both options globally
  10. Click Save
Screenshots

The IP Info checkbox on the Beta features tab:

global_pref_beta.png (385×883 px, 41 KB)

IP Information section on the User profile tab:

global_pref_access.png (119×797 px, 5 KB)

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Aklapper added a subscriber: Niharika.

@Niharika: Removing task assignee as this open task has been assigned for more than two years - see the email sent to all task assignees on 2024-04-15.
Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome! :)
If this task has been resolved in the meantime, or should not be worked on by anybody ("declined"), please update its task status via "Add Action… 🡒 Change Status".
Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator. Thanks!

@Niharika is there anything we want to do with this task?

@Niharika is there anything we want to do with this task?

@Niharika should this be a blocker to major / global pilot wiki deployment?

Sorry for my lack of response here. There are Legal obstacles to resolve before this can be done. It's on their back-burner afaik so we shouldn't assume this as a blocker to anything right now.

We discussed this with @MMoss_WMF , and we're approved to go ahead and make a global preference for IPinfo that works like the global preference for IP reveal.

Dreamy_Jazz renamed this task from Investigate setting IPInfo user preferences as Global Preferences to Make it possible to set the IPInfo user preference globally.Feb 6 2025, 4:30 PM
Dreamy_Jazz updated the task description. (Show Details)
Dreamy_Jazz moved this task from Future / Maybe to Up Next on the IP Info board.
Dreamy_Jazz raised the priority of this task from Low to Needs Triage.

Change #1117938 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/IPInfo@master] Make IPInfo use agreement preference global

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

Dreamy_Jazz changed the task status from Open to Stalled.Feb 26 2025, 1:17 PM
Dreamy_Jazz removed Dreamy_Jazz as the assignee of this task.

Change #1146607 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Support 'create' option for 'global' in options API

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

Change #1146607 merged by jenkins-bot:

[mediawiki/core@master] Support 'create' option for 'global' in options API

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

Change #1148357 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/IPInfo@master] [WIP] Create AbstractPreferencesHandler

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

Change #1148369 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/IPInfo@master] Replace IPInfo use agreement preference strings with constant

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

Change #1148372 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[integration/config@master] Zuul: [mediawiki/extensions/IPInfo] Add GlobalPreferences dependency

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

Change #1148372 merged by jenkins-bot:

[integration/config@master] Zuul: [mediawiki/extensions/IPInfo] Add GlobalPreferences dependency

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

Change #1148357 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] Create AbstractPreferencesHandler

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

Change #1149757 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] [WIP] Add LocalUserOptionsStoreSave hook

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

Change #1149767 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/GlobalPreferences@master] [WIP] Run set preferences hook in GlobalUserOptionsStore

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

Change #1149757 merged by jenkins-bot:

[mediawiki/core@master] Add LocalUserOptionsStoreSave hook

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

Change #1149767 merged by jenkins-bot:

[mediawiki/extensions/GlobalPreferences@master] Run set preferences hook in GlobalUserOptionsStore

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

Change #1152040 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/IPInfo@master] Don't unset ipinfo-use-agreement when BetaFeatures disabled

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

Change #1148369 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] Replace IPInfo use agreement preference strings with constant

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

Change #1152040 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] Don't unset ipinfo-use-agreement when BetaFeatures disabled

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

Change #1117938 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] Make IPInfo use agreement preference global

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

Testing locally across a few different connected wikis, one without temp accounts (so you have to enable IPInfo as a beta feature first). I tested various varieties of global and local settings for the IPInfo opt-in option and different user rights (e.g. full and basic IPInfo access).

I briefly tested on beta as well, including users in the blocked from the IP Information tool group.

I notice that on Special:Contributions, when you use the opt-in checkbox it now sets the option globally.

I notice that after I opt-in globally on a wiki, a log entry is made (just on that wiki) in Special:Log?type=ipinfo stating: <user> globally enabled their own access to IP Information

A couple of (potential) bugs, or things to keep in mind:

  • If you opt-in globally, then set a local override to opt-out, when you go to Special:Contributions you will see the opt-in checkbox. Checking this and submitting you will see The IP information could not be retrieved. This is because the API request tries to set the global option, but in fact it would need to change the local override to enable IPInfo locally.
  • If I opt-in globally, I see a log entry saying I enabled IPInfo. If I do a local override opting-out, I see a log entry saying I disabled IPInfo. If I remove the local override, no log entry is made. Because the global option now comes into force, I can access IPInfo even though the last log entry on that wiki states I disabled it.

Test environments:

Thanks @dom_walden.

A couple of (potential) bugs, or things to keep in mind:
If you opt-in globally, then set a local override to opt-out, when you go to Special:Contributions you will see the opt-in checkbox. Checking this and submitting you will see The IP information could not be retrieved. This is because the API request tries to set the global option, but in fact it would need to change the local override to enable IPInfo locally.

A fix here could be to remove the local opt-out override when the user opt-in on Special:Contributions. This is quite an edge case so I'm okay with not fixing this.

If I opt-in globally, I see a log entry saying I enabled IPInfo. If I do a local override opting-out, I see a log entry saying I disabled IPInfo. If I remove the local override, no log entry is made. Because the global option now comes into force, I can access IPInfo even though the last log entry on that wiki states I disabled it.

This could potentially be problematic. When the user opts-in globally does the log entry say IPInfo was enabled globally?

This could potentially be problematic. When the user opts-in globally does the log entry say IPInfo was enabled globally?

Yes. The log entry says <user> globally enabled their own access to IP Information. It is when I remove the local override that no log entry is made, so there is no indication that the user has fallen back to whatever the global value is.

cc @Niharika do we need to address any of the points raised in QA or can we just close this?

BOLDly closing this