The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2016-07-04

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:11 jberger I'm watching vm's talk about increasing drive-by contributions
00:11 jberger https://www.youtube.com/watch?v=9jdBz9Mscc0
00:11 jberger and I'm happy to say that we already do a lot of these things
00:16 cuechan_ joined #mojo
00:27 jabberwok joined #mojo
00:48 * kid51 checks out that video as well
00:55 inbioz joined #mojo
00:56 sri jberger: talk says reworking a pull request is a "dick move" :S
00:57 jberger we rarely do that do we?
00:57 sri i do it all the time
00:57 sri does vm actually manage a bigger project?
00:58 jberger she's a PM currently at HP
00:58 sri how does she finance holding the contributors hand through all neccessary changes for every patch?
00:59 sri well, i suppose if you have corporate backing it's different
00:59 sri from my perspective it's totally unrealistic
01:01 jberger she also says that not every project needs to implement every one of these suggestions
01:01 sri "do pair programming, help them through it"
01:01 sri :O
01:01 jberger I think the fact that we usually say "this doesn't meet the guidelines" is sufficient
01:01 sri that's crazy talk ;p
01:01 jberger let me say, I would add one thing to her talk
01:02 jberger drive-by contributors who drive-by with a large PR having never contacted the community are really at their own risk
01:03 jberger yes the contributor's time is valuable, but having never checked in with us about whether it could possibly be acceptable doesn't mean that we have to accept it
01:03 jberger it is unfortunate that they may have wasted their time
01:04 jberger but just the fact that they have invested time doesn't mean we will accept it, because that would certainly be crazy talk
01:05 jberger I do think that in the case of a possibly acceptable contribution that needs work we could simply say "this looks acceptable in concept but needs a lot of work to meet our guidelines/ideals, would you mind if we rewrite the patch?"
01:05 sri guess i mostly agree with the parts that only require a one-time investment, like contributor docs
01:06 jberger and we don't hardly need to write a "contributor SLA", have we ever had an issue open longer than a week?
01:06 jberger (with the exception of long-term planning)
01:06 sri that said, if resources are unlimited, i guess i would put someone on contributor hand-holding duty
01:07 jberger I think that that would be an excellent use of mid-level volunteer time, people who are around here and know how the mojo project works might step up to help with that?
01:07 * jberger nudge nudge
01:08 sri reminds me of the mojo mvp idea from a year or so ago ;p
01:10 sri (core team members focused on community, that just don't get a formal vote on tech decisions)
01:10 jberger I was just reading through that discussion then
01:10 jberger I don't think it even needs to be quite that formal (yet)
01:11 sri or call it junior/senior core team members :)
01:11 jberger I propose the next time such a contribution comes up maybe just ask here for a volunteer to help shepherd in the contribution
01:11 jberger I'm ok with that
01:18 jberger one thing that I think has gotten harder as mojo has gotten more solid is that core contributions used to be a marker of core membership track
01:18 jberger people who made useful contributions to the core got the eye of the existing core
01:18 jberger but those are getting harder and harder to come by because there isn't much change necessary
01:19 jberger so maybe helping with the community level stuff should be seen as another such stepping stone
01:20 jberger I wouldn't mind getting some fresh blood into the core membership ranks, but without some mechanism of distinction it has been rather harder to spot them lately
01:25 sri yea
01:27 vytas joined #mojo
01:55 inbioz joined #mojo
02:06 noganex_ joined #mojo
02:27 kid511 joined #mojo
02:35 kid51 joined #mojo
03:23 inokenty-w joined #mojo
03:25 ivi joined #mojo
04:15 Vitrifur joined #mojo
04:57 inbioz joined #mojo
05:08 iamb joined #mojo
06:23 Vandal joined #mojo
06:30 dod joined #mojo
06:35 dod joined #mojo
07:07 AndrewIsh joined #mojo
07:14 dod joined #mojo
07:21 trone joined #mojo
07:44 Atog joined #mojo
08:00 punter joined #mojo
08:06 osfabibisi joined #mojo
08:42 jkramer left #mojo
08:53 val40 joined #mojo
09:06 irqq joined #mojo
10:03 meshl joined #mojo
10:06 ashimema anyone here done shibboleth with mojolicious (using apache as a proxy?)
10:06 ashimema the environment variables that get set by the native service provider during the apache part don't seem to make it to mojo.
10:06 ashimema perhaps I'm referencing them wrong.. $ENV{name}, is that nto the right syntax?
10:15 nic heh, I was thinking, hmm, that's been mentioned a lot
10:16 nic but the log shows all non-ancient mentions were by someone called...  ashimema :)
10:16 absolut_todd joined #mojo
10:16 ashimema whats been mentioned allot.. shibboleth?
10:16 nic yep
10:16 ashimema lol.. yeah... I may be the only shibboleth guy around here :(
10:16 ashimema though it's a fairyl generic question actually..
10:16 pink_mist ashimema: you could always dumper \%ENV to see what it contains
10:17 ashimema how do I pass environment variables (per request) from apache to mojo
10:17 ashimema pink_mist.. that's exactly what I've just done as my next step..
10:17 ashimema dumping %ENV from inside the mojo app shows they're not present
10:17 pink_mist <ashimema> how do I pass environment variables (per request) from apache to mojo <-- depends how you're using mojo in apache
10:19 ashimema mojo running under hypnotoad as a service.. then apache reverse proxying to it
10:19 ashimema I have a feeling that's the issue.. they're not shareing an environment :( ?
10:20 pink_mist of course they aren't
10:20 pink_mist uhm, how are you even providing the environment to apache?
10:20 ashimema hmm..
10:21 pink_mist you said "per request" ... nothing env is "per request" except under CGI ... but CGI is a horrible idea.
10:22 ashimema so.. in the shibboleth world you have a 'native service provider' component which is basically a service on the server that does most of the authentication peice with back channel communications... you then have an apache module which communicates between apache virtualhosts and the shibboleth native service.. it's that module that sets environment variables.
10:22 ashimema yeah.. I took the model of how to impliment this from csgi thinking about it..
10:22 ashimema that's never gonna work is it :(
10:22 pink_mist no, never
10:22 ashimema hmm.. how on earth am I gonna do this now then :(
10:24 pink_mist by using something other than env vars
10:24 pink_mist I would suggest adding a header to the request or something like that
10:26 * ashimema goes to google how to do that with mod_shibboleth and apache2 ;)
10:26 ashimema should be fun
10:26 ashimema thanks for rubber ducking with me pink_mist.
10:26 ashimema ShibUseEnvironment On|Off
10:26 ashimema Defaults to "On", this turns on the use of environment variables to publish attributes to applications. This is strongly preferred over the header option.
10:27 ashimema lol.. at least this hints to it being possible to use headers instead :)
10:39 cuechan joined #mojo
10:52 vytas joined #mojo
10:57 punter joined #mojo
10:58 tchaves joined #mojo
11:07 kaare joined #mojo
11:12 kid51 joined #mojo
11:24 lluad joined #mojo
12:23 meshl joined #mojo
12:31 kid51 bpmedley: Need an email address at which to send you feedback on Mojo book.  Thanks.
12:31 kid51 thx
12:44 bpmedley Will you try pulling the latest code?
12:44 bpmedley I just pushed a hopeful fix
12:49 CW joined #mojo
12:49 Kripton joined #mojo
12:50 bpmedley How do you like the prose and organization of the book?
12:57 kid51 sent email
12:58 Atog http://www.bookofmojo.com/ :D
12:58 dod joined #mojo
12:58 kid51 I'm getting farther with it than with http://mojolicious.org/perldoc/Mojolicious/Guides/Growing
12:59 bpmedley Also, perhaps we can continue via private msg.. I was in the wrong window..
13:01 Vitrifur joined #mojo
13:02 ramortegui joined #mojo
13:03 neilhwatson joined #mojo
13:18 Kripton joined #mojo
13:19 marty joined #mojo
13:20 marty_ joined #mojo
14:00 Lee https://medium.com/practical-blend/pull-request-first-f6bb667a9b6#.6ydmcpbj6 # one possible solution to the "EMASSIVEDRIVEBYPR" problem (although probably has problems of its own)
14:02 sri Lee: looks very similar to what vm was advocating for
14:03 sri i'm all for holding the contributors hand, but we'd need more volunteers to do it
14:04 sri what he calls "continuous review" vm called "pair programming", basically has the same resource cost
14:06 sri (not that i'm sure actual volunteers can do it)
14:08 sri best case would be a mojolicious using company lending us one of their staff programmers for a few hours per day to handle contributor hand holding
14:08 Lee oh, this was in reference to vm's talk? i didn't scroll back that far
14:12 sri yea, vm was advocating for very high investments in contributors, and i was wondering how she finances it
14:12 Lee yes, i was in that talk
14:13 sri jberger was speculating that she does open source for HP
14:13 sri without corporate backing it just doesn't seem feasible
14:13 Lee she's in the #yapc channel if you want to ask :)
14:19 Lee is anyone from the core team going to be at YAPC::EU?
14:19 Mikey joined #mojo
14:19 Lee because i think this would make an interesting follow up to vm's talk
14:21 sri done
14:28 asarch joined #mojo
14:32 sri hope she sees it
14:33 Lee if not she's @vmbrasseur on twitter
14:34 sri open source is so much easier when you're young and have lots of time to waste ;p
14:34 sri now everything becomes a cost/benefit calculation
14:35 * Lee would offer to help but is spread to thin already :/
14:35 sri aren't we all
14:35 Lee yup
14:42 Mikey joined #mojo
15:00 Mikey joined #mojo
16:29 marty joined #mojo
16:44 marty_ joined #mojo
16:45 dhg joined #mojo
17:12 jberger sri: How did the pm go?
17:26 PryMar56 joined #mojo
17:26 sri jberger: oh, was afk
17:33 nicomen is there a Mojo::DOM->find equivalent for Mojo::JSON::Pointer?
17:35 nicomen I guess it was a stupid question
17:36 Adurah joined #mojo
17:44 sri jberger: just told me she has no time to answer at the moment
17:46 punter joined #mojo
17:48 sri hmm, talking with mst now
17:49 sri i suppose we do have mentoring for contributors here in #mojo for those that bother to join
17:50 jberger That's true
17:51 jberger Maybe we should encourage irc more for patch discussions
17:51 jberger Have a mibbit link at the ready?
17:53 sri yes
17:55 sri not sure where to put it though
18:03 sri maybe something at the bottom of the issue/pull request templates?
18:03 jberger That's a good idea
18:04 jberger We used to have it in the Guide somewhere too but IIRC it increased the noise alot
18:04 sri it's in the contributing guide
18:04 sri we encourage irc there actually
18:04 berov joined #mojo
18:05 sri we don't generally push discussions from github to irc though
18:05 sri maybe we should be doing that too
18:05 jberger I think so, given these discussions the last few days
18:05 sri maybe have an faq answer to link to
18:06 jberger IRC really is our most effective communication channel
18:06 sri so it's easy to invite people here
18:06 jberger +1
18:07 dod joined #mojo
18:07 sri can be a one sentence answer, something friendly and inviting, mentioning the server and channel, with a mibbit link
18:07 sri ideas?
18:08 sri "Where can i discuss my ideas for Mojolicious?"
18:10 jberger "I have a patch I would like to see in Mojolicious, where can I discuss it?"
18:10 jberger But i think you are on the right track
18:11 jberger I don't know if "ideas for" gets the point across that if is fire discussing contributions
18:11 jberger *for
18:12 sri "Where can i discuss my patches?"
18:12 sri straight to the point
18:14 jberger That leaves the question of "patches to what"? Mojo, my own code?
18:14 jberger I guess either interpretation is fine
18:14 Zen "read the docs? come join us on live chat"
18:15 jberger Zen: that's not exactly the point
18:15 jberger We still would like people to read the docs ;p
18:15 sri haha
18:16 Zen ;)
18:20 good_news_everyon joined #mojo
18:20 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vKUtz
18:20 good_news_everyon mojo/master 95d5fd3 Sebastian Riedel: add FAQ answer for patch discussions
18:20 good_news_everyon left #mojo
18:20 sri ok, that's the most basic answer i could think of
18:21 jberger an nice, you clarify the question in the answer
18:21 jberger I like it
18:21 mib_107bsn joined #mojo
18:21 sri http://mojolicious.org/perldoc/Mojolicious/Guides/FAQ#Where-can-i-discuss-my-patches-for-Mojolicious
18:23 mr_trousers joined #mojo
18:24 sri a second sentence about patience might be good too
18:24 sri not sure about that yet though
18:32 good_news_everyon joined #mojo
18:32 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vKUqO
18:32 good_news_everyon mojo/master d780e03 Sebastian Riedel: more IRC links
18:32 good_news_everyon left #mojo
18:38 jabberwok sri: perhaps also, "The #1 source of answers to obscure questions is the IRC Log, search there first."
18:39 good_news_everyon joined #mojo
18:39 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vKUqi
18:39 good_news_everyon mojo/master 5148040 Sebastian Riedel: change the code name
18:39 good_news_everyon left #mojo
18:40 sri ????
18:40 * sri likes that one
18:40 irqq joined #mojo
18:47 dhg joined #mojo
18:51 prajith joined #mojo
18:51 prajith any idea why this code doesn't  work?
18:51 prajith https://gist.github.com/Prajithp/ac6d6ca6a59d4f7ab534ab1b1dd50c18
18:54 jberger prajith: what is on_error?
18:54 prajith nothing
18:54 prajith Can't call method "write" on an undefined value at AMI.pm line 130
18:55 prajith this what i'm getting
18:55 sri if on_error is nothing, why include it?
18:56 jberger prajith: the problem with trying to help you here is that (a) this isn't a complete example (we don't know what $self is or what methods it defines etc) and also we don't know what line 130
18:57 jberger I suppose I meant to throw a (b) in there but I'm still drinking my coffee :-P
18:57 prajith give me a sec, let me post full code
18:59 jberger normally I'd ask for what we call a minimal example (running but slimmed down) but as the filename is AMI.pm and I see to recall someone asking about Asterisk (was it you?) I'm guessing that this is going to be hard to slim down
18:59 prajith https://gist.github.com/Prajithp/43b96a3f5e7ddb9444597c3838afb753
19:00 jberger word of warning from me, I'm on vacation (and its a holiday!) and will likely be heading out to enjoy those both soon
19:00 prajith yes it was me :)
19:00 jberger and you said the error comes from line 130?
19:01 prajith jberger: enjoy your vacation, I am just playing with mojo and perl
19:01 jberger yeah, but I'm still drinking my coffee :-P
19:01 prajith yes removed some debug lines
19:02 jberger first of all, a little thing, normally one simply does "use Mojo::Base -base;"
19:02 jberger and then you have "has" rather than __PACKAGE__->attr
19:03 prajith okay, thank you
19:03 gtodd mojo create my_app  will give me ===>   lib/MyApp.pk  lib/MyApp/Controller but never lib/MyApp/Model  or  lib/MyApp/View ... right?
19:03 gtodd or well there  never was a version that did that
19:03 Grinnz controllers are part of mojo routing, models and views are up to you
19:04 jberger prajith: so if you can't call write then stream isn't returning a stream object for that id
19:06 gtodd Grinnz: ok thanks ... it auto created lib/MyApp/Controller (for me to fill in) ...  I guess on some of my older hackish attempts at things I just did the other stuff myself
19:06 jberger let me guess, your script is like "my $ami = AMI->new; $ami->connect; $ami->login" am I right?
19:06 prajith okay, I think that is because of asterisk management api as I could see login function getting executed before the "connect"
19:06 jberger if so, the problem is that connect really needs to take a callback, you end up calling login before you are connected
19:06 prajith if i comment $self->ioloop->stream($id)->write($login);
19:07 prajith am getting proper banner from the socket
19:07 jberger try passing a callback to connect (sub connect { my ($self, $cb) = @_; ...})
19:08 jberger then at line 95 (after setting up all the $stream handlers, but still inside the anonymous sub) call $self->$cb();
19:09 jberger then make your script "my $ami = AMI->new; $ami->connect(sub{ shift->login })"
19:09 jberger that should fix the timing
19:09 prajith okay let me try that
19:11 jberger to think about the timing, remember that callbacks (in this case the one to consider is the one passed to ioloop->client) mean that that code is going to be called sometime "later"
19:12 jberger so your script is really doing "$ami->connect; $ami->login; $callback_in_connect_later->()"
19:12 jberger currently that is
19:12 jberger which is why the timing is wrong
19:15 prajith okay thanks, I'm really fed up with that Asterisk::AMI
19:15 prajith that's why i'm trying to rewrite it
19:15 jberger a noble cause
19:16 jberger honestly I almost got to that point at $job[-2] but there were more pressing issues there
19:16 dod joined #mojo
19:16 jberger you really are going to want to get comfortable using Mojo::IOLoop::Delay objects too
19:16 jberger they will help you keep your sanity with all these callbacks
19:17 prajith okay, will look into that
19:19 jberger I really need to brush up this talk but here is what I would point you to for writing a large-scale non-blocking library like yours is likely to become: https://www.youtube.com/watch?v=UGufeknRHjQ
19:19 jberger note that the pattern has gotten a little simpler since then
19:20 prajith watching it
19:22 jberger sub my_sub { my ($self, $arg1 ..., $argN, $cb) = @_; Mojo::IOLoop->delay(sub { ... }, sub { ... }, ..., sub { ...; $self->$cb(undef, $result)})->catch(sub{ $self->$cb($_[1], undef })->wait }
19:22 jberger is probably the generic form
19:23 jberger $delay->on(error => sub { ... }) can now be simply set via catch
19:24 jberger and $delay->wait unless $delay->ioloop->is_running is now simply $delay->wait
19:24 jberger because wait got smarter
19:25 prajith okay thanks, will rewrite the connect sub
19:26 prajith also is it possible to pass delay directly to client?
19:26 prajith $self->ioloop->client({}, delay => $delay)
19:27 prajith something like this?
19:27 jberger some people have used the pattern of passing delays around (I can't remember who was doing that, Grinnz maybe?)
19:27 jberger but I'm not a fan of it personally
19:27 jberger delays can call functions which call delays, they nest just fine
19:28 prajith okay
19:28 jberger play with it though, it will help you learn
19:29 prajith <jberger> thank you so much :)
19:29 prajith going to bed now, 1AM here
19:29 jberger no problem, have fun and good luck, it really is a module that could use a rewrite
19:30 prajith yes
19:30 prajith will trouble you again if I stuck somewhere :)
19:30 jberger sure
19:30 jberger a thought
19:30 jberger is this intended for CPAN eventually?
19:30 jberger (I sure hope so)
19:31 jberger if so, put it onto github sooner than later so following the progress is easier than just posting randomly
19:31 jberger and I (and others) will be able to comment on the complete code
19:31 prajith Yes offcourse
19:32 prajith sure will create a github repo tomorrow morning
19:32 jberger cool
19:33 jberger a note to others watching, helping that project would be a nice win for the mojo ecosystem
19:33 gtodd :-D
19:34 jberger there is no true non-blocking Asterisk module on CPAN only that naughty one that uses an ioloop but blocks itself
19:34 marty joined #mojo
19:34 prajith new repo will be created here - https://github.com/Prajithp
19:34 prajith <jberger> will ping you once it is done
19:35 prajith enjoy your vacation <jberger>, have a nice day :)
19:35 jberger you too, sleep well
19:37 * jberger really wants to give that talk again, mostly to force himself to rewrite it
19:37 jberger maybe some Chicago.pm sometime once we get the camera working (cc preaction)
19:40 gtodd hmm it appears that I copied perl modules I was using for models under lib/MyApp/Model/   this seems like a beginners antipattern  if I want an app in one directory I can deploy ... don't I want to just use cpanm and a ./cpanfile  to put all the libs and perl thingies I want to use in ./local or something
19:40 gtodd ( or just right into ./lib itself )
19:41 bpmedley gtodd: I'm confused; are you trying to access a lib dir from an app or script?
19:43 gtodd I'm looking at old apps I made where I seem to have copied or installed perl libraries I was using into ./my_app/lib/MyApp/Models/
19:44 gtodd now years later trying to replicate that in a more conventionally correct way ...
19:44 bpmedley Gaw, MyApp/Models seems like an odd choice.. :)
19:44 gtodd well yes it is :-)
19:47 good_news_everyon joined #mojo
19:47 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vKUsW
19:47 good_news_everyon mojo/master 14fde47 Sebastian Riedel: move FAQ answer
19:47 good_news_everyon left #mojo
19:47 gtodd I'm guessing I thought "you can use anything you want for models" so I did ...  I put them in there to make the app easy to move around from machine to machine without installing those apps.  I want to do it with Carton Carmel cpanm ... so if I have an app that  needs other bits of perl that are unlikely to be installed I just run cpanm in the ./my_app and it puts them somewhere "standard"  ("./local" ?)
19:48 gtodd oops meant "without installing those modules"
19:48 prajith joined #mojo
19:49 jberger gtodd: check out the example here: https://metacpan.org/source/SRI/Mojo-Pg-2.28/examples/blog
19:51 jberger ok time to get going for the day's activities
19:51 jberger o/
19:51 gtodd bpmedley:  it doesn't really matter since I won't really be deploying them and wherever the modules get installed by carton or whatever I'll just add that to the app's @INC and make it work.  Just I thought  I'd try the conventional/standard configuration :)
19:51 gtodd jberger: thanks!
19:51 gtodd have fun
19:51 jberger thanks
19:51 gtodd happy fouith
19:51 gtodd fourth
19:51 gtodd arggh
19:54 bpmedley gtodd: Just so I understand, you want a methodology for installing cpan modules that are required for an app?
19:55 bpmedley Also, you want the placement of the modules to make sense with respect to your app's directory structure?
19:55 gtodd bpmedley: yeah ... well I want a best practice :-)  half the stuff in these old apps is just lazy habit forming stuff I was using .. (boolean.pm  not even related !) ... but he stuff I was using for "Models" is more app related ...
19:56 bpmedley gtodd: I'd first consider -L of cpanm and local::lib.
19:57 gtodd right OK good so use perl conventions ... won't be surprising  ...
19:57 gtodd good
19:57 gtodd cheers
20:04 punter joined #mojo
20:05 Kripton joined #mojo
20:18 itaipu joined #mojo
20:25 punter joined #mojo
20:50 pink_mist joined #mojo
21:45 dhg joined #mojo
23:01 meshl joined #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary