/srv/irclogs.ubuntu.com/2020/04/23/#smooth-operator.txt

mup_PR operator#238 opened: ops/model.py: Unit.set_workload_version <Created by jameinel> <https://github.com/canonical/operator/pull/238>04:09
mup_Issue operator#211 closed: Test harness: a unit receives events about updates to its own unit data bag <bug> <Created by dshcherb> <Closed by jameinel> <https://github.com/canonical/operator/issues/211>04:29
jammorning all04:46
mup_Issue operator#239 opened: Action writing requires image dependencies <Created by natalytvinova> <https://github.com/canonical/operator/issues/239>07:03
niemeyerMorning jam07:50
niemeyerHello all07:50
jammorning07:50
Chipacamoin moin09:07
niemeyerHey Chipaca09:16
jamniemeyer, #196 still needs your ack, I believe both Chipaca and facubatista are happy with it10:38
mup_PR #196: Factor out the Harness changes for test_model.py <Created by jameinel> <https://github.com/canonical/operator/pull/196>10:38
jamChipaca, #236 is a small PR that hopefully isn't controversial, I needed to do *some* coding today. :)10:38
mup_PR #236: ops/log.py: Default to DEBUG logging <Created by jameinel> <Merged by jameinel> <https://github.com/canonical/operator/pull/236>10:38
jamwell, helps if I use the right PR: #23810:39
mup_PR #238: ops/model.py: Unit.set_workload_version <Created by jameinel> <https://github.com/canonical/operator/pull/238>10:39
Chipacajam: huh, you can set something, but you can't get it?10:46
Chipacathat's super weird10:46
jamChipaca, agreed, though it has been that way for about 5 years now, and it hasn't actually been raised as a bug by someone writing a charm10:46
jamChipaca, as a way to tell the admin what is being run, the source of the value in that field is reading something else on the host machine, you might want to read it to see if it changed, but then again, you're just going to set it to the new value.10:57
jamwhich is as expensive as reading it10:57
facubatistaMuy buenos días a todos!11:14
jammorning facubatista11:14
facubatistahola jam :)11:15
Chipacafacubatista: moin moin11:22
facubatistahola Chipaca11:23
facubatistaChipaca, I was wondering (and reading a little) if we can use GitHub Actions to store the latest commit (partial) hash in a file to be used as a reference in the version string, for "nightlies" or if people runs the project directly from repo11:28
Chipacafacubatista: what i've seen people do is have a distinctive "you're running this from an unreleased thing" version11:29
facubatistaknowing which specific version is a plus11:30
jamfacubatista, its pretty impossible to get the hash of the thing and commit it, because committing changes the hash..11:32
jamit is usually a 'build' step (in a Makefile :) that generates the version.py from 'git describe --dirty'11:33
facubatistathere's a [push] event that will trigger actions; the problem is that if we commit current hash on pushes, and then we rebase on merge to master, that previous commit (which is stored) is lost in the sense that we will not find it in the logs11:35
facubatistaif we wouldn't rebase, that could be useful11:35
jamfacubatista, you'll always be saying someone is using the version just-before the one they are actually using.11:36
facubatistajam, the only difference between the version they claim and the version they really using would be the version file change, though11:37
jamfacubatista, if you turn every commit into 2 commits, I guess.11:37
facubatistabut yes, the proper way to do this would be with support of git itself11:37
facubatistalike "when commiting, after creating the hash, before saving everything, please dump that hash to this file"11:38
facubatistajam, reviewing your branch... you created set_workload_version which gets `version` and passes that directly to `self._backend.application_version_set`, which passes that directly to self._run, which passes that directly to subprocess.run11:52
facubatistajam, so if I do set_workload_version(5) it will explode super ugly11:52
facubatistamaybe _run should str() the *args?11:52
facubatista(this is beyond your branch, of course, unless we decide "_run must always receive strings", so this would be something to change in your branch)11:53
jamfacubatista, so the version should be a string, I don't know that silently auto casting the value to a string behind their back is the right way to do it11:55
jamI was actually going to put in a RuntimeError checking for it, but didn't feel it was significantly better than a TypeError11:55
jam(there is a test that TypeError is raised for non str)11:56
jamif you prefer a different error, I'm happy to do so11:56
Chipacajam: maybe the docstring should talk about the type :)11:57
facubatistaI'm ok with the TypeError, I'm even ok with the message itself, I'm scared about the traceback11:57
facubatista  File "/usr/lib/python3.6/subprocess.py", line 1295, in _execute_child11:57
facubatista    restore_signals, start_new_session, preexec_fn)11:57
facubatistaTypeError: expected str, bytes or os.PathLike object, not int11:57
Chipacajam: also, just noticed, "[...] show in the output of 'juju status'"  should probably be 'shown'11:58
facubatistadid we consider as a group about type hinting the exposed-to-the-developer interfaces?11:59
jamfacubatista, Chipaca said that he had investigated some of the alternatives for how we do docstrings, etc. Part of that was whether we wanted to do type hints12:00
jamas it changes how we do docstrings if we're using type hints.12:00
Chipacayep12:00
Chipacai myself quite like them12:00
Chipacabut we're still to have that discussion12:01
ChipacaI'll add something in the calendar right now12:01
jamfacubatista, does that mean we need top level error catching in the framework for nicer rendering?12:01
facubatistajam, maybe, it's a our-pain/user-friendliness balance12:01
facubatista(however, we *may* get that for free, after some automatic checking or something, if we have type hints in the "borders")12:03
jamChipaca, changed from ", show" to "; shown" which I think is more correct.12:03
jamfacubatista, the flip side is figuring out *who* is passing in an int, and that's hard to tell without the traceback12:03
facubatistajam, in my mind, the best user experience we can get here is that if you call set_workload_version with not a string, we should fail with something like TypeError("The workload version must be a string")12:04
facubatistajam, from that POV, what do you mean "who is passing an int"?12:04
jamfacubatista, I'm happy to put that check into the method12:05
Chipacafacubatista, jam, it could do try/except TypeError as e: raise TypeError("The workload version...") from e12:05
facubatistajam, this is more a generic question than a specific request -- are we as a group considering this extra work for user friendliness? etc12:05
Chipacafacubatista: I don't think user friendliness should be thought of as 'extra work' :)12:06
facubatistaChipaca, well, we should check the rest of the public methods, then12:06
jamfacubatista, Chipaca : updated the PR with a check. is it better to catch TypeError, or just do isinstance() ?12:09
jamfacubatista, I do think giving users helpful guidance about how to use the interfaces is very much something we should do12:09
facubatistayeap, me too, that's why I brought the subject here12:10
Chipacajam: I lean slightly towards the "try and catch" over the "check beforehand" camp, but not strongly12:10
Chipacajam: but, maybe, in this case, checking is more what we need -- what happens if you try to set the version to "--help" ?12:11
jamChipaca, 'juju status' says '--help'12:11
jamits the way you get SOS out12:11
jamyou hack your charms to say "--help --meeeeeee"12:12
Chipacajam: application-version-set won't try to print its help?12:12
jamChipaca, interesting question. I'm not sure. but likely you could be correct12:13
* Chipaca releases software with a version of --help all the time12:13
Chipaca:-p12:13
jamChipaca, I came across an interesting thing, where various websites like Banks have a secret link that lets you get domestic abuse help12:14
jamwithout "leaving the site"12:14
Chipacainteresting12:14
facubatista# application-version-set --help12:15
facubatistaUsage: application-version-set <new-version>12:15
facubatista...12:15
Chipacafacubatista: and 'application-version-set -- --help' ?12:15
facubatistaChipaca, worked12:16
facubatistaApp             Version  Status       Scale  Charm           Store       Rev  OS      Notes12:16
facubatistamy-super-charm  --help   unknown          1  my-super-charm  local        18  ubuntu12:16
Chipacasounds like that's what we want to do12:17
Chipacaalso, that's one for a "spread" suite (^ niemeyer)12:17
Chipacaas in, if we care about this (and i do), we'd want to have a test to make sure things don't break down the road (if juju changes options parser for ex)12:18
Chipacalunch!12:20
* Chipaca ⇝ lunch12:20
jamChipaca, so I'm happy to put in '--', but I'd caution around testing every possible interaction between many different components.12:20
facubatistamaybe a change to include after we have the integration testing in place12:56
jamChipaca, they fixed the 'tiled' layout13:05
jamIt now does show everyone in little windows13:05
jam(at least in a group of 7, I see 6 windows)13:05
facubatistajam, wee13:07
jamand it was the default layout when joining13:07
Chipacajam: i think they were rolling it out, because yesterday in the mgmt call some people had it and some didn't13:16
Chipacasadly for me, i didn't :)13:16
Chipacahere's hoping!13:16
Chipacajam: firefox?13:16
Chipacahah, github just threw a 500 trying to show that pr13:21
Chipacaat least it's a cute 50013:21
jamChipaca, yeah, ff13:21
Chipacaooh, it's all 500 all the way down13:22
jamChipaca, are you sure it isn't you ?13:24
Chipacajam: https://github.com/canonical/operator/pulls is 500ing, for ex13:25
jamyour machine is now triggering 500 in *remote* machines13:25
Chipaca… and now it's back13:25
jamChipaca, wfm13:25
jam:)13:25
Chipacajam: I MUST NOT ABUSE THIS POWER13:25
Chipacajam: given other people's grumbling elsewhere about this, it's not just me though13:27
Chipacamaybe it's all argentine-born people, because that's the one thing in common afaict13:27
jamChipaca, yeah, other people in Juju were saying github is slow13:27
* Chipaca hangs out in strange places13:28
niemeyerI'm taking a break to go out into the sun for a while..15:10
mthaddonhi folks, what's the right way to ask for review for a charm we've written? - not urgent in any way, would just like to get feedback from charmcraft team about what we've done and what could be done better15:26
Chipacamthaddon: <315:27
Chipacamthaddon: not sure, can i get back to you on that?15:27
mthaddonyep, no problem15:27
Chipacamthaddon: is this charm public?15:27
mthaddonit is, yep15:27
Chipacathinking of something code-review-ish15:28
Chipacaanyhoo, need to raise it with the team15:28
mthaddonhttps://jaas.ai/u/wordpress-charmers/wordpress and https://code.launchpad.net/charm-k8s-wordpress for the code15:28
=== jldev_ is now known as jldev
* Chipaca afk for a while16:34
* facubatista bb ~1h17:47
* facubatista is back18:51
* facubatista eods19:54
=== mup__ is now known as mup_
niemeyerHave a good evening, Facundo19:55
facubatistaniemeyer, thanks! see you tomorrow19:55
niemeyero/19:55

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