[Wikidata-bugs] [Maniphest] [Commented On] T145138: Wikibase Lua API have breaking change

2016-10-03 Thread gerritbot
gerritbot added a comment.
Change 313380 merged by jenkins-bot:
Create new Lua functions that return term, term language

https://gerrit.wikimedia.org/r/313380TASK DETAILhttps://phabricator.wikimedia.org/T145138EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: hoo, gerritbotCc: aude, Lucie, IKhitron, Stashbot, greg, gerritbot, hoo, daniel, Aklapper, eranroz, Lewizho99, Maathavan, D3r1ck01, Izno, Wikidata-bugs, Dinoguy1000, jayvdb, MrStradivarius, Anomie, Jackmcbarn, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T145138: Wikibase Lua API have breaking change

2016-09-29 Thread gerritbot
gerritbot added a comment.
Change 313380 had a related patch set uploaded (by Hoo man):
Create new Lua functions that return term, term language

https://gerrit.wikimedia.org/r/313380TASK DETAILhttps://phabricator.wikimedia.org/T145138EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: gerritbotCc: aude, Lucie, IKhitron, Stashbot, greg, gerritbot, hoo, daniel, Aklapper, eranroz, Lewizho99, Maathavan, D3r1ck01, Izno, Wikidata-bugs, Dinoguy1000, jayvdb, MrStradivarius, Anomie, Jackmcbarn, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T145138: Wikibase Lua API have breaking change

2016-09-21 Thread gerritbot
gerritbot added a comment.
Change 311711 abandoned by Aude:
Don't use multiple return values

Reason:
don't think wmf19 will ever be deployed again, and certainly not with new wikibase code

https://gerrit.wikimedia.org/r/311711TASK DETAILhttps://phabricator.wikimedia.org/T145138EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: gerritbotCc: aude, Lucie, IKhitron, Stashbot, greg, gerritbot, hoo, daniel, Aklapper, eranroz, Lewizho99, Maathavan, D3r1ck01, Izno, Wikidata-bugs, Dinoguy1000, jayvdb, MrStradivarius, Anomie, Jackmcbarn, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T145138: Wikibase Lua API have breaking change

2016-09-20 Thread gerritbot
gerritbot added a comment.
Change 311711 had a related patch set uploaded (by Aude):
Don't use multiple return values

https://gerrit.wikimedia.org/r/311711TASK DETAILhttps://phabricator.wikimedia.org/T145138EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: gerritbotCc: aude, Lucie, IKhitron, Stashbot, greg, gerritbot, hoo, daniel, Aklapper, eranroz, D3r1ck01, Izno, Wikidata-bugs, Dinoguy1000, jayvdb, MrStradivarius, Anomie, Jackmcbarn, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T145138: Wikibase Lua API have breaking change

2016-09-19 Thread hoo
hoo added a comment.

In T145138#2648493, @aude wrote:
looks like we will need to cherry pick https://gerrit.wikimedia.org/r/#/c/309477/ when we make a new deployment branch


Yes, please.

I'm going to start working as usual again from Thursday on. I'll pick this up then ASAP.TASK DETAILhttps://phabricator.wikimedia.org/T145138EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: hooCc: aude, Lucie, IKhitron, Stashbot, greg, gerritbot, hoo, daniel, Aklapper, eranroz, D3r1ck01, Izno, Wikidata-bugs, Dinoguy1000, jayvdb, MrStradivarius, Anomie, Jackmcbarn, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T145138: Wikibase Lua API have breaking change

2016-09-19 Thread aude
aude added a comment.
looks like we will need to cherry pick https://gerrit.wikimedia.org/r/#/c/309477/ when we make a new deployment branchTASK DETAILhttps://phabricator.wikimedia.org/T145138EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: audeCc: aude, Lucie, IKhitron, Stashbot, greg, gerritbot, hoo, daniel, Aklapper, eranroz, D3r1ck01, Izno, Wikidata-bugs, Dinoguy1000, jayvdb, MrStradivarius, Anomie, Jackmcbarn, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T145138: Wikibase Lua API have breaking change

2016-09-09 Thread daniel
daniel added a comment.
@Lucie no problem except readability, and no real advantage over adding a new function. In both cases, old code functions as is, and code wanting access to the language needs to change the function call (either change the name, or give a parameter).

In general, boolean options should be avoided, since getFoo( $id,  false, false, true ) doesn't tell you much. getFoo( $id, SUGAR | MILK ) is better, getFoo( $id, 'sugar', 'milk' ) would also work.

Also, a parameter that changes the structure or type of the return value is somewhat surprising.TASK DETAILhttps://phabricator.wikimedia.org/T145138EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: danielCc: Lucie, IKhitron, Stashbot, greg, gerritbot, hoo, daniel, Aklapper, eranroz, D3r1ck01, Izno, Wikidata-bugs, aude, Dinoguy1000, jayvdb, MrStradivarius, Anomie, Jackmcbarn, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T145138: Wikibase Lua API have breaking change

2016-09-09 Thread Lucie
Lucie added a comment.
Are there strong arguments against just adding a second parameter to the function and default it to false? This way, it's not breaking anything and the new functionality is just introduced in a very smooth way. It occurs to me it would be the safest solution.TASK DETAILhttps://phabricator.wikimedia.org/T145138EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: LucieCc: Lucie, IKhitron, Stashbot, greg, gerritbot, hoo, daniel, Aklapper, eranroz, D3r1ck01, Izno, Wikidata-bugs, aude, Dinoguy1000, jayvdb, MrStradivarius, Anomie, Jackmcbarn, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T145138: Wikibase Lua API have breaking change

2016-09-09 Thread daniel
daniel added a comment.

In T145138#2623040, @hoo wrote:
But still for example the length operator (#label) wont correctly work.


May be the lesser evil...

Or just make a new function. Calling code that want to use the language needs to be changed anyway.TASK DETAILhttps://phabricator.wikimedia.org/T145138EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: danielCc: IKhitron, Stashbot, greg, gerritbot, hoo, daniel, Aklapper, eranroz, D3r1ck01, Izno, Wikidata-bugs, aude, Dinoguy1000, jayvdb, MrStradivarius, Anomie, Jackmcbarn, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T145138: Wikibase Lua API have breaking change

2016-09-09 Thread hoo
hoo added a comment.
If we change the metatable in the above example to the following, string concatenation will work:

setmetatable( definition, { __index = Label, __tostring = function( self ) return self:toString() end, __concat = function(t, str) return tostring(t) .. str end } )

But still for example the length operator (#label) wont correctly work.TASK DETAILhttps://phabricator.wikimedia.org/T145138EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: hooCc: IKhitron, Stashbot, greg, gerritbot, hoo, daniel, Aklapper, eranroz, D3r1ck01, Izno, Wikidata-bugs, aude, Dinoguy1000, jayvdb, MrStradivarius, Anomie, Jackmcbarn, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T145138: Wikibase Lua API have breaking change

2016-09-09 Thread hoo
hoo added a comment.

In T145138#2622279, @eranroz wrote:
Just to mention another option - label can return label object rather than string. e.g

function Label.new( label, lang )
definition={label=label, lang=lang}
setmetatable( definition, { __index = Label, __tostring = function( self ) return self:toString() end   } )
return definition
end
function Label:toString()
  return self.label
end


I think that's even more breaking than what we have now, because you can't just string concatenate with it.TASK DETAILhttps://phabricator.wikimedia.org/T145138EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: hooCc: IKhitron, Stashbot, greg, gerritbot, hoo, daniel, Aklapper, eranroz, D3r1ck01, Izno, Wikidata-bugs, aude, Dinoguy1000, jayvdb, MrStradivarius, Anomie, Jackmcbarn, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T145138: Wikibase Lua API have breaking change

2016-09-08 Thread eranroz
eranroz added a comment.
Just to mention another option - label can return label object rather than string. e.g

function Label.new( label, lang )
definition={label=label, lang=lang}
setmetatable( definition, { __index = Label, __tostring = function( self ) return self:toString() end   } )
return definition
end
function Label:toString()
  return self:label()
endTASK DETAILhttps://phabricator.wikimedia.org/T145138EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: eranrozCc: Stashbot, greg, gerritbot, hoo, daniel, Aklapper, eranroz, D3r1ck01, Izno, Wikidata-bugs, aude, Dinoguy1000, jayvdb, MrStradivarius, Anomie, Jackmcbarn, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T145138: Wikibase Lua API have breaking change

2016-09-08 Thread Stashbot
Stashbot added a comment.
Mentioned in SAL [2016-09-09T00:06:34Z]  Synchronized php-1.28.0-wmf.18/extensions/Wikidata: Don't use multiple return values (T145138) (duration: 02m 24s)TASK DETAILhttps://phabricator.wikimedia.org/T145138EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: StashbotCc: Stashbot, greg, gerritbot, hoo, daniel, Aklapper, eranroz, Lewizho99, Maathavan, D3r1ck01, Izno, Wikidata-bugs, aude, Dinoguy1000, jayvdb, MrStradivarius, Anomie, Jackmcbarn, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T145138: Wikibase Lua API have breaking change

2016-09-08 Thread gerritbot
gerritbot added a comment.
Change 309477 merged by jenkins-bot:
Don't use multiple return values

https://gerrit.wikimedia.org/r/309477TASK DETAILhttps://phabricator.wikimedia.org/T145138EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: gerritbotCc: greg, gerritbot, hoo, daniel, Aklapper, eranroz, Lewizho99, Maathavan, D3r1ck01, Izno, Wikidata-bugs, aude, Dinoguy1000, jayvdb, MrStradivarius, Anomie, Jackmcbarn, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T145138: Wikibase Lua API have breaking change

2016-09-08 Thread gerritbot
gerritbot added a comment.
Change 309477 had a related patch set uploaded (by Hoo man):
Don't use multiple return values

https://gerrit.wikimedia.org/r/309477TASK DETAILhttps://phabricator.wikimedia.org/T145138EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: gerritbotCc: gerritbot, hoo, daniel, Aklapper, eranroz, D3r1ck01, Izno, Wikidata-bugs, aude, Dinoguy1000, jayvdb, MrStradivarius, Anomie, Jackmcbarn, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs


[Wikidata-bugs] [Maniphest] [Commented On] T145138: Wikibase Lua API have breaking change

2016-09-08 Thread hoo
hoo added a comment.
The problem only arouses if the function's return values are directly returned to Scribunto, because Scribunto apparently just string appends all return values, which is very unexpected behavior for me, not consistent with Lua semantics.TASK DETAILhttps://phabricator.wikimedia.org/T145138EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: hooCc: hoo, daniel, Aklapper, eranroz, D3r1ck01, Izno, Wikidata-bugs, aude, Dinoguy1000, jayvdb, MrStradivarius, Anomie, Jackmcbarn, Mbch331___
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs