19:01:12 #startmeeting ansible core public irc meeting 19:01:12 Meeting started Tue Jun 30 19:01:12 2020 UTC. 19:01:12 This meeting is logged and archived in a public location. 19:01:12 The chair is bcoca. Information about MeetBot at http://wiki.debian.org/MeetBot. 19:01:12 Useful Commands: #action #agreed #halp #info #idea #link #topic. 19:01:12 The meeting name has been set to 'ansible_core_public_irc_meeting' 19:02:08 #info agenda https://github.com/ansible/community/issues/541 19:03:50 Almost time for a new issue 19:04:08 #topic https://github.com/ansible/ansible/pull/70060/ 19:04:10 only one day away :) 19:04:35 not sure what this fixes, the yaml anchors are all already resolved at this point, we are only dealing with python dicts 19:04:36 this PR fixes a problem with the ansible-doc man page formatter 19:04:53 the problem is that the formatter changes entries in these dicts 19:05:00 like remove `description` 19:05:02 also makes adding new handling of fields require accounting in the new special var 19:05:10 so if the next option is processed sharing the same dict, `description` is gone and it errors out 19:05:16 felixfontein: its on purpose to allow the 'general handler' to deal with 'what is left' 19:05:55 bcoca: if you want to keep the code as close as possible to today, here's another PR: https://github.com/ansible/ansible/pull/70045 19:06:10 it simply creates copies before starting to modify things 19:06:51 ^ thought we already got a copy .. we used to from plugin docs .. so something changed there at one point and we were getting a 'linked struct' instead of an unrolled copy 19:07:04 no, we don't 19:07:08 i prefer going back to this, but see if using 'deepish' might be better option 19:07:16 otherwise tadeboro wouldn't have had problems with YAML anchors :) 19:07:35 you mean deep copy? 19:07:38 we didnt have issues originally, one of things i had manually tested (but ... didnt add test ...) 19:07:46 no, deepish ... its a thing, trust me 19:08:27 the issue would also happen without suboption handling in case someone would be using YAML anchor for top-level options (not that someone should do that, but...) 19:09:01 by recursively processing suboptions (and return values) this problem got easier to trigger 19:09:14 module_response_deepcopy < aka, 'deepish' 19:09:17 https://github.com/ansible/ansible/pull/44337 19:10:00 regular deepcopy won't help here anyway since it reserves YAML references 19:10:22 module_response_deepcopy would work fine here 19:10:50 in any case, i do lean more for the 2nd option vs the PR that is title of this topic 19:11:11 i want LESS hardcoded lists in code .. not more ... 19:11:27 and the data structure reduction is a 'cleanish' 19:11:36 way to whittle down from known/handled to 'rest' 19:11:40 in that case, a copy needs to be made somewhere 19:11:55 shertel: thanks for the PR link btw! 19:12:25 yeah, dont know when that changed, but anchors used to work and that would have required a copy (though its been years since i wrote a module with anchors in docs ...) 19:12:30 #70045 does the minimal amount of copying; though this isn't very time critical, so module_response_deepcopy would also work if you prefer that 19:13:31 bcoca: for HTML docs anchors work fine, and for man docs suboptions were not modified, and anchors for toplevel options are not useful since they would end up with the same description - probably that's why it worked in the past 19:13:33 actually, add_fields should not be main 'popper' its the main loop on top level entries 19:13:44 * bcoca needs to reread the full code path 19:14:38 inside add_fields there really should not be any 'rest' .. the pop is mainly for main loop to allow users to add their own major sections and still get displayed (LABEL: whatevs) 19:14:52 aka how metadata is still displayed in 2.10 w/o specific code to handle it 19:15:15 also in previous versions .. but that was cause of bug that skipped metadata handling ... 19:16:19 so. what do you propose? 19:16:25 (for the PR?) 19:16:33 idk .. more coffee? 19:16:50 we do have catchall in add_fields .. but not sure we realy need/want it there43 19:17:03 allow users to add optional doc fields to plugins ? 19:17:14 * shertel isn't familiar enough with the code, would need to review 19:17:36 bcoca: ok, but that doesn't really matter for this PR, right? 19:17:41 i know someone/somwhere will have a use .. but this is very niche .. the top level 'user deffined docs' is already nieche, this is squaring that 19:18:12 makes a much simpler PR possible, just change to .get and remove 'rest handler' 19:18:53 remove 550-564 19:19:06 right now `elements` isn't handled, and neither is `example` or `sample` for return values 19:19:15 these need to be added then 19:20:13 cause now its not just documentation.options, but returndocs. that is added to add_fields call 19:20:47 yes. but not in this PR 19:20:48 * bcoca really needs to cleanup a lot of taht code 19:21:04 this PR is only a bugfix for making modules/plugins using YAML anchors in suboptions work again 19:21:42 * bcoca moves to xlst processing 19:23:31 is there a reason not to merge this PR? 19:24:19 what i stated above, not a good implementation, prefer the other fix 19:24:43 bcoca: I mean #70045 now 19:24:53 (I got that you don't want another hardcoded constant list :) ) 19:25:51 it would be nice if this bug gets fixed for 2.10 in some way. afterwards you can refactor the code as much as you want :) 19:27:04 Looks good to me 19:30:20 no one else on this topic? 19:30:49 I'm in favor of #70045. 19:32:49 k, think we can move on then 19:33:03 #topic https://github.com/ansible/ansible/pull/70026 19:33:10 ok. what will happen to the 70045 next? 19:33:20 I'm merging it 19:33:22 felixfontein: someone will review and merge 19:33:24 shertel: thanks! 19:33:28 need to close the other one 19:33:39 don't close the other yet, it has a test that can still be merged 19:33:54 +1 19:34:02 then add tests to yours .. already closed 19:34:30 I'll try to copy it over after the meeting 19:34:40 Yeah, that's a good test. 19:34:49 Would be nice to add it to #70045. 19:34:49 about 70026: this adds the ability to the collection loader to know which collection a plugin comes from 19:35:06 it can also distinguish between ansible.builtin, and plugins/modules from library/ etc. 19:35:22 this is used to print the correct FQCN for a module in ansible-doc's man page formatter 19:35:23 ^ iirc there is much easier way to do this, we already have collection in ansible-doc 19:35:37 bcoca: I don't think we do 19:35:38 felixfontein: also, not man page, that is diff program 19:36:13 the function is called `DocCLI.get_man_text`, that's why I call it man page formatting 19:36:17 felixfontein: yes, we do, just need to look at redirect from plugin 19:36:56 felixfontein: function name is also incorrect, it does 'try' to look like man page a bit, but really far from following the standards/format 19:37:29 for me looking close enough is fine :) 19:37:51 ;-p 19:39:08 do you mean result.redirect_list with "redirect from plugin"? 19:39:09 im working on update that fixes 'deep' reading of collecitons, you always get collection name with it, no need to go through all this work when iter_modules gives you the correct name 19:39:18 well, yes, that should ALSO have the name 19:39:24 but was going for pkg_name 19:39:42 which pkg_name? 19:39:43 right now we are incorrectly reading symlinks as 'main file' when they are supposed to be aliases 19:40:06 the one the collection loader creates when it loads the collection resource aka pythnon package aka pkg_name 19:41:23 also avoids mutating some of the basic functions in loader to now return tuple 19:41:56 when I run `ansible-doc file` I get redirect_list == ['file']; looks exactly the same for a local plugin from a playbook 19:42:33 cause file should be the built in or library/, it wont use collection 19:42:33 so how do I distinguish between ansible.builtin and plugin outside of collection and ansible.builtin? 19:42:57 soo ... builtin outside of collection? 19:43:43 I thought that for builtin modules/plugins, it should show `ansible.builtin.xxx` 19:44:00 no, lets keep it naked, show colleciton for collections 19:44:03 that would be the FQCN for a builtin plugin 19:44:05 I thought we would keep the output the same for builtin 19:44:20 ok, in that case it's pretty trivial to implement this 19:44:30 yeah, .. now i get why your PR is like that, no ,... want to keep current plugins displaying as is, only fqcn for collectino content 19:44:47 felixfontein: that is what i was saying ... just didnt realize you wanted that ... which we really dont want 19:45:06 I was somehow assuming that this was what we wanted... I guess I must have misremembered 19:45:09 thought you were trying to fix the c.general case about the symlinks 19:45:17 (this was a couple of weeks ago... so now I remember even less) 19:45:20 which currently displays wrong name 19:45:27 though 'usable' ... 19:45:39 also that ansible-doc currently ignores routing.yml ... which is part of my fix also 19:45:48 no, it still shows community.general.docker_container 19:46:06 even though technically it would be community.general.cloud.docker.docker_container 19:46:11 #topic https://github.com/ansible/ansible/issues/70134#issuecomment-650223767 19:46:16 felixfontein: yes, that is part of what im fixing 19:46:32 cause right now its a hack of my doing an ls ~coll/plugins/modules/ 19:46:39 and it needs to use colleciton loader 19:46:46 that is the 'iter_modules' function 19:47:00 which is also incomplete (TODO: read runtime.yml)( 19:47:03 what would be the correct value then for docker_container? community.general.docker_container or community.general.cloud.docker.docker_container? 19:47:28 lthe 2nd, with the first appearing in 'ALIASES: ' field, just like symlinks do now with 'builtin' 19:47:54 btw, I hacked together a tool which can convert between symlinks and runtime.yml entries (and do some more validation): https://github.com/ansible-collections/community.internal_test_tools/blob/main/tools/meta_runtime.py 19:48:08 hmm. that sounds horrible. 19:48:22 do we really want to show this long name to people? 19:48:37 ok, I guess this is off-topic 19:48:40 not my choice 19:48:50 but people keep insisting on doing things certain ways ... 19:49:01 flatmapping to the rescue :) 19:49:12 well, we both support and do not support flatmapping 19:49:19 about https://github.com/ansible/ansible/issues/70134#issuecomment-650223767: it looks like the module_utils part of ansible_builtin_runtime.yml is screwed 19:49:23 depending on whom/how you ask 19:49:46 Oh, yeah https://github.com/ansible/ansible/blob/devel/lib/ansible/config/ansible_builtin_runtime.yml#L7572-L7573 19:49:50 :-/ 19:50:10 apparently during the migration it was assumed flatmapping is used for module_utils 19:50:11 felixfontein: afaik nitzmahone is taking care of that 19:50:17 ok 19:50:26 well, during migration we were told flatmapping was a thing 19:50:39 its only changed 23423423 times after the migration ... 19:50:50 it never was going to work for module_utils 19:51:09 since things like `common` are used in multiple directories of stable-2.9's module_utils 19:51:58 imho, just need to update file to have full names 19:52:02 Yeah, I've got a couple of bugfixes in-flight for that and the "better failure when a redirected module_util can't be found", as well as fixing the 2.9 module_utils __init__ stuff 19:52:36 nitzmahone: how do you repair the ansible_builtin_runtime.yml module_utils part? I hope not manually :) 19:53:34 Oh at this point it probably will be 19:53:49 it CAN be scripted .. 19:53:52 By the time I write a custom tool to backfill it, I'd be done 19:54:02 pre-ansible-base had 542 files that weren't called __init__.py 19:54:35 but maybe the information from BOTMETA.yml can help 19:54:43 The hardest part will be figuring out where they all went, and what to do about the partner/community split ones that probably got duplicated in many cases 19:54:47 perhaps 19:55:13 true 19:55:15 good luck with it! 19:55:24 felixfontein: botmeta is woefully out of date 19:55:50 it was 'abandoned' since days after it's update, bot stopped using it in favor of traversing galaxy to find matching files 19:55:50 bcoca: I think most PRs updating ansible_builtin_runtime.yml also updated BOTMETA. or at least the ones I saw 19:56:00 oh ok 19:56:07 felixfontein: and mnay didnt cause we told people to stop updating botmeta 19:56:13 maybe it should be deleted then? 19:56:15 only those we told before the change, did 19:56:16 The fix for the one you're talking about (supporting dotted source names for module_utils) is already working- the only part that's not is the empty-package synthesis for the collections redirected cases 19:56:37 nitzmahone: and iter_modules doesnt read runtime.yml 19:57:02 though it really only needs to do so to get aliases, but that requires a reversal of current strcuture 19:57:22 bcoca: I think I've still got a branch laying around somewhere where it does, but yeah, I'm not sure we want it to in most cases, and doing it conditionally is ... well, no ;) 19:57:23 and also how to deal with symlinks correctly 19:57:33 btw, in case you need test material, community.general 0.2.0 uses symlinks, while 0.3.0-experimental.meta.redirects uses meta/runtime.yml for redirects 19:57:47 nitzmahone: we need to to present 'correct info' in docs 19:57:53 (which are nonfunctional on 2.9, I assume) 19:58:10 no, symlninks work in 2.9, runtime.yml doesnt 19:58:23 they also work in 2.10 .. they just look like 'main' not 'alias' in collections 19:58:35 that's why 1.0.0 will probably keep symlinks, the 0.3.0 prerelease is only for testing how well meta/runtime.yml redirects work 20:00:28 yeah, it'll be interesting to see how many people want to keep using stuff in 2.9, and what kinds of practical problems that will present us (I know of a few already, but I'm sure there are others) 20:00:52 For 2.10, probably not a big deal, but the more things drift, the more "interesting" that will likely become 20:01:08 indeed 20:01:14 nitzmahone considering that all other products are staying on 2.9 .... 20:01:37 bcoca: exactly 20:01:47 which products do you mean? 20:02:00 * bcoca wishes he had gone forward with betting pool, would be raking it in right now 20:02:27 felixfontein: anything 'officially supported' is standarizing on 2.9 20:03:03 for how long? until ansible-base 2.10 is there, or much longer? 20:03:34 k, at this point i think we can continue that chat elsewhere, we are far from meeting topics and over time at this point 20:03:37 #endmeeting