Monday, 2015-03-09

*** e0ne has quit IRC00:49
*** kaufer has joined #openstack-api02:09
*** kaufer has quit IRC02:57
*** jamie_h has joined #openstack-api10:46
*** etoews has joined #openstack-api11:29
*** cdent has joined #openstack-api11:52
*** terrylhowe has joined #openstack-api11:58
*** annegentle has joined #openstack-api12:36
*** sigmavirus24_awa is now known as sigmavirus2412:39
*** kaufer has joined #openstack-api13:25
*** annegentle has quit IRC14:10
*** annegentle has joined #openstack-api14:15
*** annegentle has quit IRC14:54
*** annegentle has joined #openstack-api15:23
kauferIn the resource counting review https://review.openstack.org/#/c/147684/7/guidelines/counting.rst sigmevirus24 had a comment to define what is "truthy" and "falsey", do we have an existing doc to put this information in? Or any thoughts on if I should create a new miscellaneous.rst file?15:59
kauferoops ... sigmavirus24 ^16:00
sigmavirus24kaufer: let me think about that for a few16:01
kaufersigmavirus24: Sure, this seemed like the best fit but I wasn't sure if it was the right:  https://github.com/openstack/api-wg/blob/master/guidelines/general.rst16:02
sigmavirus24yeah it might be16:03
elmikothat might be a nice place, i wonder if we need a "types.rst" or something similiar?16:03
*** annegentle has quit IRC16:06
sigmavirus24so16:08
sigmavirus24I think truthy and falsey are more specific to the query parameters in that case, yes?16:08
kauferIn this case yes16:08
sigmavirus24Right, but in what other cases is it ambiguous is what I am trying to ask16:08
sigmavirus24JSON: Not ambiguous16:09
sigmavirus24XML: No longer relevant =P16:09
sigmavirus24I'm not sure where else we need booleans in an API where truthy/falsey aren't predefined by something else16:09
sigmavirus24So if it's just for query parameters, in what cases do we use truthy/falsey values in query parameters, etc.16:09
sigmavirus24I think answering those questions will help us decide where to put the reference.16:09
sigmavirus24We can always move it elsewhere if we change our minds as a matter of structuring16:10
kauferSo I know that similiar logic is also used for the all_tenants query string parameter, I've seen that in nova16:10
kauferhttps://github.com/openstack/nova/blob/master/nova/api/openstack/compute/servers.py#L195-L19616:11
kauferI can do a search for the 'bool_from_string' function to find other hits16:11
kaufersigmavirus24: Is that what you are looking for?16:12
stevellesigmavirus24: kaufer wondering if existing filtering options do truthy values in query strings. In glance & ceilometer possibly16:13
sigmavirus24kaufer: yeah16:16
kauferstevelle, sigmavirus24: I'll dig into that and see what I can find16:16
sigmavirus24kaufer: yeah I just can't imagine this being necessary other than in query strings16:16
sigmavirus24but I'm sure there's exactly one project using it elsewhere =P16:16
kaufersigmavirus24: Yes, I think that it is only in query string as well, since it is clearly defined in a request body16:18
sigmavirus24Right, and we only send query strings for list operations where we would be doing searching filtering etc. right?16:18
sigmavirus24So I think it needs to at least be referenced there16:19
kaufersigmavirus24: Yep, AFAIK16:19
sigmavirus24Not sure if we need a separate section on query parameters in general or not though16:20
sigmavirus24Which might be the place for this but yeah, I can't imagine there's much to say about query parameters16:20
kaufersigmavirus24: I'm envisioning the reference in our docs to be really simple for this (ie, use oslo bool_from_string function) so that's what I was thinking that we may want to have a miscellaneous file to put things like this in16:20
kaufersince we will need to reference it from more then 1 guideline doc16:21
sigmavirus24So, we have yet to call out a specific function etc16:21
sigmavirus24And to be honest, I'd rather it be more explicit and opinionated16:21
sigmavirus24*function, library, etc.16:21
sigmavirus24bool_from_string is also very very very accepting right? It'll accept 1, true, True, and other things right?16:22
miguelgrinbergsigmavirus24: yes: http://docs.openstack.org/developer/oslo.utils/api/strutils.html#oslo_utils.strutils.bool_from_string16:23
sigmavirus24recommending bool_from_string also ties the guideline to the implementation instead of the other way around16:23
sigmavirus24miguelgrinberg: yeah was just reading that16:23
sigmavirus24I'm not sure how often we really need anything other than "true" or "false" though16:23
miguelgrinbergdidn't know this was available, I agree with recommending it16:23
miguelgrinberg1 and 0 are nice to have too16:24
kaufer1 equates to True16:24
sigmavirus24right16:24
miguelgrinbergand then you have javascript's true vs. Python's True16:24
sigmavirus24miguelgrinberg: can you quantify how many times people would rather someone give you 1 to represent true instead of "true"?16:25
sigmavirus24I mean, assuming you don't want modern technology to behave like C.16:25
miguelgrinbergdon't know, but yesterday was working on my PyCon talk and used 1 for an option16:25
miguelgrinbergbecause it is shorter16:25
miguelgrinbergbasically my thinking is to set the variable to any value for true, and not include it in the query string at all for false16:26
miguelgrinberggiven those rules, setting var=1 is the less effort choice16:26
sigmavirus24miguelgrinberg: what if the default is true and it needs to be disabled?16:26
miguelgrinberggood point. I tend to turn things around so that always the default is false16:27
miguelgrinbergI think having a true default on a query string var is confusing16:27
miguelgrinbergbut in any case, using bool_from_string handles that well16:28
miguelgrinbergthe discussion was about whether 1 and 0 are useful or not16:28
kauferIn that case wouldn't the user would pass ‘f’, ‘false’, ‘off’, ‘n’, ‘no’, or ‘0’ to override? All those equate to False and are handled by that function16:28
sigmavirus24kaufer: right, we got side-tracked into whether every boolean query param should be false by default16:29
miguelgrinbergkaufer: yes, that's correct16:29
miguelgrinbergmy fault, sorrty16:29
sigmavirus24s/my/our/16:29
sigmavirus24I guess this boils down to "be liberal in what you accept"16:29
kauferSo I agree that in general we wouldn't want to recommend specific functions/libraries ... but in this case it seems like this function is the standard for this type of processing and I think that we need to make it easy to find in our guideline docs16:30
sigmavirus24I still would rather have the spec itself call out acceptable values. I don't think guidelines should ever be tied to implementation details of a utility function in anything16:30
sigmavirus24kaufer: a .. note:: that it exists won't bother me16:30
sigmavirus24A "you should use this because we're recommending it" would bother me16:31
miguelgrinbergit should be there as a note to clients as well, they don't have a function to come up with the accepted values16:31
kaufersigmavirus: Yes, that makes sense, I think that we need to note that it is an option but let them decide if they want to use it16:31
sigmavirus24Cool.16:32
kauferOk, so then back to my original question, any thoughts on where this note would link?16:32
sigmavirus24Yeah, not sure about that still =P16:32
sigmavirus24Perhaps a separate query parameter section just to air on the side of "We may have more to say on this"16:33
kauferI can see this being referenced from the counting guideline and from the filtering one (once that TODO is done)16:33
sigmavirus24Agreed16:33
sigmavirus24that's what :ref: is for ;)16:33
kauferYep, just wanted to point out that it will be referenced from more then 1 guideline doc16:34
elmikothat's why i was saying maybe we need a document about types in general16:34
sigmavirus24Yep16:34
sigmavirus24elmiko: what other types would we talk about?16:34
sigmavirus24I really don't have strong feelings on where it needs to live16:34
elmikoi dunno, just trying to be cautious about running across this again16:34
sigmavirus24And we can always restructure our text more later16:34
elmikotrue, it's not a huge deal16:34
sigmavirus24It can even live with the searching/filtering/pagination docs now16:34
sigmavirus24although I was hoping we might split those out into separate docs though16:35
elmikoi guess the original impulse to put it in the general doc makes the most sense lol16:35
kaufersigmavirus24: +1 ... I'd like to see them split16:35
sigmavirus24elmiko: yeah16:35
sigmavirus24works for me16:35
kauferanother option would be to create a doc whose purpose is to recommend specific functions/libraries16:36
kauferwith a disclamer that you don't have to use them, but that they exist16:36
elmikothat's an interesting thought16:36
elmikoi'm not sure how far down the implementation road we want to walk though16:36
kauferright, thus far we have been avoiding recommending specific libraries ... but i think that this is an exception16:37
kaufernot sure if there will be others, so maybe it's the wrong approach16:37
stevellethat path leads us to strongly recommending a bunch of oslo libs or the like which raises a bunch of implementation concerns.  I'd prefer to note that the code has been written and leave it at that.16:40
elmikoi don't see an issue with adding language to the general section that calls out usage of "True" and "False" in the guidelines, that may be safest for now16:40
kauferI agree, so here's my plan: Update the general.rst file with a new section for boolean query string parameters and reference the oslo lib there ... objections?16:44
sigmavirus24so I'd like to never ever add library recommendations16:44
sigmavirus24that leads us to pecan, jsonschema, warwhatever, wsgi, flask, django-rest, etc.16:44
elmikosigmavirus24++16:45
sigmavirus24I'd love to stay away from that quagmire with a 500 mile pole16:45
sigmavirus24Or 500 mile email whatever16:45
elmikokaufer: if you've got a strong idea, i'd say throw it up for review. sounds like the lib language might get clipped, but at least we can start discussing the actual phrasing then.16:46
kaufersigmavirus24: I agree, but I think that we need something here ... so when I prototyped the nova server counting work I wrote my own utility function to figure out what was True and False, then I found the oslo one, I'm trying to avoid that for others with a simple heads up that let's them know that this lib exists and that they can use it if they want to16:47
sigmavirus24kaufer: like I said, a .. note:: that it exists doesnt' bother me16:48
sigmavirus24A list of recommendations does16:48
sigmavirus24And a list of recommendations will never make it through16:48
kaufersigmavirus24: Maybe I'm misunderstanding what you think that note:: will reference; are you thinking that it will reference another guideline doc or just reference the lib function directly?16:49
sigmavirus24kaufer: .. note:: is a directive in Sphinx and it creates a call out16:51
sigmavirus24See http://toolbelt.readthedocs.org/en/latest/adapters.html#socketoptionsadapter for examples16:51
sigmavirus24That note will simply say: "A function to convert these values to a boolean already exists in oslo_utils.strutils"16:52
kaufersigmavirus24: Ok, that makes sense ... so that negates the need for a separate topic in a guideline doc, I like that approach16:52
sigmavirus24Or "already exists in oslo.utils. See <link-to-docs>oslo_utils.strutils.boolean_from_string</link> for more details"16:52
sigmavirus24And restructuredtext cares not how many notes you have: http://toolbelt.readthedocs.org/en/latest/adapters.html#tcpkeepaliveadapter16:53
elmiko..note seems like a nice solution16:53
sigmavirus24I wish there was a .. disclaimer::16:54
kaufer:)16:54
elmikolol16:54
kauferI'll push up something with the ..note and we can see how that looks16:54
kauferthanks all for the discussion, sorry that it got more involved then it needed to16:55
stevelleit's better thoroughly discussed an logged :)16:57
sigmavirus24OH RIGHT WE HAVE LOGS16:57
sigmavirus24I KEEP FORGETTING16:57
elmikostevelle++16:58
*** annegentle has joined #openstack-api17:07
*** annegentle has quit IRC17:55
*** annegentle has joined #openstack-api17:55
*** annegentle has quit IRC18:08
openstackgerritSteven Kaufer proposed openstack/api-wg: Add oslo.utils note to counting guidelines  https://review.openstack.org/16271618:52
kaufersigmavirus24: Hopefully that is what you had in mind ^18:53
* sigmavirus24 queues it up for reading time18:56
*** e0ne has joined #openstack-api19:38
*** annegentle has joined #openstack-api19:46
openstackgerritSteven Kaufer proposed openstack/api-wg: Add oslo.utils note to counting guidelines  https://review.openstack.org/16271619:53
*** e0ne has quit IRC20:06
*** e0ne has joined #openstack-api20:06
*** cdent has quit IRC20:30
*** sigmavirus24 is now known as sigmavirus24_awa21:41
*** jamie_h has quit IRC21:47
*** kaufer has quit IRC21:51
*** annegentle has quit IRC22:19
*** annegentle has joined #openstack-api22:21
*** openstack has joined #openstack-api22:25
*** annegentle has quit IRC22:26
*** annegentle has joined #openstack-api22:27
*** annegentle has quit IRC23:03
*** e0ne has quit IRC23:13
*** sigmavirus24_awa is now known as sigmavirus2423:20
*** openstack has joined #openstack-api23:24
*** sigmavirus24 is now known as sigmavirus24_awa23:33

Generated by irclog2html.py 2.14.0 by Marius Gedminas - find it at mg.pov.lt!