Page MenuHomePhabricator

IP Info feature should be made available as a Beta feature for launch [M]
Closed, ResolvedPublic

Description

Motivation

Beta features allow us to roll out changes in a limited way and test them out before a wider release. Beta Features appear under the "Beta Features" tab in Special:Preferences and look something like this:

image.png (1ร—1 px, 245 KB)

This presents a convenient way for the community to discover, discuss and provide feedback on new and upcoming changes. Because of these benefits, and the wide reaching impact of IP Info, it is advantageous to release IP Info as a beta feature.

AC

If a user has the ipinfo right:

  • IP Info appears in the list of beta features on Special:Preferences#mw-prefsection-betafeatures
  • The "IP information" section does not appear on Special:Preferences (User profile tab), unless the user has enabled the beta feature
  • When a user first enables the IP Info beta feature, the "IP information" section appears on Special:Preferences (User profile tab). The states of the checkboxes will be handled in T297897.
  • When the user visits Special:Contributions for an IP address, they will be presented with the data disclaimer (see T264150)
  • Whenever a user disables the IP Info beta feature, the "IP information" section disappears from Special:Preferences (User profile tab) again
  • If a user then re-enables the beta feature, the "IP information" section reappears on Special:Preferences (User profile tab) again. The states of the checkboxes will be handled in T297897.
  • Checking/unchecking the checkboxes on Special:Preferences (User profile tab) has no effect on whether the beta feature is enabled or disabled

If a user does not have the ipinfo right:

  • IP Info is not listed under beta features; the "IP information" section on Special:Preferences is not shown
Notes
  • The BetaFeatures extension manual has detailed notes on how to define beta features
  • When the user enables a beta feature (manually or via the auto-enable feature), a user preference is set corresponding to the internal name of the feature, e.g. if we define the ipinfo-beta-feature beta feature via the GetBetaFeaturePreferences hook, then the user preference will be called ipinfo-beta-feature
  • No hooks are fired when a beta feature is enabled or disabled so we're going to have to monitor all user preference changes and manually keep it in sync with the other user preference:
public function onSaveUserOptions( UserIdentity $user, array &$modifiedOptions, array $originalOptions ) {
     // The user is enabling the feature via Special:Preferences?
    if ( isset( $modifiedOptions[ 'ipinfo' ] ) {
        $modifiedOptions[ 'ipinfo-beta-feature' ] = $modifiedOptions[ 'ipinfo' ];
    }

    // The user is enabling the beta feature?
    if ( isset( $modifiedOptions[ 'ipinfo-beta-feature' ] ) {
        $modifiedOptions[ 'ipinfo' ] = $modifiedOptions[ 'ipinfo-beta-feature' ];
    }
}

Event Timeline

Niharika triaged this task as Medium priority.Oct 7 2021, 11:14 PM
Niharika created this task.
Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptOct 7 2021, 11:14 PM
ARamirez_WMF renamed this task from IP Info feature should be made available via as a Beta feature for launch to IP Info feature should be made available via as a Beta feature for launch [M].Nov 3 2021, 4:39 PM
Tchanders renamed this task from IP Info feature should be made available via as a Beta feature for launch [M] to IP Info feature should be made available as a Beta feature for launch [M].Nov 18 2021, 4:50 PM

Change 741735 had a related patch set uploaded (by AGueyte; author: AGueyte):

[mediawiki/extensions/IPInfo@master] Add IP Info to Beta Feature

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

  • Once the beta feature is enabled, the feature is auto-enabled in preferences but the terms are not auto-accepted

[...]

  • Is the beta feature auto-enabled if someone turns on the setting? Yes

There have been some questions asked about what these mean - can I try to clarify them?

If a user has the ipinfo right:

  • IP Info appears in the list of beta features on Special:Preferences#mw-prefsection-betafeatures
  • The "IP information" section appears on Special:Preferences (User profile tab), whether the user has enabled the beta feature or not
  • Whenever a user enables the IP Info beta feature, this also checks the first checkbox on Special:Preferences (User profile tab):

screenshot.png (104ร—566 px, 16 KB)

  • Whenever a user disables the IP Info beta feature, this also unchecks the first checkbox on Special:Preferences (User profile tab)
  • Whenever a user checks the first checkbox on Special:Preferences (User profile tab), this also enables the beta feature
  • Whenever a user unchecks the first checkbox on Special:Preferences (User profile tab), this also disables the beta feature

If a user does not have the ipinfo right:

  • IP Info is not listed under beta features; the "IP information" section on Special:Preferences is not shown

@Niharika @Prtksxna is this correct? Pinging also @AGueyte who is working on the patch.

I do have concerns regarding these two:

Whenever a user disables the IP Info beta feature, this also unchecks the first checkbox on Special:Preferences (User profile tab)

Should their choice to have IPInfo beta feature disabled impact their preferences in the User tab?

Whenever a user checks the first checkbox on Special:Preferences (User profile tab), this also enables the beta feature

Should this determine to enable the beta feature on their wiki?

  • The "IP information" section appears on Special:Preferences (User profile tab), whether the user has enabled the beta feature or not

I am not sure about this one. Could it be confusing to see preferences for a feature that you haven't even enabled? Another way of looking at it would be that this is another way to enable the beta feature?

I think a BetaFeature shouldn't affect any part of the product till its been enabled (through the beta tab in special prefs). Do we know of beta features that do this differently?

Is the beta feature auto-enabled if someone turns on the setting? Yes

I don't think I fully understand this use-case, especially as its nested under "If the beta feature is removed but was enabled, then the feature remains enabled".

Thank you @Prtksxna and @AGueyte. I agree with both of your concerns about entanglement between the main preference and the beta feature. I realise I didn't mention that I don't actually think what I outlined in T292802#7544208 is the best user experience; it's just what I thought the AC were asking for...

I'd prefer something along these lines (which I think might address your concerns):

If a user has the ipinfo right:

  • IP Info appears in the list of beta features on Special:Preferences#mw-prefsection-betafeatures
  • The "IP information" section does not appear on Special:Preferences (User profile tab), unless the user has enabled the beta feature
  • When a user first enables the IP Info beta feature, the "IP information" section appears on Special:Preferences (User profile tab), but everything is unchecked at first
  • Whenever a user disables the IP Info beta feature, the "IP information" section disappears from Special:Preferences (User profile tab) again
  • If a user then re-enables the beta feature, the "IP information" section reappears on Special:Preferences (User profile tab) again. Question: In this case, should the checkboxes in the "IP informatoin" section be unchecked again, or in the same state they were in before the user disabled the beta feature? (I think the former is possible to implement, but tricky to maintain.)
  • Checking/unchecking the checkboxes on Special:Preferences (User profile tab) has no effect on whether the beta feature is enabled or disabled

If a user does not have the ipinfo right:

  • (Same as T292802#7544208) IP Info is not listed under beta features; the "IP information" section on Special:Preferences is not shown

Thank you, @Tchanders for the clarification!
I also agree with the behaviors you have listed above.

Question: In this case, should the checkboxes in the "IP information" section be unchecked again, or in the same state they were in before the user disabled the beta feature? (I think the former is possible to implement, but tricky to maintain.)

I would rather want the checkboxes to be unchecked when they re-enable the feature as they are re-starting the experience from the beginning.

Also, since the checkboxes will only appear after enabling the beta feature, should we add a note on the feature description to let them know about checking boxes in their user preferences tab? cc @Prtksxna

Thank you both!

When a user first enables the IP Info beta feature, the "IP information" section appears on Special:Preferences (User profile tab), but everything is unchecked at first

Just confirming if this is the case in the current implementation โ€” there are two checkboxes in the preferences, one to show the tool and the other to agree to the T&C. If this is the case then the default state should be that the first one is checked and the second one is not.

When a user first enables the IP Info beta feature, the "IP information" section appears on Special:Preferences (User profile tab), but everything is unchecked at first

Just confirming if this is the case in the current implementation โ€” there are two checkboxes in the preferences, one to show the tool and the other to agree to the T&C. If this is the case then the default state should be that the first one is checked and the second one is not.

@Prtksxna Yes, in the current implementation we have the two checkboxes. Would these updated AC be correct?

[...]

  • When a user first enables the IP Info beta feature, the "IP information" section appears on Special:Preferences (User profile tab), but everything is unchecked at first with the first box checked and the second unchecked

[...]

  • If a user then re-enables the beta feature, the "IP information" section reappears on Special:Preferences (User profile tab) again. Question: In this case, should the checkboxes in the "IP informatoin" section be unchecked again, or in the same state they were in before the user disabled the beta feature? (I think the former is possible to implement, but tricky to maintain.) The first box is checked and the second unchecked, regardless of what state they were in when the user disabled the feature.

[...]

If so, I'll add them to the task description. (Though we might separate the checkbox checking into a subtask to prevent this task from getting larger.)

If so, I'll add them to the task description. (Though we might separate the checkbox checking into a subtask to prevent this task from getting larger.)

This is perfect! Thanks @Tchanders ๐Ÿ™๐Ÿพ(Sure, splitting makes sense)

Change 741735 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] Add IP Info to Beta Feature

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

If a user has ipinfo-enable and ipinfo-use-agreement enabled but ipinfo-beta-feature-enable disabled (there are some circumstances where this can be the case[1]), they won't see IPInfo via the UI but can still access IPInfo if they go directly via the API (e.g. https://en.wikipedia.beta.wmflabs.org/w/rest.php/ipinfo/v0/revision/$revision_id).

@Prtksxna @Niharika I wonder if this is OK?

Ref

  1. For example, if they enable the beta feature and check the two other checkboxes, then disable the beta feature, both ipinfo-enable and ipinfo-use-agreement will remain set in the database (until such time as the user saves their preferences again or re-enables the beta feature). There are also circumstances involving GlobalPreferences which I won't go into right now.

My understanding is that if they've disable the feature they shouldn't be able to access any part of it. @Tchanders what do you think?

I agree @Prtksxna - filed as a a follow-up: T299050

Thanks @dom_walden. I'll leave it to you to move this task on, in case there are any other issues.

If a user has the ipinfo right:

All the above is true.

  • The "IP information" section does not appear on Special:Preferences (User profile tab), unless the user has enabled the beta feature

Yep.

  • When a user first enables the IP Info beta feature, the "IP information" section appears on Special:Preferences (User profile tab). The states of the checkboxes will be handled in T297897.

Yep.

  • When the user visits Special:Contributions for an IP address, they will be presented with the data disclaimer (see T264150)

They will only see this after they enable the beta feature and check Show the IP Information tool on Special:Contributions page for IP addresses.

  • Whenever a user disables the IP Info beta feature, the "IP information" section disappears from Special:Preferences (User profile tab) again

Yep.

However, the two options in that section will remain enabled in the database until the user either submits Special:Preferences again or re-enables the beta feature.

  • If a user then re-enables the beta feature, the "IP information" section reappears on Special:Preferences (User profile tab) again. The states of the checkboxes will be handled in T297897.

Yep. Both options in that section are unset.

  • Checking/unchecking the checkboxes on Special:Preferences (User profile tab) has no effect on whether the beta feature is enabled or disabled

Yep.

If a user does not have the ipinfo right:

  • IP Info is not listed under beta features; the "IP information" section on Special:Preferences is not shown

Yep.

I did not do anymore testing of this option as a global preference. This is because we will soon be removing it as a global preference (T299368), so there did not seem to be any point.

Test Environment: https://en.wikipedia.beta.wmflabs.org IP Info 0.0.0 (41a1e35) 07:12, 17 January 2022.

To be clear, per the Beta Feature process, this is great, thank you.

Change 773348 had a related patch set uploaded (by STran; author: STran):

[operations/mediawiki-config@master] Add IPInfo to BetaFeatures

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

Change 773348 merged by jenkins-bot:

[operations/mediawiki-config@master] Add IPInfo to BetaFeatures

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

Mentioned in SAL (#wikimedia-operations) [2022-03-24T13:10:26Z] <reedy@deploy1002> Synchronized wmf-config/InitialiseSettings.php: T292802 (duration: 00m 50s)