[01:21] Issue operator#256 opened: Upgrading charm does not recreate the hook symlinks [01:33] Issue operator#257 opened: When install hook fails no other hook symlinks are created [05:06] morning all [05:14] o/ [05:16] jam: sent you an email. i should have checked your timezone first before suggesting those times. :) [05:17] hi MarkMaglana, I saw you're email, still working out what times are going to work well. I'd like to have more of the team around, but if its just us we can make that work. [05:18] it'd be good to have more of the team around to get the most feedback. i'll wait for your response then. [07:15] Issue operator#241 closed: _TestingModelBackend incorrectly raises KeyError on missing relation [07:15] PR operator#253 closed: Test harness no backend [07:40] PR operator#196 closed: Factor out the Harness changes for test_model.py [08:03] good moorning all! [08:07] morning Chipaca [08:08] I think https://github.com/canonical/operator/pull/252 follows the doc guidelines that we wanted, and the test suite is passing. [08:08] PR #252: ops/testing.py: document Harness in Google style [08:09] jam: ah, you kicked travis into submission i see [08:09] Chipaca, I merged master and fixed a collision, so it had to try again :) [08:09] yeah [08:09] sometimes it be dumb [08:09] I don't know how to fix it without a push [08:10] Logging into TravisCI seemed like it exposed more than I wanted to travis, so I wasn't sure if I wanted to do that [08:10] (actually travis tries to ping back with all the authenticated users it knows of, but rate limiting is per org or something on the github side … at least that's what i remember from sitting next to travis guys at a snapcraft summit ages ago ) ) [08:11] jam: want me to generate the docs from that so we see what they look like? [08:11] Chipaca, sure. It would be good to see if there are any problems [08:12] ok. if I log into travis, it gives me a 'trigger build' option. [08:14] jam: some of these warnings might be of interest to you: https://pastebin.ubuntu.com/p/xdtSfn4TpR/ [08:16] jam: and the built docs: https://r.chipaca.com/docs/_build/html/123/ops.html#module-ops.testing [08:17] I'll make a branch with the conf.py and the toplevel rst's so you too can build them [08:17] (need to fix a warning about a duff rst first) [08:19] Chipaca, so most of those are in 'charm.py' which I wasn't touching. The one about 'unknown enable_hooks' is interesting. Does it need to be 'self.enable_hooks' ? [08:20] Chipaca, what are you using to generate the docs, so I can iterate? [08:32] jam: wrt how to iterate, i need to push a pr. The minimum you need is a docs/conf.py as the rest can be autogenerated at least until we lay things out better [08:34] wrt gnome shell eating up all my ram, i have a background on rotation, and some of the images are large, and gnome shell seems to not check whether the image fits before loading it [08:34] nor does it scale it down on input like you could ask imagemagick to [08:35] interesting. seems easy to disable to at least get things working until your other machine comes back [08:35] (how large? iirc one of the images there i used to expose a bug in the 64 bit libjpeg for an image that wasn't representable in 32 bits...) [08:35] yeah, once i realised what was going on i did that :) [08:35] hence how i'm back [08:39] image that wasn't representable in 32bits... sounds like a nice test [08:40] Chipaca, you mentioned you use hexchat. I currently have a concern with it, that I'm not sure the fix. [08:40] If someone mentions me in a channel, it highlights that channel in green [08:40] as i remember it, i had to compile my own libs to be able to stitch a pair of nasa photojournal images of earth [08:40] However, it just marks a channel with a conversation as red [08:40] but it does that for private messages as well [08:40] any way to get it to use the same Green for private messages as though I was called out in a public channel? [08:41] jam: where is this colour? in the notifications themselves, or in hexchat? [08:41] Chipaca, the tabs along the left where it lists the channel names [08:42] jam: isn't it 'new message' vs 'highlight' in the interface colours? [08:45] so the issue is that if there is any new message in any channel, it goes red or blue (I haven't quite figured out when it usess which) [08:46] but I want new messages in private chats to be treated like notifications in public chats [08:47] Chipaca, eg, I idle in about 15 different rooms in case someone pings me, and I hear a ping when someone private messages me, but finding that tab is hard, because it is a sea of 'someone said something in this channel' [08:51] jam: i think my hexchat config is out of whack, because i've been fiddling with it for over 10 years (migrated it from xchat) [08:51] :) [08:52] Chipaca, testing your colors out [08:53] jam: and again please (in 10 seconds, also in PM please) [08:54] 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 [08:54] Chipaca ! [08:54] OK [08:55] so, the private message colour is set by settings -> preferences -> colours -> new message [08:55] the public highlight is _not_ 'highlight' in that same thing [08:55] it might be … spellcheck?? [08:55] let me confirm [08:56] jam: again please [08:56] right, but isn't the "settings -> pref -> color -> new message" the same one that shows up for a channel where anyone speaks to anyone else? [08:56] thats the difficulty [08:56] private messages are 'targetted at me' though my name isn't mentioned [08:56] at least, that's how it works in my head :) [08:58] i'd have to wait for somebody to say something in a different channel to answer that [08:58] people are quiet right now [08:58] see private group chat for non targetted message [08:59] jam: that is indeed the same colour :-( [08:59] jam: which means [08:59] jam: you're probably going to have to go into 'text events' [09:00] and change %C28*%C29$3$1%C28*$t%O$2 to something that makes sense to you [09:00] yeah, I'll just learn to love the same colors [09:00] The other plugin I had in the past was one that would hide join/part messages except if the person was active recently [09:01] which is relevant since you occasionally have to restart your machine in the middle of a conversation [09:01] I seem to be able to hide them always, but that isn't quite what I want [09:02] hm, looks like I can set it per window [09:02] so at least large group chats don't have them. that's nice [09:03] jam: FWIW I *think* %CNN is a numbred colour in the above string, but in case it wasn't obvious i haven't dug much :) [09:03] anyway, now i want my old colours back [09:03] * Chipaca gets them [09:04] afaict, hexchat doesn't treat the events the way my brain does. Which is "if you're going to beep at me, color it green so I can find it" :) [09:09] * Chipaca takes notes about how jam's brain works [09:10] danger, danger, daaannn...geeeer [09:13] * Chipaca locks sends the notes to SCP for safekeeping [09:13] s/locks// [09:42] jam: pushed the docs stuff [09:42] PR operator#258 opened: docs: first pass at sphinx-built API docs [09:42] see? :-p [09:46] todo_include_todos [09:46] I should do that [09:47] jam: FWIW that lines up (contrary-wise) to what you and facu said about TODOs *not* being in the docs [09:48] as in, sure have a TODO in the docstring but don't show it in the API docs [09:48] that's the default, which that setting toggles [09:48] and you can then separately use it to generate a todo list [09:49] to be clear: todo_include_todos should be _false_ (the default) so that TODOs don't turn up in the API docs [09:50] also to be clear: the current index.rst sucks because it's just too big, but it's alright to get started imho [09:50] we can then split, sort, tidy, etc [09:50] hard to tidy with nothing [09:50] (or maybe too easy) [09:51] its super lean [09:52] jam: ah, yes sorry i meant the doc it generates [09:52] it's a single page of everything [09:52] I'm just saying nothing is very lean [09:52] ah :) yes [09:52] agile, also [09:52] I haven't had a chance to render it locally yet [09:52] trying to finish a quick commit and then i'll review [09:53] jam: i can also set up rtd to generate it for you, once this is on master [10:00] jam: WRT dispatch not being a symlink to the charm (a feature we want IMHO), I'm afraid we need to drop the "don't look at the env" thing. This is probably fine... as long as we unset JUJU_DISPATCH_PATH [10:00] otherwise loopy fun could happen [10:01] (we try to detect and stop said fun, but ¯\_(ツ)_/¯) [10:01] ah, because if dispatch isn't a symlink, then we don't know who the target of the link is? [10:01] Chipaca, we'll have to be careful to not invoke every event 2x then [10:02] eg, 'install => ../src/charm.py; dispatch: shell that invokes ./src/charm.py' that would default to firing install 2x [10:02] jam: hence dropping the env key [10:02] Chipaca, I think we need dispatch to not just be a symlink because of the "how do you apt install things so that your python code can cleanly import them" [10:02] jam: yep [10:02] Chipaca, even dropping the env var, we still trigger it 2x. [10:02] we just don't trigger it in an infinite loop :) [10:03] (doing it in dispatch also handles the "my pod got rescheduled so I need to do it again" case) [10:03] yep [10:04] jam: so main would need to check for, and ignore, hooks that get triggered via hooks/ when it's also going to be called a-la-dispatch [10:04] this might involve further env tweaks [10:05] * Chipaca needs a whiteboard [10:05] Chipaca, *setting* an env var to indicate we are running might be a better awy [10:05] way [10:06] we trigger but then in main we see "JUJU_DISPATCH_ALREADY_RUNNING_DONT_DO_ANY_MORE" [10:06] and then exit cleanly [10:10] OPERATOR_DISPATCH_IN_PROGRESS_PLEASE_STAND_BY [10:11] PLEASE_ABSTAIN_FROM_COMING_FROM_DISPATCH [10:11] * Chipaca forgets how INTERCAL works [10:15] Chipaca, the compiler language with no pronounceable acronym, abbreviated INTERCAL [10:15] nice [10:17] Chipaca, if the word PLEASE does not appear often enough, the program is rejected as impolite, if too often, it is rejected for excessive politeness [10:17] jam: having to find the right balance between rude and obsequious was part of the fun [10:18] Chipaca, can't you just have an array of PLEASE at the end and then trim/append as necessary ? [10:19] what even is an array [10:22] PR operator#259 opened: Relation created event [10:23] https://github.com/canonical/operator/pull/259 expands on Dmitrii-Sh's work to provide Harness support for relation-created. [10:23] PR #259: Relation created event [10:25] Chipaca, we'll just meet in the charm docs hangout [11:10] * Chipaca afk (lunch) [11:21] Muy buenos días a todos! [11:30] morning facubatista [11:30] Chipaca, when you're back around, I've been trying to play with your documentation branch, and so far I haven't found a way to link to another function in a docstring [11:31] Online I see things like: https://cheat.readthedocs.io/en/latest/rst.html [11:31] that say you should use ":py:meth:`ops.testing.Harness.method`_" [11:31] and doing so doesn't generate an error, but in the generated HTML it just puts the raw string above (which looks bad) [11:31] and the link it generates doesn't seem to go anywhere. [11:32] hola jam [11:33] jam, did you try with a real name? (not "method") [11:34] jam, also note there's no underscore at the end in the docs [11:36] facubatista, yeah, it was real names. It was the underscore that was a problem. [11:36] Which, I'd rather have `enable_hooks`_ work than :py:meth:`ops.testing.Harness.enable_hooks` [11:36] but at least the latter actually creates a link [11:36] actually, you likely want: [11:37] :py:meth:`~ops.testing.Harness.enable_hooks` [11:37] which then at least renders the HTML as 'enable_hooks()' [11:37] thanks for the catch [11:38] np [11:39] I guess they don't use just `enable_hooks` because that name may be in different places [11:40] I don't see what the :meth:/etc are for, maybe they are rendered differently? or there is the possibility of rendering them differently? [11:40] facubatista, so why you need :py:meth: in the first place? [11:41] interesting, :py:meth: also supports :py:meth:`.foo` which is quite a bit better [11:42] but yeah, I'm not sure why you would need to say "I'm refering to the function, not the class" when it should be inferred by what the target is [11:44] jam, the problem is that ops.foo.bar may be ops(pkg).foo(mod).bar(func) or ops(mod).foo(class).bar(meth) [11:45] jam, note that you may have documentation from previous project versions which doesn't really reflect "current reality", so trying to match "real code" is not an option [11:46] mmm... I guess old docs will be together will old code in a release branch... [11:46] I don't know [11:46] yeah. I was thinking that theoretically it could be either, but functionally you are explicitly linking to the one that can be imported. [11:46] Anyway :py: doesn't do what we want [11:47] but :py:meth:`.enable_hooks` does [11:55] facubatista, Chipaca : it seems the docstring of __init__ is just completely ignored. So you have to put the doc string for those arguments on the Class itself. [11:56] also, sphinx doesn't seem to do anything with the Type annotations (AFAICT) [11:59] vs if you use the (charm.CharmBase) [11:59] if you use: [11:59] Args: [11:59] foo (charm.CharmBase): this is a foo [11:59] it will give you a link to charm.CharmBase in the docs [12:00] and it doesn't do it for [12:00] Args: [12:00] foo: charm.CharmBase [12:00] so it is special syntax around () [12:01] hm. oddly it does do Return type: Mapping from type annotations [12:01] and for simple types it does inject (int) from type annotations [12:01] It is just the complex Optional[blah, blah] that it doesn't seem to know what to do with. [12:04] sorry i'm late [12:04] bug revue time! :) [12:04] oh [12:05] jam: hm, maybe i'm missing some tweaks or sth [12:05] to the config i mean [12:05] jam: afterwards, point me at where you see this [12:49] jam, we moved the bug review to tomorrow [12:50] Chipaca, jam, and the charmhub x-team for today was cancelled [12:50] yep [12:50] * facubatista brb [12:50] facubatista: but not the charmhub dev weekly [13:06] Chipaca, you refer to "Weekly Operator Framework Sync"? [13:11] Chipaca, is that the Kafka one ? [13:13] facubatista, jam, no this is charm store (for us, the charmcraft store flow) [13:14] ah gotcha [13:15] Chipaca, it is also possible that the fancy type annotations stuff is off because it is __init__ [13:15] Chipaca, sorry, I don't know which one you refer to as "charmhub dev weekly" [13:15] it seems that Sphinx ignores the docstring of __init__ and only uses the docstring on the class [13:15] jam: i've merged your testing pr in and am poking at it [13:15] facubatista: ¯\_(ツ)_/¯ dunno why you're asking me so much about my calendar :-D [13:15] jam: __init__ is part of it [13:16] jam, that's a good thing IMO, __init__ shouldn't have docstrings (as any special methods) [13:16] jam: it seems ivar also trips it up [13:16] interesting. I had an ivar though I've removed it in the latest harness-hinting [13:16] and moved things to class docstring [13:17] Chipaca, the moment you told me that the charmhub dev weekly was not cancelled, I thought I was involved [13:17] facubatista: you will be at some point! [13:17] facubatista: just not yet [13:18] Chipaca, https://youtu.be/tUoBkhTFdWA?t=6 [13:19] jam: https://youtu.be/RySHDUU2juM?t=6 [13:19] yeah :) [13:20] (actually wanted the seagulls one but, eh) [13:20] https://youtu.be/U9t-slLl30E [13:21] jam: so, dropping the ivar, and setting autoclass_content = 'both' in conf.py, i think DWYW [13:23] jam: if you give that a try, i can add the change to conf.py in my pr if it works [13:24] jam: wrt documenting the ivar, using #: comments might be the way to go [13:24] that particular ivar was irrelevant as it turned into a @property anyway [13:25] jam: and properties have a doc of the getter :) [13:25] yep [13:25] jam: I might look into having a big fat warning message for undocumented things :-D [13:25] * Chipaca is sure somebody's written that already [13:26] Chipaca, doesn't pydocstyle do that? [13:27] jam: i think so yes [13:27] jam: but that doesn't make it easy to spot unless you go look at its output [13:27] whereas having it shout at you in the docs themselves could be the right kinda stick [13:27] jam: i'm only half serious fwiw [13:29] Chipaca, autoclass_content = 'both' seems to do what I was expecting for the class docstring [13:30] it drops the nice name of "OptionalYAML" in favor of Union[str, TextIO, None] which isn't great from a 'communicate to the user' perspective, but at least it renders something > nothing [13:31] Chipaca, jam, standup? [13:33] Chipaca, did we lose you? [15:23] is there a preferred way of keeping/maintaining the podSpec in a charm. should I use a podSpec YAML file that gets loaded and populated based on charm config or should the charm create a podSpec dictionary from scratch based on config options? [15:24] karimsye, most charms that we've seen so far do more of a dict that fills in aspects from config/relation-get etc. [15:25] otherwise you are applying a template in order to load it from yaml, to do essentially the same thing. [15:25] that said, people have said that they'd prefer to render a yaml template and load it to pass it in. likely because the examples they are cribbing from were yaml to start with [15:45] jam: thanks, I like the YAML template file as well [17:49] * Chipaca EODs [22:06] * facubatista vanishes away