Last modified: 2014-02-26 12:55:30 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T45818, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 43818 - Current conventions for declaring schema are repetitive and could lead to collisions
Current conventions for declaring schema are repetitive and could lead to col...
Status: RESOLVED WONTFIX
Product: Analytics
Classification: Unclassified
EventLogging (Other open bugs)
unspecified
All All
: Low normal
: ---
Assigned To: Ori Livneh
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-10 11:05 UTC by Ori Livneh
Modified: 2014-02-26 12:55 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Ori Livneh 2013-01-10 11:05:15 UTC
02:51 <spagewmf> What if two pieces of code wanted to log to the same schema but nominated different versions?   I guess it's unlikely but seems fragile.  Maybe you say you want GettingStarted, 5432101 and don't get to give it a module name
02:52 <ori-l> $wgResourceModules[ 'schema.GettingStarted@4993508' ] = array( ... )
02:52 <ori-l> ?
02:53 <ori-l> there would work as-is right now
02:53 <ori-l> we don't do anything special with the module name
02:53 <ori-l> you can name the module after a pet goldfish for all the extension cares
02:54 <ori-l> but if there's an established convention, there's a chance of a collision, it's true
02:54 <spagewmf> Yes we could have that convention.  But I'm thinking you wouldn't even name the schema in wgResourceModules, you'd just say  depencySchema => 'GettingStarted@4993508' in the definition of a module that needs it and that would give you the schema.
02:55 <ori-l> yes, that would work -- I don't think RL would choke on an unfamiliar key
02:56 <ori-l> another possibility would be to write a function that takes a schema name and an ID, declares the resource loader module, and returns its name, so you would:
02:56 <ori-l> 'dependencies' => array( 'jquery.cookie', 'jquery.json', efSchemaModule( 'GettingStarted', 4993508 ) )
02:57 <ori-l> adding a key would be cleaner
02:58 <spagewmf> Yeah, something like that.
02:58 <ori-l> it could also solve the current duplication, which I loathe.. the $wgResourceModules[ 'schema.Foo' ] = array( 'schema' => 'Foo', ... )
02:59 <ori-l> i like your suggestion better
Comment 1 Matthew Flaschen 2013-01-10 17:50:58 UTC
I'm not convinced that using two versions of the same schema is a feature.

If there's a collision, it's pretty easy to check which won with:

/load.php?debug=true&modules=schema.SchemaName&only=scripts

If that happens, though, it probably means a schema is being used for two different purposes, in which case it should be forked on Meta.

As far as I can tell, all modules have to have names.  It would be confusing otherwise, and I don't think ResourceLoader supports it technically.

I also don't see how:

'dependencies' => array( 'jquery.cookie', 'jquery.json',
efSchemaModule( 'GettingStarted', 4993508 ) )

could work without modifying e.g. ResourceLoaderFileModule to know about EventLogging, which would be bad.
Comment 2 Andre Klapper 2014-02-26 12:55:30 UTC
[moving from MediaWiki extensions to Analytics product - see bug 61946]

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links