15:02:43 #startmeeting core public irc meeting 15:02:43 Meeting started Thu Jun 4 15:02:43 2020 UTC. 15:02:43 This meeting is logged and archived in a public location. 15:02:43 The chair is bcoca. Information about MeetBot at http://wiki.debian.org/MeetBot. 15:02:43 Useful Commands: #action #agreed #halp #info #idea #link #topic. 15:02:43 The meeting name has been set to 'core_public_irc_meeting' 15:03:05 #topic https://github.com/ansible/ansible/pull/69313 15:03:53 mattclay still needs to look at it 15:04:05 * resmo o/ 15:04:11 i was going to say .. didnt we already punt this from core irc meeting? 15:04:20 yes, twice I think :) 15:04:29 I guess someone has to check it 15:04:41 Oops... I didn't cross it off 15:04:44 i have, wasnt running the prev ones 15:04:48 #topic https://github.com/ansible/ansible/pull/69796 15:04:55 shertel: no problem, this way we're not forgetting about it ;) 15:05:31 forget about what? 15:05:41 that it's still alive 15:05:45 what is? 15:05:55 for the PR in topic, https://github.com/ansible/ansible/pull/69454 needs to get merged first 15:06:09 but we can still talk about the question whether return docs YAML parsing should result in an error, or in a warning 15:06:19 bcoca: the antsibull-changelog PR 15:07:04 i dont remember 15:07:35 so , for 'other fields' we can ignore, but documentation and returndocs are required to be yaml 15:07:59 should both follow same path (made note in pr) 15:08:15 also, version striping, should not happen on ansible-doc side, we probably want it sooner 15:08:24 right now, returndocs isn't parsed 15:08:27 ansibvle-doc should just handle 'formatting' in a light way 15:08:40 it is , just in the wrong place 15:08:48 well, x2 15:09:01 it is never a failure though, it's always treated like "try to parse, if fails, keep as string" 15:09:03 its parsed as string in doc reading lib, then as string or yaml on ansible-doc 15:09:34 yep, and that was 'right in 2.2' when i was making the standard up .. currently and for a looong time we have required yaml, so fine with making that change 15:09:57 ok. I'm also fine, but I guess this needs to be officially decided 15:10:02 fine even if empty, but if supplied it should be yaml AND the structure we defined 15:10:31 also remove metadata from our tests 15:10:42 (your PR removes metadata) 15:10:53 and you add it in this one to test 15:12:14 I added it in this PR because in the version of devel this branch is based on, there still is metadata 15:12:18 I will remove it on rebase 15:12:23 roger 15:12:23 once your PR is merged 15:12:28 * bcoca goes merge 15:14:28 didnt add comment, but still think we shoujld not do the version tagging in doc/cli.py .. but pretty sure you did that since you were leaving 'non yaml ' returndocs as warning when parsed 15:15:36 doc/cli does untagging so that the current collection name isn't mentioned in versions and dates 15:20:30 anything else, anyone else? 15:21:29 #topic https://github.com/ansible/ansible/pull/64474 15:21:39 is a decision needed to fail on bad return docs (i.e. non-YAML), or can I just change it? 15:23:17 o/ 15:23:37 (I'm happy with just writing `bcoca said so` as a reference.) 15:23:41 felixfontein: i gave my opnion .. no one else seems to agree/disagree 15:23:55 felixfontein: fine with me, but that is not guarantee of acceptance of the PR 15:24:04 I still sort of prefer the warning, but I don't really care 15:24:05 shertel: sdoran: any opinion? 15:24:20 (or anyone else?) 15:24:22 * sdoran thinking 15:26:46 ^ we can revisit later, new topic 15:27:17 i gave 5 mins for thoughts before, will give some more again if we finish this topic and open floor 15:27:19 Yeah, I'm not able to offer a strong opinion on that. 15:27:32 Moving on. 15:27:59 * bcoca needs to write filter/tests docs parser 15:29:04 For the `regexp_findall` PR, I find the example to be curious since it seems it would be much simpler to use the `getent` module for parsing `passwd` entries. 15:29:58 I can get a better example 15:31:54 how about calling the option not `groupdict` but `groups_as_dict` or `as_dict`? or even `group_dict`? 15:32:22 groupings .. that it comes in a dict is less material to the name of the option 15:32:29 just that you return them 15:32:49 though to be consisten with most regex functions .. should it be a list? 15:33:00 sure. I just reused the python option name 15:33:31 I was wondering about how changing a flag changes the output. 15:33:45 Not sure that's a good idea. Should probably return a consistent type. 15:34:13 it will definitely make writing docs for this challenging 15:34:33 sdoran: here's a real-world use https://github.com/jamescassell/ansible-role-nss-module/blob/6fd23ea8fbfd57ebac3640cb91f7614b2e9a505f/vars/main.yml#L4-L7 15:35:35 actually, findall already returns a list of groups .. -1 to this as it mutates return type and overlaps with data already returned 15:35:38 basically parsing useful details from the output of a command into a list of dicts for the findall case, or just a dict in the search case 15:35:59 if you want new 'regex_nice_dicts' filter, that is fine, but leaning to not altering existing this way 15:36:07 how about doing this as a new filter? 15:36:13 jinx 15:36:16 yes 15:37:02 sometimes there is good reason to have mutated returns .. i dont see this as one of those cases 15:37:07 bcoca: how would you handle it? -- the regex_search already returns either a string or a list, based on the options requested, IIUC 15:37:18 bcoca: would you be happier if it was always a list of dicts? 15:37:34 and you change the type from under existing filter users? 15:38:01 bcoca: the type is only different if the "groupdict" option is selected; otherwise, the behavior is not changed 15:38:40 you just said 'always' 15:38:59 but still stands, i think this merrits new filter and not modifying existing 15:39:02 I see. in the groupdict case, wrapit in a list 15:39:13 i know current implementation only does it on 'true' 15:39:33 but you already get group lists from findall (if im reading python docs right) 15:40:19 yes, findall gives a list regardless 15:41:05 but it will be list of dicts instead of list of lists? 15:41:27 right, `regex_findall` with `groupdict` will return a list of dicts 15:41:51 even tempted to say .. create a filter that you use on the output of this filter 15:42:35 not sure how that would be possible 15:42:51 |group2dicts ? 15:43:14 right now, the names of the groups are lost 15:43:19 I think that would be a lot worse than a new filter 15:43:21 yes 15:46:57 ah, didnt realize names were lost .. still, new filter 15:48:01 right now, regex_search returns a string unless you ask for groups, in which case it returns a list 15:48:08 list of strings 15:48:22 is a list of dicts so far different that it needs a new filter? 15:48:30 and if so, what names? 15:48:49 and generally, when is an option to an existing filter vs a new filter 15:49:00 It should probably always return a list. 15:49:16 That it sometimes returns a string I would consider a bug. 15:50:56 It's hard to say, but wanting to return a different data type is one case where a new filter should be used rather than using a toggle that changes the returned data type. 15:51:31 sdoran: it does `return re.findall()` so that goes to the source .. and has been that way for the life of the fitler 15:51:45 so i would have 'fixed that' in original creation, but not at this point 15:51:51 Agreed. 15:52:13 name for the new ones? 15:52:15 just cause it 'does it wrong' does not mean we push down the sam epath more 15:52:57 idk, i would have to sit down and look at a collection of regex functions and probalby create nicer and more consistenet ones .. but 'time' ... 15:53:05 just _groupdict? 15:54:17 what about passing dict2items? 15:54:33 going to punt on bikeshed about names, leaving that for future meeting 15:54:34 then it's a list again. would that work? 15:54:59 no, i think we mostly agree, new filter 15:55:01 s/work/be acceptable/ 15:55:04 leave current one as is 15:55:18 it would be a list, but not 'same list' 15:55:27 you would be inserting new data that is not like existing data 15:55:52 its still pushign adict ... just listified .. which is almost worse 15:56:51 ok, wil adjust copy paste with _groupdict suffix 15:57:27 i woudlnt as you would not have string/list mutated return also 15:57:33 s/not/now/ 15:57:49 it'll always return just the groupdict verison 15:57:58 or raise an error if it can't? 15:58:38 no talking about the findall inconsistency 15:58:52 but i'll wait for implementaiton before i comment further 15:58:57 #topic open floor 15:59:08 it'll be 2 filters. one returns dict, other list of dict 16:01:14 #endmeeting