Page MenuHomePhabricator

Introduce a global on/off switch for the extension and make it available via CommunityConfiguration
Closed, ResolvedPublic4 Estimated Story Points

Description

Add a single global switch that controls whether Article Guidance is available on a wiki, and expose it through Community Configuration.

NOTE: This is separate from ArticleGuidanceRedirectEnabled.

When Article Guidance is globally disabled, the wiki should behave as if the Article Guidance user-facing feature were not enabled.

Expected behavior

Introduce an ArticleGuidanceEnabled configuration value.

The effective value should come from Community Configuration when an on-wiki value has been explicitly set. Otherwise, it must fall back to the state that would have applied before this setting was introduced.

When ArticleGuidanceEnabled is false:

  • red links do not redirect to Article Guidance, regardless of ArticleGuidanceRedirectEnabled;
  • Special:NewArticle does not expose the Article Guidance workflow when accessed directly;
  • the articleguidance-enable user preference is not offered;
  • Article Guidance client-side functionality must not expose another way to enter the disabled feature.
NOTE: Some things can be exposed, such as presence of AG related interface messages.

When ArticleGuidanceEnabled is true, existing Article Guidance behavior is unchanged and the more specific configuration values, such as ArticleGuidanceRedirectEnabled and the junior-editor restriction, continue to determine redirect behavior.

Implementation notes

T437586: Allow configuring redirects via Community Configuration introduced the Article Guidance Community Configuration provider. Extend that provider/schema.

Add the global setting to the extension configuration and make the effective Community Configuration value available to the places that decide whether Article Guidance is exposed.

Check the global switch as early as practical in the relevant paths, in particular:

  • RedLinkRedirectHandler
  • SpecialNewArticle
  • the user preference
  • parser hooks
  • any client-side entry path that can expose Article Guidance independently

Avoid duplicating the Community Configuration lookup or global-enabled logic throughout the extension; prefer a shared way of obtaining the effective feature state.

The global switch should take precedence over the redirect settings. For example:

Global enabledRedirect enabledResult
falsefalseArticle Guidance unavailable; no redirect
falsetrueArticle Guidance unavailable; no redirect
truefalseArticle Guidance available directly; no automatic redirect
truetrueArticle Guidance available; redirect according to the remaining eligibility settings

Dependencies and prerequisites

No design work is required beyond defining the Community Configuration label/help text for the new global checkbox.

No data migration or schema migration is expected, but the introduction of the new setting may require a configuration/fallback strategy to preserve existing wiki enablement state.

Acceptance criteria

  • Community Configuration exposes a global Article Guidance enable/disable setting.
  • Introducing the new setting does not change existing Article Guidance availability:
    • Article Guidance stays enabled on every wiki where it is currently enabled.
    • Article Guidance does not become enabled on any wiki where it is currently disabled.
  • With no explicit on-wiki value configured, the effective Article Guidance state remains the same as before this setting was introduced.
  • Changing the value through Community Configuration takes effect without a deployment.
  • When globally disabled:
    • red links never redirect into Article Guidance;
    • direct access to Special:NewArticle does not expose the Article Guidance workflow;
    • the Article Guidance user preference is not shown.
  • ArticleGuidanceRedirectEnabled=true cannot override a globally disabled feature.
  • When globally enabled, existing redirect, eligibility and direct-access behavior continues to work.
  • The existing Community Configuration redirect settings introduced in T437586: Allow configuring redirects via Community Configuration continue to work.

QA plan

Risks and affected areas

The main risks are:

  • accidentally disabling Article Guidance on wikis where it is currently enabled;
  • accidentally enabling Article Guidance on wikis where it is currently disabled;
  • applying the switch to one entry path but leaving Article Guidance accessible through another;
  • getting precedence wrong between the global switch and ArticleGuidanceRedirectEnabled;
  • failing to preserve the existing state when no Community Configuration value has been set.

The affected areas are wiki-level feature enablement, the red-link redirect, direct Special:NewArticle access, the user preference, and Community Configuration.

Automated testing

Consider automated coverage for:

  • existing enabled configuration + no Community Configuration override → Article Guidance remains enabled;
  • existing disabled configuration + no Community Configuration override → Article Guidance remains disabled;
  • globally disabled + redirect enabled → no redirect;
  • globally enabled + redirect enabled → existing redirect behavior remains;
  • globally enabled + redirect disabled → direct Article Guidance access remains available without automatic redirect;
  • the disabled state of Special:NewArticle;
  • hiding the user preference while globally disabled;
  • Community Configuration override and fallback behavior.

Manual testing

Test on a local wiki or Patch Demo with Article Guidance and Community Configuration installed.

First verify migration/fallback behavior:

  1. Configure the wiki as Article Guidance-enabled using the existing deployment configuration, without setting the new Community Configuration value.
    • Article Guidance remains enabled.
  2. Configure the wiki as Article Guidance-disabled using the existing deployment configuration, without setting the new Community Configuration value.
    • Article Guidance remains unavailable.

Then test Community Configuration overrides on an enabled wiki:

  1. Disable Article Guidance through Special:CommunityConfiguration.
    • An in-scope red link uses the normal editor rather than Article Guidance.
    • Directly visiting Special:NewArticle does not expose the Article Guidance workflow.
    • The Article Guidance user preference is not offered.
  2. Re-enable Article Guidance while disabling redirects.
    • Direct Special:NewArticle access works.
    • Red links use the normal editor.
  3. Enable both Article Guidance and redirects.
    • An eligible red link redirects to Article Guidance.
    • Direct Special:NewArticle access works.
  4. Remove the on-wiki value and verify that behavior returns to the pre-existing deployment-configured state.

The core scenarios should be checked on both desktop and mobile where the affected entry paths are available.

No production-only verification is required; all behavior can be exercised before deployment.

Event Timeline

Nikerabbit triaged this task as Medium priority.Tue, Sep 15, 7:56 AM
Nikerabbit updated the task description. (Show Details)
Nikerabbit set the point value for this task to 4.

Change #1342278 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/ArticleGuidance@master] config: Add a global switch for Article Guidance

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

Change #1342285 had a related patch set uploaded (by Sbisson; author: Sbisson):

[operations/mediawiki-config@master] Keep Article Guidance on where it is on today

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

Change #1342278 merged by jenkins-bot:

[mediawiki/extensions/ArticleGuidance@master] config: Add a global switch for Article Guidance

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

hueitan subscribed.

the community configuration is up on test wiki now, https://test.wikipedia.org/wiki/Special:CommunityConfiguration/ArticleGuidance, but we need "admin" with permission to test it.

as of now, it is unchecked, special:newarticle is not allowed

image.png (2,900×2,128 px, 676 KB)

once it is checked, we will check if we can access special:newarticle page

Nikerabbit changed the task status from Open to In Progress.Tue, Sep 22, 11:09 AM

Change #1342285 merged by jenkins-bot:

[operations/mediawiki-config@master] Keep Article Guidance on where it is on today

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

Mentioned in SAL (#wikimedia-operations) [2026-09-22T20:35:49Z] <sbisson@deploy1003> Started scap sync-world: Backport for [[gerrit:1342285|Keep Article Guidance on where it is on today (T433293)]]

Mentioned in SAL (#wikimedia-operations) [2026-09-22T20:40:01Z] <sbisson@deploy1003> sbisson: Backport for [[gerrit:1342285|Keep Article Guidance on where it is on today (T433293)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-09-22T20:45:43Z] <sbisson@deploy1003> Finished scap sync-world: Backport for [[gerrit:1342285|Keep Article Guidance on where it is on today (T433293)]] (duration: 09m 53s)