/srv/irclogs.ubuntu.com/2020/05/06/#smooth-operator.txt

mup_Issue operator#256 opened: Upgrading charm does not recreate the hook symlinks <Created by xavpaice> <https://github.com/canonical/operator/issues/256>01:21
mup_Issue operator#257 opened: When install hook fails no other hook symlinks are created <Created by woutervb> <https://github.com/canonical/operator/issues/257>01:33
jammorning all05:06
MarkMaglanao/05:14
MarkMaglanajam: sent you an email. i should have checked your timezone first before suggesting those times. :)05:16
jamhi 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:17
MarkMaglanait'd be good to have more of the team around to get the most feedback. i'll wait for your response then.05:18
mup_Issue operator#241 closed: _TestingModelBackend incorrectly raises KeyError on missing relation <Created by gnuoy> <Closed by jameinel> <https://github.com/canonical/operator/issues/241>07:15
mup_PR operator#253 closed: Test harness no backend <Created by jameinel> <Merged by jameinel> <https://github.com/canonical/operator/pull/253>07:15
mup_PR operator#196 closed: Factor out the Harness changes for test_model.py <Created by jameinel> <Closed by jameinel> <https://github.com/canonical/operator/pull/196>07:40
Chipacagood moorning all!08:03
jammorning Chipaca08:07
jamI think https://github.com/canonical/operator/pull/252 follows the doc guidelines that we wanted, and the test suite is passing.08:08
mup_PR #252: ops/testing.py: document Harness in Google style <Created by jameinel> <https://github.com/canonical/operator/pull/252>08:08
Chipacajam: ah, you kicked travis into submission i see08:09
jamChipaca, I merged master and fixed a collision, so it had to try again :)08:09
Chipacayeah08:09
Chipacasometimes it be dumb08:09
jamI don't know how to fix it without a push08:09
jamLogging into TravisCI seemed like it exposed more than I wanted to travis, so I wasn't sure if I wanted to do that08:10
Chipaca(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:10
Chipacajam: want me to generate the docs from that so we see what they look like?08:11
jamChipaca, sure. It would be good to see if there are any problems08:11
jamok. if I log into travis, it gives me a 'trigger build' option.08:12
Chipacajam: some of these warnings might be of interest to you: https://pastebin.ubuntu.com/p/xdtSfn4TpR/08:14
Chipacajam: and the built docs: https://r.chipaca.com/docs/_build/html/123/ops.html#module-ops.testing08:16
ChipacaI'll make a branch with the conf.py and the toplevel rst's so you too can build them08:17
Chipaca(need to fix a warning about a duff rst first)08:17
jamChipaca, 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:19
jamChipaca, what are you using to generate the docs, so I can iterate?08:20
Chipacajam: 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 better08:32
Chipacawrt 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 it08:34
Chipacanor does it scale it down on input like you could ask imagemagick to08:34
jaminteresting. seems easy to disable to at least get things working until your other machine comes back08:35
Chipaca(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
Chipacayeah, once i realised what was going on i did that :)08:35
Chipacahence how i'm back08:35
jamimage that wasn't representable in 32bits... sounds like a nice test08:39
jamChipaca, you mentioned you use hexchat. I currently have a concern with it, that I'm not sure the fix.08:40
jamIf someone mentions me in a channel, it highlights that channel in green08:40
Chipacaas i remember it, i had to compile my own libs to be able to stitch a pair of nasa photojournal images of earth08:40
jamHowever, it just marks a channel with a conversation as red08:40
jambut it does that for private messages as well08:40
jamany way to get it to use the same Green for private messages as though I was called out in a public channel?08:40
Chipacajam: where is this colour? in the notifications themselves, or in hexchat?08:41
jamChipaca, the tabs along the left where it lists the channel names08:41
Chipacajam: isn't it 'new message' vs 'highlight' in the interface colours?08:42
jamso 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:45
jambut I want new messages in private chats to be treated like notifications in public chats08:46
jamChipaca, 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:47
Chipacajam: 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
jam:)08:51
jamChipaca, testing your colors out08:52
Chipacajam: and again please (in 10 seconds, also in PM please)08:53
jam10, 9, 8, 7, 6, 5, 4, 3, 2, 108:54
jamChipaca !08:54
ChipacaOK08:54
Chipacaso, the private message colour is set by settings -> preferences -> colours -> new message08:55
Chipacathe public highlight is _not_ 'highlight' in that same thing08:55
Chipacait might be … spellcheck??08:55
Chipacalet me confirm08:55
Chipacajam: again please08:56
jamright, 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
jamthats the difficulty08:56
jamprivate messages are 'targetted at me' though my name isn't mentioned08:56
jamat least, that's how it works in my head :)08:56
Chipacai'd have to wait for somebody to say something in a different channel to answer that08:58
Chipacapeople are quiet right now08:58
jamsee private group chat for non targetted message08:58
Chipacajam: that is indeed the same colour :-(08:59
Chipacajam: which means08:59
Chipacajam: you're probably going to have to go into 'text events'08:59
Chipacaand change %C28*%C29$3$1%C28*$t%O$2 to something that makes sense to you09:00
jamyeah, I'll just learn to love the same colors09:00
jamThe other plugin I had in the past was one that would hide join/part messages except if the person was active recently09:00
jamwhich is relevant since you occasionally have to restart your machine in the middle of a conversation09:01
jamI seem to be able to hide them always, but that isn't quite what I want09:01
jamhm, looks like I can set it per window09:02
jamso at least large group chats don't have them. that's nice09:02
Chipacajam: 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
Chipacaanyway, now i want my old colours back09:03
* Chipaca gets them09:03
jamafaict, 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:04
* Chipaca takes notes about how jam's brain works09:09
jamdanger, danger, daaannn...geeeer09:10
* Chipaca locks sends the notes to SCP for safekeeping09:13
Chipacas/locks//09:13
Chipacajam: pushed the docs stuff09:42
mup_PR operator#258 opened: docs: first pass at sphinx-built API docs <Created by chipaca> <https://github.com/canonical/operator/pull/258>09:42
Chipacasee? :-p09:42
jamtodo_include_todos09:46
jamI should do that09:46
Chipacajam: FWIW that lines up (contrary-wise) to what you and facu said about TODOs *not* being in the docs09:47
Chipacaas in, sure have a TODO in the docstring but don't show it in the API docs09:48
Chipacathat's the default, which that setting toggles09:48
Chipacaand you can then separately use it to generate a todo list09:48
Chipacato be clear: todo_include_todos should be _false_ (the default) so that TODOs don't turn up in the API docs09:49
Chipacaalso to be clear: the current index.rst sucks because it's just too big, but it's alright to get started imho09:50
Chipacawe can then split, sort, tidy, etc09:50
Chipacahard to tidy with nothing09:50
Chipaca(or maybe too easy)09:50
jamits super lean09:51
Chipacajam: ah, yes sorry i meant the doc it generates09:52
Chipacait's a single page of everything09:52
jamI'm just saying nothing is very lean09:52
Chipacaah :) yes09:52
Chipacaagile, also09:52
jamI haven't had a chance to render it locally yet09:52
jamtrying to finish a quick commit and then i'll review09:52
Chipacajam: i can also set up rtd to generate it for you, once this is on master09:53
Chipacajam: 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_PATH10:00
Chipacaotherwise loopy fun could happen10:00
Chipaca(we try to detect and stop said fun, but ¯\_(ツ)_/¯)10:01
jamah, because if dispatch isn't a symlink, then we don't know who the target of the link is?10:01
jamChipaca, we'll have to be careful to not invoke every event 2x then10:01
jameg, 'install => ../src/charm.py; dispatch: shell that invokes ./src/charm.py' that would default to firing install 2x10:02
Chipacajam: hence dropping the env key10:02
jamChipaca, 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
Chipacajam: yep10:02
jamChipaca, even dropping the env var, we still trigger it 2x.10:02
jamwe just don't trigger it in an infinite loop :)10:02
jam(doing it in dispatch also handles the "my pod got rescheduled so I need to do it again" case)10:03
Chipacayep10:03
Chipacajam: 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-dispatch10:04
Chipacathis might involve further env tweaks10:04
* Chipaca needs a whiteboard10:05
jamChipaca, *setting* an env var to indicate we are running might be a better awy10:05
jamway10:05
jamwe trigger but then in main we see "JUJU_DISPATCH_ALREADY_RUNNING_DONT_DO_ANY_MORE"10:06
jamand then exit cleanly10:06
ChipacaOPERATOR_DISPATCH_IN_PROGRESS_PLEASE_STAND_BY10:10
ChipacaPLEASE_ABSTAIN_FROM_COMING_FROM_DISPATCH10:11
* Chipaca forgets how INTERCAL works10:11
jamChipaca, the compiler language with no pronounceable acronym, abbreviated INTERCAL10:15
jamnice10:15
jamChipaca, if the word PLEASE does not appear often enough, the program is rejected as impolite, if too often, it is rejected for excessive politeness10:17
Chipacajam: having to find the right balance between rude and obsequious was part of the fun10:17
jamChipaca, can't you just have an array of PLEASE at the end and then trim/append as necessary ?10:18
Chipacawhat even is an array10:19
mup_PR operator#259 opened: Relation created event <Created by jameinel> <https://github.com/canonical/operator/pull/259>10:22
jamhttps://github.com/canonical/operator/pull/259 expands on Dmitrii-Sh's work to provide Harness support for relation-created.10:23
mup_PR #259: Relation created event <Created by jameinel> <https://github.com/canonical/operator/pull/259>10:23
jamChipaca, we'll just meet in the charm docs hangout10:25
* Chipaca afk (lunch)11:10
facubatistaMuy buenos días a todos!11:21
jammorning facubatista11:30
jamChipaca, 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 docstring11:30
jamOnline I see things like: https://cheat.readthedocs.io/en/latest/rst.html11:31
jamthat say you should use ":py:meth:`ops.testing.Harness.method`_"11:31
jamand doing so doesn't generate an error, but in the generated HTML it just puts the raw string above (which looks bad)11:31
jamand the link it generates doesn't seem to go anywhere.11:31
facubatistahola jam11:32
facubatistajam, did you try with a real name? (not "method")11:33
facubatistajam, also note there's no underscore at the end in the docs11:34
jamfacubatista, yeah, it was real names. It was the underscore that was a problem.11:36
jamWhich, I'd rather have `enable_hooks`_ work than :py:meth:`ops.testing.Harness.enable_hooks`11:36
jambut at least the latter actually creates a link11:36
jamactually, you likely want:11:36
jam:py:meth:`~ops.testing.Harness.enable_hooks`11:37
jamwhich then at least renders the HTML as 'enable_hooks()'11:37
jamthanks for the catch11:37
facubatistanp11:38
facubatistaI guess they don't use just `enable_hooks` because that name may be in different places11:39
facubatistaI 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
jamfacubatista, so why you need :py:meth: in the first place?11:40
jaminteresting, :py:meth: also supports :py:meth:`.foo` which is quite a bit better11:41
jambut 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 is11:42
facubatistajam, the problem is that ops.foo.bar may be ops(pkg).foo(mod).bar(func) or ops(mod).foo(class).bar(meth)11:44
facubatistajam, 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 option11:45
facubatistammm... I guess old docs will be together will old code in a release branch...11:46
facubatistaI don't know11:46
jamyeah. I was thinking that theoretically it could be either, but functionally you are explicitly linking to the one that can be imported.11:46
jamAnyway :py: doesn't do what we want11:46
jambut :py:meth:`.enable_hooks` does11:47
jamfacubatista, 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:55
jamalso, sphinx doesn't seem to do anything with the Type annotations (AFAICT)11:56
jamvs if you use the (charm.CharmBase)11:59
jamif you use:11:59
jamArgs:11:59
jam  foo (charm.CharmBase): this is a foo11:59
jamit will give you a link to charm.CharmBase in the docs11:59
jamand it doesn't do it for12:00
jamArgs:12:00
jam  foo: charm.CharmBase12:00
jamso it is special syntax around ()12:00
jamhm. oddly it does do Return type: Mapping from type annotations12:01
jamand for simple types it does inject (int) from type annotations12:01
jamIt is just the complex Optional[blah, blah] that it doesn't seem to know what to do with.12:01
Chipacasorry i'm late12:04
Chipacabug revue time! :)12:04
facubatistaoh12:04
Chipacajam: hm, maybe i'm missing some tweaks or sth12:05
Chipacato the config i mean12:05
Chipacajam: afterwards, point me at where you see this12:05
facubatistajam, we moved the bug review to tomorrow12:49
facubatistaChipaca, jam, and the charmhub x-team for today was cancelled12:50
Chipacayep12:50
* facubatista brb12:50
Chipacafacubatista: but not the charmhub dev weekly12:50
facubatistaChipaca, you refer to "Weekly Operator Framework Sync"?13:06
jamChipaca, is that the Kafka one ?13:11
Chipacafacubatista, jam, no this is charm store (for us, the charmcraft store flow)13:13
jamah gotcha13:14
jamChipaca, it is also possible that the fancy type annotations stuff is off because it is __init__13:15
facubatistaChipaca, sorry, I don't know which one you refer to as "charmhub dev weekly"13:15
jamit seems that Sphinx ignores the docstring of __init__ and only uses the docstring on the class13:15
Chipacajam: i've merged your testing pr in and am poking at it13:15
Chipacafacubatista: ¯\_(ツ)_/¯ dunno why you're asking me so much about my calendar :-D13:15
Chipacajam: __init__ is part of it13:15
facubatistajam, that's a good thing IMO, __init__ shouldn't have docstrings (as any special methods)13:16
Chipacajam: it seems ivar also trips it up13:16
jaminteresting. I had an ivar though I've removed it in the latest harness-hinting13:16
jamand moved things to class docstring13:16
facubatistaChipaca, the moment you told me that the charmhub dev weekly was not cancelled, I thought I was involved13:17
Chipacafacubatista: you will be at some point!13:17
Chipacafacubatista: just not yet13:17
jamChipaca, https://youtu.be/tUoBkhTFdWA?t=613:18
Chipacajam: https://youtu.be/RySHDUU2juM?t=613:19
jamyeah :)13:19
Chipaca(actually wanted the seagulls one but, eh)13:20
jamhttps://youtu.be/U9t-slLl30E13:20
Chipacajam: so, dropping the ivar, and setting autoclass_content = 'both' in conf.py, i think DWYW13:21
Chipacajam: if you give that a try, i can add the change to conf.py in my pr if it works13:23
Chipacajam: wrt documenting the ivar, using #: comments might be the way to go13:24
jamthat particular ivar was irrelevant as it turned into a @property anyway13:24
Chipacajam: and properties have a doc of the getter :)13:25
jamyep13:25
Chipacajam: I might look into having a big fat warning message for undocumented things :-D13:25
* Chipaca is sure somebody's written that already13:25
jamChipaca, doesn't pydocstyle do that?13:26
Chipacajam: i think so yes13:27
Chipacajam: but that doesn't make it easy to spot unless you go look at its output13:27
Chipacawhereas having it shout at you in the docs themselves could be the right kinda stick13:27
Chipacajam: i'm only half serious fwiw13:27
jamChipaca, autoclass_content = 'both' seems to do what I was expecting for the class docstring13:29
jamit 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 > nothing13:30
facubatistaChipaca, jam, standup?13:31
jamChipaca, did we lose you?13:33
karimsyeis 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:23
jamkarimsye, most charms that we've seen so far do more of a dict that fills in aspects from config/relation-get etc.15:24
jamotherwise you are applying a template in order to load it from yaml, to do essentially the same thing.15:25
jamthat 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 with15:25
karimsyejam: thanks, I like the YAML template file as well15:45
* Chipaca EODs17:49
* facubatista vanishes away22:06

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