Page MenuHomePhabricator

Stop using pg.GeneratorFactory.gens to detect whether a generator was specified
Open, LowPublicFeature

Description

pg.GeneratorFactory.gens is currently (mis)used as a marker to determine whether a generator has been specified via pagegenerators options.

This approach is fragile and introduces implicit state coupling between command-line option handling and generator construction logic.

Problem
gens is not intended to represent configuration state.
Using it as a validation mechanism for generator presence is indirect and error-prone.
It can lead to incorrect assumptions depending on the order in which options are processed.
See T430093 as a sample.

Expected behavior

Generator presence should be tracked explicitly instead of being inferred from GeneratorFactory.gens or determined after getCombinedGenerator call

Proposed changes
Prevent pg.GeneratorFactory.gens from beeing used to vaildate that e generator was specified. Introduce an explicit mechanism to track generator selection state.

Details

Event Timeline

Xqt triaged this task as Low priority.Jun 25 2026, 10:58 AM
Xqt changed the subtype of this task from "Task" to "Feature Request".

Change #1328326 had a related patch set uploaded (by Mahveotm; author: Mahveotm):

[pywikibot/core@master] pagegenerators: Track generator options explicitly

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