18:58:50 <mizmo> #startmeeting hubs-devel 18:58:50 <zodbot> Meeting started Thu Jan 26 18:58:50 2017 UTC. The chair is mizmo. Information about MeetBot at http://wiki.debian.org/MeetBot. 18:58:50 <zodbot> Useful Commands: #action #agreed #halp #info #idea #link #topic. 18:58:50 <zodbot> The meeting name has been set to 'hubs-devel' 18:58:59 <mizmo> #topic html/css templating in hubs 18:59:09 <mizmo> okay lemme dig up the ticket so you see what were trying to do 19:00:19 <mizmo> okay so this is the ticket we're going to work on today: 19:00:20 <mizmo> https://pagure.io/fedora-hubs/issue/17 19:00:21 <mizmo> The mockup we wanna make things look like is this: 19:00:33 <mizmo> https://pagure.io/fedora-hubs/issue/raw/files/d26642740eadf474f0d21b0b7c8c8023dd53b987375931836473379010edf137-team-badges.png 19:00:53 <mizmo> now there's two main badges widgets 19:00:54 <mizmo> this one is the team one 19:01:05 <mizmo> it shows badges affiliated with that team, your personal prgoess WRT that team's badges, and a little bit of a leaderboard kind of thing 19:01:14 <shillman_> Ah, cool. 19:01:33 <mizmo> the other badges widget, which is done, is similar, but it's for you, it's one user's badges across the whole system / all teams / etc 19:01:44 <mizmo> worth looking at though because its so similar and you can see how the templates look 19:01:53 <shillman_> Where is it? 19:01:57 <mizmo> now hubs is built using python 19:02:03 <mizmo> the platform we're using is called flask 19:02:20 <mizmo> it's sort of comparable to something like django or php or whatnot 19:02:20 <mizmo> flask uses a template system called jinja for templates 19:02:26 <mizmo> so these templates are written using jinja 19:02:27 <mizmo> okay 19:02:39 <mizmo> gimme a sec and i'll pull up the widget that's done that we can use as a model for doing this new one 19:02:42 <shillman_> k 19:02:47 <mizmo> https://pagure.io/fedora-hubs/issue/85 19:02:59 <mizmo> looks like this: https://pagure.io/fedora-hubs/issue/raw/files/e06f48752e60a1b3bb067173c3d315540064757a41bc5b1420b1a64f24e2304a-profile_badges-widget.png 19:03:54 * mizmo looking for the PR 19:04:22 <shillman_> (PR?) 19:05:41 <mizmo> ugh why is this so hard 19:05:42 <mizmo> pull request 19:05:45 <shillman_> Aaah 19:06:02 <mizmo> basically, it's a way to submit code before committing it to get feedback on it and a sign off 19:06:09 <shillman_> Aaaaaah 19:06:13 <shillman_> Coolness. 19:06:27 <mizmo> i think we did this one a little diff bc it was a fork 19:06:28 <mizmo> a fork of a fork 19:06:48 <shillman_> Fork the forks... 19:07:12 <mizmo> ah here we go 19:07:13 <mizmo> https://pagure.io/fork/duffy/fedora-hubs/c/286a1d933a337417baa0325d9de3305e68c33a6c?branch=badges-user-profile 19:07:36 <mizmo> so it's basically just some html + css 19:07:50 <mizmo> with some variables in the mix for the data in jinja's format (although this one i think i did static without variables) 19:07:52 <shillman_> Ok... how do I get that in a form I can adjust it? For the team one? 19:08:18 <mizmo> thats in diff format, so this is the full thing: 19:08:23 <mizmo> https://pagure.io/fork/duffy/fedora-hubs/blob/286a1d933a337417baa0325d9de3305e68c33a6c/f/hubs/widgets/templates/badges.html 19:08:47 <mizmo> this html is going to get injected into other html, so it's important to understand the relationship there 19:09:06 <mizmo> all widget templates are in the hubs/widgets/templates directory of the git repo 19:09:27 <shillman_> And that HTML is created from the css and other stuff? 19:09:37 <shillman_> Or are those values hard-coded for now? 19:09:47 <mizmo> no the HTML and CSS are separate. you have to write the CSS separately as well 19:10:01 <mizmo> right now we have one big CSS file and i just comment it a lot. we'll have to clean it up at some point in the future when we integrate fedora bootstrap 19:10:09 <shillman_> Aaah, ok 19:10:27 <mizmo> so this template is 100% fake data so there's no jinja variables in it 19:10:34 <shillman_> (then yes, I suspect the values are hard coded for now) 19:10:35 <shillman_> *nod* 19:10:44 <mizmo> that's a good way to start, just use the strings from the mockup, make it look how you want and get it html pretty solid, then figure out how to do the variables 19:10:57 <mizmo> im trying to dig up the files to show you how this html gets pulled in and injected elsewhere, sec 19:11:02 <shillman_> k 19:12:55 <mizmo> shillman_: okay here it is 19:12:56 <mizmo> https://pagure.io/fork/duffy/fedora-hubs/blob/286a1d933a337417baa0325d9de3305e68c33a6c/f/hubs/templates/hubs.html#_181 19:13:12 <mizmo> {% for widget in hub.right_widgets %} 19:13:13 <mizmo> <div id="widget-{{ widget.idx }}" class="widget row"></div> 19:13:15 <mizmo> {% endfor %} 19:13:16 <mizmo> the widget gets injected into that div 19:13:41 <shillman_> Aah, interesting. Ok. 19:13:45 <mizmo> so keep in mind, that's where the html template we create gets put, so it's really a fragment for a larger file 19:13:59 <shillman_> Yes. 19:14:00 <mizmo> the way this system (and many other similar systems work) is it breaks the page up into fragments 19:14:44 <mizmo> header, footer, widget, nav, etc. etc. etc and when the page gets generated, it pulls the data to fill in any variables and injects all the fragments together into one page 19:14:59 <shillman_> *nod* 19:15:00 <mizmo> let me know if this is too basic or too confusing 19:15:03 <shillman_> This is fine. :) 19:15:06 <shillman_> I sort of know it? 19:15:13 <shillman_> But again, most of my HTML experience is old. 19:15:33 <shillman_> Besides, it'll be good to be able to reference this log. 19:15:46 <mizmo> okay so in flask, iirc, the way hubs is set up, each widget has a .py file (written in python/flask) and a corresponding template (html) + css (pulled from the main CSS file 19:16:51 <mizmo> let's find the .py file for this group hub badges widget 19:18:07 <mizmo> we have this, but i suspect it's for the user badges widget and not the gruop hub badges widget: https://pagure.io/fedora-hubs/blob/develop/f/hubs/widgets/badges.py 19:18:08 <shillman_> In the website, or the code on my machine? 19:18:31 <shillman_> How are you searching? 19:18:46 <mizmo> im just looking at the repo thru the website right now 19:19:02 <shillman_> Is this not it? https://pagure.io/fork/duffy/fedora-hubs/blob/286a1d933a337417baa0325d9de3305e68c33a6c/f/hubs/widgets/badges.py 19:19:08 <mizmo> so im looking at the latest code in the 'develop' branch (main development branch) of the fedora-hubs repo 19:19:21 <mizmo> (no i think badges.py is for user badges, not group/team badges) 19:19:24 <shillman_> Ah 19:19:37 <mizmo> it may be that the one we need is in a branch sayan created and not in the main develop branch 19:19:47 <mizmo> so im going to look to see if its in another branch. sec. 19:19:50 <shillman_> ok 19:20:05 <mizmo> (often when making new features devs will create a branch just for that feature so it doesn't mess up the main site if it breaks) 19:20:13 <shillman_> Makes sense 19:21:03 <mizmo> okay i fond it 19:21:07 <mizmo> it's called badgespath.py 19:21:22 <mizmo> it's in a fork sayan created under the branch badge-path-support 19:21:22 <mizmo> https://pagure.io/fork/sayanchowdhury/fedora-hubs/blob/badge-path-support/f/hubs/widgets 19:21:31 <mizmo> er 19:21:33 <mizmo> https://pagure.io/fork/sayanchowdhury/fedora-hubs/blob/badge-path-support/f/hubs/widgets/badgespath.py 19:21:38 <mizmo> okay so that's our python file 19:21:44 <shillman_> path support? Not user-profile! Ok,then 19:21:48 <mizmo> we need to make the html template 19:21:51 <mizmo> to do that, let's get your git repo synched up 19:22:39 <shillman_> Git... pull? 19:22:42 <mizmo> (yeh path support is for group hubs. user-profile is for the user hub widget that i already made with the static strings. that's ticket 85, we're working on ticket 17) 19:22:54 <mizmo> well 19:22:54 <mizmo> sec 19:23:16 * mizmo is not the most adept at git, this may turn traumatic 19:23:28 <shillman_> Heh. Me, either. :) 19:23:38 <shillman_> https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf is my friend, so far 19:24:41 <shillman_> How do you know which ticket forks go to? 19:24:49 <shillman_> Or do you just know from experience? 19:24:52 <mizmo> okay so you have to add sayan's repo to yours 19:25:01 <mizmo> mapping the ticket to fork - you basically ahve to talk to the person 19:25:04 <mizmo> the pagure ui doesn't directly map them 19:25:04 <shillman_> Ok. 19:25:07 <shillman_> Rude. 19:25:15 <shillman_> So how do I get his repo? 19:25:17 <mizmo> #action talk to pingou about mapping mapping forks / branches to tickets :) 19:25:30 <shillman_> :) 19:25:39 <jcline> mizmo, shillman_, I don't want to interrupt, but FYI I just went through figuring out widgets and wrote some documentation in https://pagure.io/fedora-hubs/pull-request/302. Since I have almost no idea what I'm talking about, when you have time feedback about things that are not in-depth enough or confusing and/or notes about things I totally missed are more than welcome. 19:25:42 <mizmo> ok so if you go into your copy of the repo, in the top directory "fedora-hubs" 19:25:45 <mizmo> there's a hidden subdir, ".git" 19:25:58 <mizmo> jcline: awesome thank you! we'll take a look! 19:26:17 <mizmo> #action give jcline feedback on https://pagure.io/fedora-hubs/pull-request/302 19:26:17 <shillman_> k, I 19:26:17 <jcline> (Also if you need git help I can do my best to assist) 19:26:22 <shillman_> 'm in there. 19:26:28 <mizmo> shillman_: so in the .git subdir, there's a file config, open that one up 19:26:41 <mizmo> jcline: yes! we're trying to get sayan's badge-path-support branch hooked up on shillman's computer 19:26:48 <mizmo> shillman_: okay add this to the bottom of the file 19:26:53 <mizmo> [branch "badge-path-support"] 19:26:53 <mizmo> remote = sayan 19:26:54 <mizmo> merge = refs/heads/badge-path-support 19:27:16 <mizmo> oh and above those three lines 19:27:17 <mizmo> url = ssh://git@pagure.io/forks/sayanchowdhury/fedora-hubs.git 19:27:17 <jcline> shillman_, I think you need to do 'git remote add -f ssh://git@pagure.io/forks/sayanchowdhury/fedora-hubs.git' 19:27:19 <mizmo> fetch = +refs/heads/*:refs/remotes/sayan/* 19:27:21 <mizmo> wait 19:27:36 <mizmo> [remote "sayan"] 19:27:37 <mizmo> url = ssh://git@pagure.io/forks/sayanchowdhury/fedora-hubs.git 19:27:37 <mizmo> fetch = +refs/heads/*:refs/remotes/sayan/* 19:27:41 <mizmo> lemme fpaste it 19:27:48 <shillman_> *stares* :) 19:27:57 <mizmo> jcline: the thing i dont know how to do is to set this up so she can push to her own fork 19:28:02 <sayan> mizmo: shillman_ can do what jcline told 19:28:04 <jcline> Then you need to do 'git checkout badge-path-support' and it should check out sayan's branch 19:28:31 <mizmo> https://paste.fedoraproject.org/537199/ 19:28:37 <jcline> Then if you want to push to your own fork you do 'git push -u origin badge-path-support' 19:28:43 <sayan> mizmo: that would add those to lines to .git/config 19:28:51 <mizmo> sayan: okay cool 19:28:54 <jcline> Assuming origin is the remote name (check with 'git remote -v') 19:29:00 <mizmo> shillman_: ^^ do what they said of course lol it will make more sense 19:29:14 <shillman_> ok, so the git remote thing, checkout, and push to my own fork. Gotcha. 19:29:41 <mizmo> so origin in mine is config to ssh://git@pagure.io/fedora-hubs.git 19:29:47 <mizmo> i have my fork set up as mizmo 19:29:59 <mizmo> mizmo ssh://git@pagure.io/forks/duffy/fedora-hubs.git ( 19:30:00 <mizmo> does she have to set up her fork like that? and she'd do 19:30:05 <mizmo> git push -u shillman badge-path-supprot ? 19:30:12 <jcline> Yup! 19:30:34 <mizmo> okay how does she set her fork up? 19:30:37 <mizmo> the webui? 19:30:55 <shillman_> jcline, it keeps complaining about something about the syntax, but tells me nothing useful about it for the remote add command... 19:31:12 <jcline> If she doesn't have a fork of the project yet, yes 19:31:13 <shillman_> just keeps repeating the help 19:31:13 <mizmo> shillman_: copy pasta? 19:31:27 <shillman_> usage: git remote add [<options>] <name> <url> 19:31:27 <shillman_> -f, --fetch fetch the remote branches 19:31:27 <shillman_> --tags import all tags and associated objects when fetching 19:31:27 <shillman_> or do not fetch any tag at all (--no-tags) 19:31:27 <shillman_> -t, --track <branch> branch(es) to track 19:31:27 <shillman_> -m, --master <branch> 19:31:29 <shillman_> master branch 19:31:31 <shillman_> --mirror[=<push|fetch>] 19:31:33 <shillman_> set up remote as a mirror to push to or fetch from 19:31:34 <mizmo> shillman_: paste the full load from before you hit enter 19:31:42 <mizmo> paste the command you wrote 19:31:51 <jcline> Oh no, I mistyped the command. that's what I get for not trying it first 19:32:01 <shillman_> :) 19:32:11 <jcline> It should be 'git remote add -f sayan ssh://git@pagure.io/forks/sayanchowdhury/fedora-hubs.git' 19:32:27 <jcline> I forgot to name it. I do that *all* the time. 19:32:31 <shillman_> Aaaaaah! 19:32:41 <shillman_> Permission denied... 19:32:44 <mizmo> git has that affect on people 19:32:51 <shillman_> Permission denied (publickey). 19:32:51 <shillman_> fatal: Could not read from remote repository. 19:32:51 <shillman_> Please make sure you have the correct access rights 19:32:51 <shillman_> and the repository exists. 19:32:51 <shillman_> error: Could not fetch sayan 19:33:01 * mizmo is very snarky about git, sorry 19:33:06 <mizmo> huh that shouldn't be a perms issue right? its your machine you're just reading not writing 19:33:15 <shillman_> *hasn't found a version control issue that's not annoying to use* 19:33:20 <shillman_> system 19:33:35 <mizmo> i like svn a lot, but i never had to manage branching / merging / etc 19:33:41 <sayan> shillman_: git remove -v? 19:33:47 <mizmo> so let's troubleshoot this 19:33:54 <sayan> shillman_: fpaste it 19:33:59 <mizmo> you're on the project, you should have perms 19:33:59 <mizmo> not sure if your ssh key is configured? 19:34:41 <shillman_> sayan: https://paste.fedoraproject.org/537200/45927314/ 19:35:37 <jcline> Yeah, it sounds like your ssh key isn't configured on one end or the other 19:36:02 <shillman_> Where do I check that? I could have sworn we did ssh key things for github.. 19:36:04 <sayan> shillman_: as mizmo said do you have ssh key in pagure? 19:36:26 <shillman_> Heh. 19:36:28 <mizmo> shillman_: https://pagure.io/settings 19:36:29 <mizmo> shillman_: it doesn't copy your ssh from FAS to pagure automagically i think. that might be the issue. 19:36:30 <shillman_> Sigh. No. Fixing. 19:37:14 * mizmo plays cheesy hold music 19:39:13 <shillman_> Do I just remove that from config and try again? It complains about it already existing otherwise. 19:39:50 <shillman_> the git remote add -f command, I mean 19:40:11 <fm-hubs> pagure.pull-request.new -- jcline opened pull-request#304: "Add a license to the git repository" on project "fedora-hubs" https://pagure.io/fedora-hubs/pull-request/304 19:40:31 <mizmo> shillman_: yeh remove it from the config 19:40:36 <mizmo> you have the ssh key in the web ui now? 19:41:02 <shillman_> Yeah 19:41:08 <shillman_> So, It says I have the new branch. 19:41:53 <shillman_> Do I need to add a fork on the website before calling push -u etc? 19:42:20 <fm-hubs> pagure.pull-request.comment.added -- jcline commented on pull-request#269 of project "fedora-hubs" https://pagure.io/fedora-hubs/pull-request/269#comment-17301 19:42:48 <mizmo> shillman_: yep 19:42:49 <jcline> shillman_, correct. You'll need to hit the fork button and then add it as a remote like you did for sayan's 19:42:51 <fm-hubs> pagure.project.forked -- wispfox forked project "fedora-hubs" to "fork/wispfox/fedora-hubs" https://pagure.io/fork/wispfox/fedora-hubs 19:43:05 <mizmo> so go to the fedora-hubs main page on pagure and click the fork button in the open right 19:43:20 <shillman_> fork button done. 19:44:28 <mizmo> shillman ok next - 19:44:38 <mizmo> git remote add -f wispfox ssh://git@pagure.io/forks/wispfox/fedora-hubs.git 19:44:39 <mizmo> ^^ 19:45:09 <shillman_> And I think I just added it. 19:45:11 <shillman_> Yeah, like that. :) 19:45:51 <shillman_> Does this mean that I currently only have my fork locally? 19:45:55 <mizmo> okay great 19:46:04 <shillman_> If so, how would I get the updated rest of the things if I wanted to? 19:46:19 <mizmo> no when you fork it gets made on the website. you just pulled it from the website down to your local machine 19:46:24 <mizmo> now if you make a change on your machine you have to push it to your fork so other ppl can see it 19:46:28 <mizmo> (does that make sense?) 19:46:46 <shillman_> Yes, but that's not the question I had. 19:46:50 <fm-hubs> pagure.pull-request.comment.added -- jcline commented on pull-request#269 of project "fedora-hubs" https://pagure.io/fedora-hubs/pull-request/269#comment-17302 19:47:03 <shillman_> If I want what everyone else has been doing since the fork was made, how would I do that? 19:47:14 <shillman_> The main branch. 19:47:18 <jcline> shillman_, you can fetch each remote with "git fetch <remotename>" 19:47:38 <jcline> So if sayan adds a new branch or updates an existing one, you can get it with 'git fetch sayan' 19:48:15 <shillman_> And if I want the official devel branch, from which all forks were made? 19:48:20 <mizmo> jcline: oh oh 19:48:28 <mizmo> jcline: so if she does a fetch and there's a conflict, 19:48:54 <mizmo> by default i think git makes merge commits, but general practice is merge commits are no good right? should we set her to auto rebase? 19:49:47 <jcline> shillman_, I always leave my local develop branch tracking the upstream and typically people don't use that branch in their forks 19:51:00 <shillman_> My brain is melting. This may not be a relevant enough rathole to go down. :) 19:51:27 <jcline> shillman_, you can set the remote branch a local branch tracks with 'git branch --set-upstream-to=<remote-name>/<branch-name>'. So you can get the official develop branch by 'git checkout develop && git branch --set-upstream-to=origin/develop && git pull' or something like that. 19:52:51 <shillman_> Well, you've at least given me useful things to use when I try to figure this part out later. For the moment, though, there are far too few words in those sentences that I can currently parse. 19:52:58 <shillman_> jcline, ^^ 19:53:04 <mizmo> shillman_: usually i dont worry about my local fork getting out of date with everything else - once you submit it you can rebase it and that sort of replays your changes on top of the newer stuff. since nobody else is working on the same template you'll likely not get any conflicts 19:53:24 <shillman_> mizmo, Ok. 19:53:36 <shillman_> (i don't know what rebasing is) 19:53:55 <mizmo> that's what rebase is for :) i think. 19:53:56 <mizmo> so here's how i think about git 19:53:57 <mizmo> jcline and sayan feel free to grab some popcorn and laugh your bottoms off 19:54:13 <jcline> shillman_, hmm. You're right. My mind wandered. I meant "you can set the remote branch to a local branch that tracks upstream with" 19:54:17 <mizmo> git is playing hopscotch 19:54:48 <mizmo> every commit you make is like jumping another square on the hopscotch 19:55:22 <mizmo> when you work on your local checkout, you're playing hopstock on top of a snapshot of the main hopscotch board 19:55:31 <mizmo> before you push your moves back up to the main board, maybe i made somehops on squares on my local copy too 19:55:43 <mizmo> and then i pushed them before you had a chance 19:56:00 <sayan> this is how I do, I have develop branch which tracks upstream and pull changes regularly and work on branches and keep rebase the branch whenever I update my develop branch 19:56:00 <mizmo> so lets say the board was originally 19:56:01 <mizmo> A B C D E 19:56:03 <mizmo> then locally you added 19:56:11 <mizmo> A B C D E (your adds =>) 1 2 3 4 19:56:12 <mizmo> but you didn't push it 19:56:28 <mizmo> locally I added 19:56:29 <mizmo> A B C D E (mizmo's adds =>) X Y Z 19:56:41 <mizmo> then i pushed up to the main board 19:56:42 <mizmo> so now the main board has 19:56:43 <mizmo> A B C D E X Y Z 19:56:59 <mizmo> but your 1 2 3 4 moves are on top of A B C D E 19:57:35 <mizmo> so when git rebases, what it does is it takes the commits you made (1 2 3 4), rewinds them, updates your hopscotch board so it looks like A B C D E X Y Z (that's the latest), then replays your moves on that board (1 2 3 4) 19:57:53 <mizmo> so when you make your push and it requires a rebase, it'll end up 19:58:06 <mizmo> A B C D E X Y Z 1 2 3 4 19:58:10 <mizmo> sometimes a thing will conflict, that's more complicated. 19:58:25 <shillman_> Oh, that's what you meant by rebase... 19:58:46 <mizmo> yeh! you're basically just updating the chalk lines of the hopscotch board 19:58:56 <mizmo> and playing the same moves on top of a slightly modified board 19:59:30 <mizmo> i use hopscotch in the analogy just bc you can draw diff boards) 19:59:41 <mizmo> and there you have it almost an hour spent on git instead of what we really needed to work on lol 19:59:42 <mizmo> anyway! 19:59:54 <shillman_> Yeah... 20:00:00 <shillman_> Prep _always_ takes forever. 20:00:03 <shillman_> Anyway. 20:00:04 <mizmo> so! you shoul dhave a checkout of the badge-path-support branch 20:00:06 <mizmo> right? 20:00:08 <shillman_> Yes. 20:00:28 <mizmo> so go into your checkout, go to fedora-hubs/hubs/widgets 20:00:35 <shillman_> And we'll be editing css, and html, 20:00:52 <shillman_> and maybe py? 20:01:00 <mizmo> for editing, i like to use geany, butyou can use gedit or any code or text editor you want 20:01:03 <mizmo> not modifying the py but just looking at it for refreence 20:01:08 <shillman_> Ah, ok. 20:01:13 <mizmo> so we can see variable names 20:01:25 <mizmo> so open up badges.py in fedora-hubs/hubs/widgets - keep it open for ref 20:01:37 <shillman_> Oh, good, you have an IDE. :) 20:02:16 <shillman_> And opened. 20:02:16 <mizmo> open up fedora-hubs/hubs/widgets/templates/badges-path.html < do you have this? 20:02:17 <mizmo> oh oh i have a cool idea actually 20:02:34 <mizmo> etherpad 20:02:57 <mizmo> http://etherpad.osuosl.org/badges_path_template 20:03:08 <mizmo> shillman_: is anything in there? ill paste what i have ito etherpad 20:03:33 <shillman_> I have badgespath.html, but not badges-path.html 20:03:41 <mizmo> huh 20:03:50 <mizmo> oh yeh sorry i put a hyphen in by accident 20:03:56 <shillman_> k 20:03:58 <mizmo> is the file blank or are the contents the samea si have? 20:04:06 * mizmo doesnt remembe where she left off on working on this 20:04:32 <fm-hubs> pagure.pull-request.comment.added -- jcline commented on pull-request#269 of project "fedora-hubs" https://pagure.io/fedora-hubs/pull-request/269#comment-17303 20:04:47 <shillman_> It's got {{ badges_count }} and {{ series_info }} in it and nothing else 20:05:01 <fm-hubs> pagure.pull-request.comment.added -- jcline commented on pull-request#269 of project "fedora-hubs" https://pagure.io/fedora-hubs/pull-request/269#comment-17304 20:05:14 <mizmo> ok 20:05:26 <mizmo> so let's work with what i have in the etherpad 20:05:30 <mizmo> first let's run it and see what it does 20:05:45 <shillman_> How? 20:05:50 <mizmo> to do that, in a terminal, go to the root dir 20:06:14 <mizmo> (oh first, copy/paste the contents of the etherpad in your copy and save out) 20:06:25 <shillman_> ? 20:06:29 <shillman_> Gah 20:06:37 <mizmo> do you have it copied? 20:06:45 <mizmo> copy the contents of the etherpad into badgespath.html and save it out 20:07:13 <shillman_> saved out 20:07:21 <shillman_> Was unclear on root. 20:07:28 <shillman_> presuming you mean fedora-hubs root? 20:07:32 <mizmo> okay great 20:07:36 <mizmo> yeh the root dir of fedora-hubs 20:07:38 <shillman_> k 20:07:45 <mizmo> so on my system it's cd ~/Repositories/fedora-hubs 20:07:51 <mizmo> once in that dir, type 'workon hubs' 20:08:04 <mizmo> that turns your python virtual environment on 20:08:20 <shillman_> Yup 20:08:25 <mizmo> then, type 20:08:26 <shillman_> done 20:08:26 <mizmo> python runserver.py -c config 20:08:38 <mizmo> you should get some M2Crypto erros and a werkzeug debugger active thing 20:08:46 <shillman_> Yup 20:08:58 <mizmo> go to localhost:5000 20:08:58 <mizmo> sign in 20:08:59 <mizmo> (use your fedora account) 20:09:07 <shillman_> Logging in now 20:09:25 <shillman_> k, logged in. 20:09:52 * mizmo still waiting for log in lol 20:10:00 <mizmo> ok! now what i do is browse to a hub, usually the design team one: 20:10:07 <mizmo> http://localhost:5000/designteam/ 20:10:18 <shillman_> I wondered how you were going to do that. :) 20:10:20 * mizmo waits for it, very slow 20:10:35 <mizmo> in the upper right is a link, "edit this page" - click on that 20:10:43 <mizmo> select configure hub 20:10:58 <shillman_> Uh... 20:11:06 <mizmo> whats up 20:11:07 <shillman_> No edit page link 20:11:22 <shillman_> Says login required 20:11:29 <mizmo> oh i thought you logged in? 20:11:33 <shillman_> I did... 20:11:40 <mizmo> is your avatar in the upper right? 20:11:46 <shillman_> Yes, in as much as I hve one. 20:11:54 <mizmo> well maybe its a perms issue, you're not an admin of design-team maybe 20:11:59 <shillman_> Ah, maybe 20:12:04 <mizmo> so in the left nav, at the top it should say "me" ? 20:12:16 <mizmo> click on "me" 20:12:16 <mizmo> and click on "edit this page" there 20:12:32 <shillman_> ok, cool 20:12:46 <shillman_> configure hub.. 20:13:02 <shillman_> I can add widgets now? 20:13:19 <mizmo> yep and there should be an "add widget" button over the right column - click that, pick the badges path widget, and click the button. 20:13:25 <fm-hubs> pagure.pull-request.comment.added -- jcline commented on pull-request#269 of project "fedora-hubs" https://pagure.io/fedora-hubs/pull-request/269#comment-17305 20:13:31 <mizmo> save the page edits 20:13:40 <mizmo> and you should get a "badges path" widget at the top of the right col with a bunch of JSON gobbledygook 20:14:35 <shillman_> Whoa. Yes. 20:14:43 <shillman_> Not the top, though. 20:14:44 <shillman_> The bottom 20:14:56 <shillman_> well. Under meetings 20:15:05 <mizmo> okay you should be able to move it up 20:15:10 <mizmo> if you want 20:15:18 <shillman_> ... I don't see how. 20:15:34 <mizmo> drag n drop from the widget header? 20:15:35 <mizmo> have to be in edit mode tho 20:15:46 <mizmo> anyway let's takl about the html now 20:15:46 <mizmo> in the etherpad 20:15:48 <shillman_> Ah, invisible grabbing place on the right end of it. 20:15:51 <shillman_> ok. 20:16:15 <mizmo> (the whole thing should be clickable) 20:16:19 <shillman_> (nope) 20:16:29 <mizmo> okay so first we have a div element that encapsulates the whole widget 20:16:35 <mizmo> (poop!) 20:16:35 <mizmo> hehe 20:16:41 <mizmo> we'll fix it 20:16:50 <mizmo> so a note here 20:17:18 <mizmo> normally when adding an atomic element to a page like a widget with a name, i like to use the id attribute to label it and refer to it in CSS etc 20:17:32 <mizmo> however ID has a restriction that you can only have one item with any given ID in a web page. 20:17:37 <shillman_> ... atomic element should mean something but brain fry. 20:17:49 <mizmo> and, with widgets, you could have more than one widget configured for a given page 20:17:52 <shillman_> Yes. But there's something else. Class? 20:18:02 <mizmo> by atomic element i just mean, a part of the page that's sort of a single unit. like this badges widget. 20:18:06 <shillman_> Ah 20:18:12 <mizmo> yeh, i'm using class instead because there couldbe more than one badgespath widget on the page 20:18:17 <shillman_> *nod* 20:18:47 <mizmo> if i need to refer to a specific badgespath widget, if you look at that file we looked at way back when where this template gets injected into, it has a place where it inserts a unique id on the div that encapsulates this whole thing 20:18:54 <mizmo> so that's possible too. so we won't owrry about that. 20:19:16 <mizmo> okay so next we have some jinja logic 20:19:28 <shillman_> right. hubs.html 20:19:29 <mizmo> at the top we have a for statement 20:19:44 <mizmo> so anything in {% %} is jinja, and not html 20:19:56 <shillman_> Wondered what % was, yes. 20:20:08 <mizmo> and the syntax uses between the {% and %} is generally python syntax 20:20:36 <shillman_> Where are badge and series_info defined? 20:20:39 <mizmo> {% and %} are basically tokens that the flask code parsing the templates can use as a signal to know, "okay, i have to read this shiz as python and not spit it out onto the html page!" 20:20:51 <mizmo> okay good that's what i wanted to talk about next 20:20:53 <mizmo> *should* be in the badgespath.py file. let's take a look 20:21:36 <shillman_> Hmm... 20:21:39 <mizmo> ok so series_info is in badgespath.py 20:21:40 <mizmo> do you see it? line 46? 20:21:49 <mizmo> and line 41 20:22:12 <shillman_> Uh... 20:22:14 <shillman_> not in my version 20:22:32 <shillman_> ends at line 42 20:22:43 <mizmo> https://pagure.io/fork/sayanchowdhury/fedora-hubs/blob/badge-path-support/f/hubs/widgets/badgespath.py#_41 20:22:47 <mizmo> yes it's on line 41, and 46 20:22:54 <mizmo> https://pagure.io/fork/sayanchowdhury/fedora-hubs/blob/badge-path-support/f/hubs/widgets/badgespath.py#_46 20:23:16 <shillman_> Oh. I'm in badges.py. :( 20:23:27 <mizmo> thats the user one :) close that one bc it won't be useful 20:23:45 <shillman_> Working on that. :) 20:24:13 <shillman_> That's better. :) 20:24:29 <mizmo> ok cool 20:24:47 <mizmo> and while we're here let's take badgespath.py from the top 20:25:03 <mizmo> so the stuff at the top is importing libraries. eg this widget needs json to read in badge info from the badge server, so it's importing the json library for python on line 2 20:25:17 <shillman_> *nod* seemed like libraries, yeah. 20:25:25 <mizmo> line 13 defines the title for the widget header ("Badges Path") 20:25:31 <shillman_> But the from thing is weird... 20:25:33 <mizmo> line 14 links this python file with the logic for the widget to the template for output 20:25:55 <mizmo> line 15 indicates that this widget is meant to be a right hand sidebar widget and not a center col widget 20:26:37 <mizmo> IIRC, the from stuff is so if you have some huge library that's (fantasy making this up) 100MB and you only need a 100K part of it, you can just import that part and not need the whole huge thing? 20:26:38 <mizmo> i think? 20:26:50 <mizmo> although here we're pulling from parts of hubs.. 20:26:50 <mizmo> oh 20:26:52 <shillman_> Ah. Makes sense! 20:27:09 <mizmo> im not 100% sure on that, i probably shouldn't be making guesses. it could be from hubs.blah because it's from hubs itself and not an external library 20:27:09 <mizmo> not 100% sure 20:27:13 <mizmo> not so important i think 20:27:16 <shillman_> :) 20:27:17 <mizmo> okayso then line 18 20:27:18 <shillman_> *nod* 20:27:24 <mizmo> we have an argument, "username" 20:27:37 <mizmo> so for this widget to work, it needs to have a username 20:27:42 <shillman_> Right., Which we enter when we added the widget... 20:28:01 <mizmo> (did it ask you for a username when you added it to the hub in the web ui?) 20:28:02 <mizmo> okay great 20:28:03 <mizmo> there's a name for these @blahblah things, i think they are called decorators, i dont remember 20:28:18 <shillman_> I did not notice a help option, but I wasn't looking, either. :) 20:28:19 <mizmo> anyway 20:28:21 <mizmo> so line 22 20:28:22 <mizmo> def data(session, widget, username): 20:28:23 <mizmo> so that's a function definition 20:28:33 <shillman_> Ah, ok. 20:28:49 <mizmo> the function name is data, and it takes 3 inputs - the user session, the widget, and username you gave 20:28:55 <mizmo> this is where the meat of the widget logic goes i think 20:29:10 <mizmo> okay so it's got a username and a team_id hardcoded 20:29:11 <shillman_> 'user session' = the person who wants to use the widget? 20:29:24 <mizmo> no 20:29:28 <mizmo> user session is a web session thing 20:29:31 <mizmo> i think 20:29:38 <shillman_> k 20:29:52 <mizmo> like, the cookie that manages your login session or something like that 20:30:06 <mizmo> http as a protocol doesn't have sessions built in so web apps have to do it using cookies or other mechanisms 20:30:14 <shillman_> *nod* 20:30:15 <mizmo> okay anyway 20:30:25 <shillman_> Why are there two hardcoded username and team_ids? 20:30:25 <mizmo> so you'll notice we have a username here, and a team_id 20:30:29 <shillman_> Doe s it use the latter one? 20:30:32 <mizmo> you might wonder, well why is team_id not an argument? 20:30:39 <mizmo> yeh with most codes, the latter one is the one that applies. 20:30:40 <shillman_> That, too 20:30:58 <mizmo> okay i dont know if this is how this works right now 20:31:18 <mizmo> but the idea is that a team hub is associated with a team_id 20:31:19 <mizmo> so the design team hub's team id would be design-team or whatever 20:31:38 <mizmo> so, because we know this widget is on the design-team hub or the infratructure hub, we already know the team_id. it's implicit. so we don't need to ask the user for it. 20:31:53 <mizmo> we probably don't want to ask the user for the username either, but *shrug* maybe they want to track a mentee 20:32:17 <mizmo> okay now line 38 20:32:17 <shillman_> Yeah, why would a team badges widget need a username? 20:32:24 <shillman_> Will it work if blank? 20:32:36 <mizmo> well you see there's comments from line 28 to line 33 that kind of explain what'sg oing on 20:32:56 <shillman_> "explain" 20:33:29 <mizmo> i don't know where that stuff is happening, but basically with line 38, we're getting JSON from the badges server. (i dont know where the actual obtaining of the JSON comes from, but lines 38-39 is where we're receiving it 20:33:30 <mizmo> are you familiar with JSON? 20:33:31 <shillman_> I have no idea what's going on there. :) 20:33:35 <shillman_> No. 20:33:54 <mizmo> are you familiar with CSV files? 20:33:58 <shillman_> Yes. 20:34:00 <mizmo> (comma-separated values?) 20:35:05 <mizmo> or how about XML? 20:35:15 <shillman_> Yep. 20:35:20 <shillman_> Both CSV and XML 20:35:36 <mizmo> still there? 20:35:42 <shillman_> You can't see me? 20:36:29 <shillman> Can you see this version of me? 20:36:47 * shillman pokes mizmo 20:39:11 <mizmo__> okay 20:39:24 <mizmo__> so the main points of these file formats... 20:39:26 <mizmo__> CSV, XML, JSON 20:39:37 <mizmo__> is to make a file that is human readable but also machine-readable 20:39:43 <shillman_> Aaaah. Ok. 20:39:52 <mizmo__> there's sort of an annoying thing where the more human readable a file is the harder it is for a computer to parse it right 20:39:58 <shillman_> Yes. 20:40:01 <mizmo__> so first you had CSVs, then you had XML 20:40:09 <mizmo__> and at one point XML was gonna take over the world right 20:40:28 <mizmo__> (HTML is a form of XML too but not used as a data store int he same way) 20:40:40 <mizmo__> the problem with XML is it's really verbose and redundant 20:40:46 <mizmo__> you have open tags. you have close tags. a lot of crap. 20:40:47 <shillman_> (I think I vaguely knew that) 20:40:53 <mizmo__> so then JSON came about 20:40:57 <mizmo__> human readable 20:40:59 <mizmo__> but a lot more minimalistic 20:41:04 <mizmo__> but still very easily machine parseable 20:41:08 <shillman_> Cool! 20:41:16 <mizmo__> the JS in JSON is for JAvascript i think 20:41:31 <mizmo__> the syntax actually makes it valid javascript or makes it so that you can read in the values super easily in javascript 20:41:41 <mizmo__> a lot of langauges have parsers for json 20:41:54 <shillman_> Including, apparently, python 20:42:15 <mizmo__> so it makes it so we can get what is kind of like a database dump from one server (the badges server) to another (the hubs server) and then take that data and suction it into all the different variables our app needs (if that makes any sense) 20:42:24 <shillman_> Totally 20:42:29 <shillman_> Much sense. 20:42:32 <mizmo__> okay great 20:42:45 <shillman_> Do you know what fobj is? 20:42:51 <mizmo> oh hey this is working again 20:42:52 <mizmo> but my messages aren't going thru 20:42:56 <mizmo__> oh they are just slow haha 20:42:57 <shillman_> ... 20:42:59 * mizmo__ blames riot 20:43:02 <shillman_> :) 20:43:04 <mizmo__> ill stick to the ___ 20:43:06 <mizmo__> okay 20:43:34 <mizmo__> so fobj is the json firehouse 20:43:45 <mizmo__> we are opening 'payload.json' *as* fobj 20:44:07 <mizmo__> so we're using fobj to refer to open('payload.json', 'r') 20:44:20 <shillman_> Oooooh, oh, ok. 20:44:23 <mizmo__> kind of unwieldy to type open('payload.json', 'r') all over the place, fobj is nicer 20:44:30 <mizmo__> usually obj stands for object, not sure was f is for 20:44:31 <shillman_> Yes, absolutely! 20:44:36 <shillman_> file? 20:44:37 <mizmo__> i believe this is the firehose of badges data we get from the badges server 20:44:39 <mizmo__> yes! file object 20:44:43 <mizmo__> so it's the json file object 20:44:47 <mizmo__> then what we're doing 20:45:09 <mizmo__> we're making a payload variable, and using the json.load() method to read that file object and parse it into json we can work with 20:45:13 <mizmo__> i dont know if that makes any sense but 20:45:23 <shillman_> Yup, totally makes sense. 20:45:29 <mizmo__> okay great 20:45:36 <mizmo__> so now we have what is called a json payload object 20:45:38 <shillman_> grabbing stuff that is series info, whatever that is, and the number of badges. 20:45:49 <mizmo__> with a json payload we can use the get method to look up shit that's inside the json object 20:45:51 <mizmo__> exactly 20:46:09 <mizmo__> so we're looking in the json object for series_info and badges_count, then making local vairables with the same name and shoving that data into them 20:46:10 <shillman_> and then making a structure? 20:46:17 <mizmo__> yep. a dict i guess 20:46:26 <shillman_> Which is a... thing. 20:46:27 <mizmo__> then we return the dict 20:46:29 <mizmo__> now 20:46:38 <mizmo__> this is one of those weird flask things, i'm guessing a bit bc i'm a flask newb 20:46:45 <mizmo__> but again remember 20:46:57 <mizmo__> for the widgets we have a python .py file, and a corresponding .html template 20:47:10 <mizmo__> i believe the way you get this data from the python file to the template is to return it 20:47:23 <mizmo__> so the template file can magically grab anything that its corresponding python file returns 20:47:25 <mizmo__> (make sense?) 20:47:41 <shillman_> Right. Because that's how flask works, I assume? 20:47:48 <mizmo__> yeh, i think it's a flask thing 20:47:49 <shillman_> (what is series info?) 20:48:13 <mizmo__> so! that is why i left the template file in the state it's currently in. :) i wanted to look at the json and see what actually was in it! 20:48:19 <shillman_> Aaah, ok. 20:48:34 <mizmo__> so lets go back to that in the etherpad 20:48:51 <mizmo__> also back to the output in the hubs web page 20:49:14 <shillman_> Messy output... 20:49:15 <mizmo__> so theres so much spew, for me, it's hard to tell if this output is from 20:49:25 <mizmo__> line 3 or line 10 or line 11 or line 15, right? 20:49:34 <mizmo__> i dont remember what i was thinking when i last edited this. 20:49:51 <mizmo__> so what i wanna do is comment stuff out 20:49:55 <mizmo__> so we know exactly what's getting output 20:49:59 <mizmo__> and then reload the page 20:50:27 <shillman_> Ah. Wait. Would updating things work without restarting python? 20:50:36 <shillman_> Or did you mean including that? 20:50:44 <mizmo__> i think we have to restart, i'm not actually 100% sure 20:50:46 <shillman_> k 20:50:50 <mizmo__> but check out te changes i'm making in the etherpad 20:51:25 <mizmo__> okay so i'm going to copy/paste the etherpad on top of whats in badgespath.html 20:51:26 <mizmo__> save it 20:51:28 <mizmo__> kill the server 20:51:28 <shillman_> No series info for you! 20:51:30 <mizmo__> restart the server 20:51:32 <mizmo__> see what happens 20:51:56 <mizmo__> now i'm reloading the page 20:52:16 * mizmo__ cues cheesy hold music 20:52:34 * shillman_ is too 20:52:54 <mizmo__> uhhh lol 20:52:58 <mizmo__> okay 20:53:00 <mizmo__> yes! 20:53:03 <mizmo__> so the badges count is 12 20:53:12 <mizmo__> that means, there are 12 badges affiliated with the team (hardcoded as infrastructure) 20:53:16 <mizmo__> there are 12 infrastructure badges 20:53:22 <mizmo__> then we see the output of series_info 20:53:28 <mizmo__> series_info has a whole buncha spew 20:53:46 <mizmo__> it's kinda hard to make heads or tails of it. theres a few different ways we could play with it 20:54:08 <shillman_> What do the {{ mean? 20:54:18 <mizmo__> sec 20:54:25 <mizmo__> okay so this is the json spew 20:54:26 <mizmo__> http://etherpad.osuosl.org/json_spew 20:54:37 <mizmo__> everything between the [ and the ] is the json 20:54:44 <mizmo__> the { } are curly brackets to mark stanzas of javascript 20:54:47 <shillman_> ... how do you know? 20:54:56 <mizmo__> i dont know if you're familair wtih jquery? but it uses {} in a similar way 20:55:03 <mizmo__> javascript uses { } to mark scope 20:55:06 <mizmo__> python uses... spaces 20:55:10 <mizmo__> it's a syntax thing 20:55:16 <mizmo__> how do i know that's the json spew? 20:55:25 <shillman_> Yeah. 20:55:46 <mizmo__> so look at the etherpad with the page code in it 20:55:54 <mizmo__> this is what is getting output: 20:55:57 <mizmo__> lines 12-14 20:56:01 <mizmo__> badges count: {{ badges_count }} 20:56:01 <mizmo__> <br /> 20:56:01 <mizmo__> series_info: {{ series_info }} 20:56:08 <mizmo__> so i look for the "series_info: " strng in the spew 20:56:13 <mizmo__> on the hubs web page 20:56:20 <mizmo__> then i see the [ 20:56:23 <mizmo__> and i look for the closing ] 20:56:33 <mizmo__> and i know thats the entire blob 20:56:39 <mizmo__> because every open bracket needs a close : 20:56:40 <mizmo__> :) 20:56:43 <mizmo__> make sense? 20:56:56 <shillman_> Ooooh. I missed the part where you added series_info: and such. :( 20:56:56 <mizmo__> it also *looks* like json spew 20:56:57 <shillman_> :) 20:57:01 <mizmo__> so you kind of get a sense for seeingt he spew 20:57:01 <shillman_> Now I'm less confused. 20:57:06 <mizmo__> i added a little thing lower down too 20:57:11 <mizmo__> i was trying to access the badges variable 20:57:13 <mizmo__> so i did 20:57:39 <mizmo__> lines 17-21, an if statement.... if a variable named badges existed, it would print "badges: yes" (line 18) 20:57:45 <mizmo__> if not, it would print "badges: no" (line 20) 20:57:57 <mizmo__> scroll tot he very bottom of the widget and survey says...... 20:57:59 <mizmo__> "badges: no" 20:58:01 <mizmo__> wah 20:58:05 <shillman_> :( 20:58:08 <mizmo__> so we do not have access to a variable called "badges" 20:58:12 <mizmo__> (that was just me screwing around iirc 20:58:13 <mizmo__> okay 20:58:21 <mizmo__> so we have some delicious json data here to play with 20:58:24 <shillman_> *grin* 20:58:30 <mizmo__> you could use a browser development tool like firebug to kind of pick thru it 20:58:40 <mizmo__> what i like to do is just google for a json parser and copy paste the whole dump into it 20:58:42 <mizmo__> and it'll format it nicely 20:58:51 <shillman_> Oh, that's cool, yeah. 20:58:53 <mizmo__> so lemme find one. iirc i had to go thru a few before i coudl find one that would interpret this for wahtever reason 20:59:17 <mizmo__> (feel free to copypasta from http://etherpad.osuosl.org/json_spew) 20:59:43 <shillman_> (I'm doing this myself at the same time, so have it) 21:00:04 <mizmo__> i think it doesn't like the "u"'s 21:00:15 <mizmo__> im not sure why they are there 21:00:29 <mizmo__> jcline, do you know why our json data would have a 'u' character before every field/value? 21:00:57 <shillman_> u', no less 21:01:03 <shillman_> Oh, nm 21:01:07 <jcline> mizmo__, yup. In Python 2, that indicates the string is a unicode string object. 21:01:11 <shillman_> values have quotes around them. 21:01:15 <mizmo__> jcline, grr, any easy way to clean it? 21:01:56 <mizmo__> shillman, well! this one, if you pick "do not validate" from the bottom dropdown, it'll happily let you browse it anyway, u's and all! 21:01:58 <mizmo__> https://jsonformatter.curiousconcept.com/ 21:02:19 <jcline> Ahh, you want JSON? 21:02:21 * jcline reads up 21:02:28 <shillman_> Heh. I just got to that one myself. :) 21:03:35 <shillman_> Evidently infrastructure people are frogs. :) 21:04:44 <mizmo__> lol yes 21:04:52 <mizmo__> they start out as eggs then tadpoles then frogs 21:04:57 <shillman_> mizmo__ so what we would want is the name, png... 21:05:09 <mizmo__> well lets look at the mockup 21:05:39 <mizmo__> https://pagure.io/fedora-hubs/issue/raw/files/d26642740eadf474f0d21b0b7c8c8023dd53b987375931836473379010edf137-team-badges.png 21:06:13 <shillman_> I can't tell how to tell if these are all badges that this user has? 21:06:19 <shillman_> Or if these are just all available ones? 21:06:22 <mizmo__> yeh 21:06:30 <mizmo__> so it might be confusing, but here is how it's meant 21:06:46 <mizmo__> the top row is the user's 21:06:56 <shillman_> I meant in the json... 21:07:17 <mizmo__> so if you look at the badgespath.py file 21:07:29 <mizmo__> https://pagure.io/fork/sayanchowdhury/fedora-hubs/blob/badge-path-support/f/hubs/widgets/badgespath.py#_29 21:07:39 <mizmo__> it's retrieving that data from https://badges.fedoraproject.org/user/{username}/team/{team_id}/json 21:07:46 <mizmo__> so lets see what that says 21:07:59 <mizmo__> https://badges.fedoraproject.org/user/duffy/team/infrastructure/json 21:08:08 <mizmo__> 500 error :-/ 21:08:26 <shillman_> Yeah... 21:08:40 <mizmo__> but something has to be working because we have data in the json and not a 500 error 21:08:43 <jcline> mizmo__, okay now I understand. To more fully answer your question, it has u'stuff' because it's a representation of a python dictionary and not actually json. To make it actual json you have to do ``json.dumps(<some python dictionary>)`` 21:08:46 <shillman_> Yeah. weird 21:08:53 <mizmo__> jcline, ahhh ok 21:09:00 <jcline> Sounds like you got around it though :) 21:09:02 <mizmo__> jcline, that makes sense, thank you :) 21:09:41 <mizmo__> jcline, we're now trying to figure out what the data actually means 21:09:51 <mizmo__> the url the code says its using on the badges server is ISE'ing on us 21:10:23 * mizmo tries https://badges.fedoraproject.org/user/duffy/json 21:10:45 <shillman_> it's taking longer.. 21:11:04 <mizmo> jcline: fwiw https://pagure.io/fork/sayanchowdhury/fedora-hubs/blob/badge-path-support/f/hubs/widgets/badgespath.py#_29 21:11:26 <mizmo> ah that worked 21:11:36 <shillman_> Whoa, lots of things. 21:11:58 <mizmo> so https://badges.fedoraproject.org/user/duffy/json works 21:11:59 <mizmo> but that's ALL my badges, not just the infrastructure ones 21:12:07 <jcline> Sounds like a bug :( 21:12:11 <mizmo> https://badges.fedoraproject.org/team/infrastructure/json <= 404 error 21:12:24 <shillman_> Yeah, but this is a different set of badges, even if I search on infra 21:12:30 <shillman_> Not just frogs 21:12:31 <mizmo> jcline: but! hubs is succesfully getting a json file from it 21:12:42 <mizmo> shillman_: frogs is definitely an infra badge 21:12:46 <shillman_> In fact, no frogs 21:12:55 <mizmo> shillman_: well infra has badges beyond frogs 21:12:55 <mizmo> oh i have no frogs? 21:13:07 <sayan> mizmo: badge prod does have the prod support yet 21:13:14 <jcline> Odd. Still, nothing should ever 500 unless something unexpected happened. 21:13:18 <sayan> s/does/does not/ 21:13:20 <mizmo> sayan: ohhhh 21:13:21 <mizmo> sayan: is it badges.stg 21:13:27 <shillman_> Flock organizer, krakow-brews, design-ninja 21:13:29 <jcline> Ahh 21:13:33 <mizmo> shillman_: we were using the wrong environment :) 21:13:42 <shillman_> mmm? 21:14:08 <mizmo> the production environment of badges (badges.fedoraproject.org) doesn't have the feature that sayan added to the badge server to give you team badges per user. 21:14:17 <shillman_> Oooh. 21:14:18 <mizmo> so we have to figure out which env the hubs code is getting the json from 21:14:32 <sayan> mizmo: the development version read the data from a file 21:14:47 <shillman_> Aaah 21:14:52 <mizmo> sayan: is it badges.dev? is there a way we can access it? 21:16:06 <sayan> mizmo__: not yet. badges.stg is had some issues with migrations. I need to wait for puiterwijk to return 21:16:30 <mizmo> ah ok 21:18:38 <mizmo> shillman, okay so let me just sanity check some of this by hand 21:19:35 <mizmo> https://badges.fedoraproject.org/user/duffy 21:19:39 <sayan> mizmo: something like this would be returned https://pagure.io/fork/sayanchowdhury/fedora-hubs/raw/d102a16c913d53ec4ccdecbf398f948ba8ac96cd/f/payload.json 21:20:16 <shillman_> sayan, are those only the badges in infra for that user? 21:20:46 <shillman_> I'm also unclear on what created on means: is that when the user got the badge? 21:21:42 <mizmo> shillman_: so in all that spew, there are only 6 badges 21:21:52 <sayan> shillman_: created_on is timestamp 21:21:59 <mizmo> and looking at the prod badges server, i do infact have all of those badges, and they are all infra badges 21:22:20 <shillman_> timestamp of... the badge being created? 21:22:28 <mizmo> sayan: is created_on when the badge was created or when user got awarded it? 21:22:33 <shillman_> That. 21:22:49 <mizmo> hehe 21:23:34 <sayan> created_on specifies when the object was created, for example it could be when team was created, series was created, badges was created 21:24:19 <mizmo> ah ok thank sayan 21:24:22 <mizmo> thanks even :) 21:24:47 <mizmo> shillman_: so this data gives us a few things that help us implement the mockup 21:24:49 <sayan> if a user is awarded a badge it is called assertion in tahrir terms, so if you see created_on related to assertion then it is for when the user was awarded badge 21:25:03 <mizmo> sayan: ah ok 21:25:04 <sayan> ^^ hope you got this one 21:25:12 <mizmo> it doesnt look like assertion date is in the json 21:25:26 <mizmo> well the series_info json anyway 21:25:45 <mizmo> but maybe we can get elsewhere 21:25:46 <mizmo> yeh it's in the user json 21:26:35 <sayan> yeah, series info does not have that 21:27:06 <mizmo> shillman_: ok so we've got some good data here we can definitely make use of in the mockup 21:27:16 <mizmo> first: we know how many badges that are infra that this user got : 6 21:27:21 <shillman_> mizmo, ok. I'm a bit confused by user data stuff. 21:27:29 <shillman_> Wait, but doesn't count say 12? 21:27:30 <mizmo> how we spit that numbe rout, we'll have to figure out (there must be some method that'll count it) 21:27:39 <shillman_> Even though they actually got 6? 21:27:40 <mizmo> well let's just focus on the json data we have now 21:27:43 <sayan> jcline: tahrir needs API documentation :) 21:27:51 <mizmo> so i think count is the total 21:27:57 <mizmo> theres 12 total infra badges maybe? and this user has 6? 21:27:59 <mizmo> we need to figure that out, because i'm not usre. 21:28:04 <shillman_> Oooh. 21:28:26 <mizmo> where i'm getting 6 from... counting the number of 'milestone' stanzas in the json 21:28:26 <mizmo> there's 6 21:28:34 <shillman_> Yeah, I saw that. 21:29:12 <jcline> Mmmm documentation. I had a good time yesterday making Sphinx do pretty things. I've muddled along with Sphinx for a long time, but now I think I understand most of the bells and whistles and I'm excited to make documentation. 21:29:17 * mizmo tries thi sin prod: https://badges.fedoraproject.org/tags/infrastructure/any 21:29:24 <mizmo> that pulls up 5 that aren't the same as the 6 we have 21:29:47 <shillman_> Yeah, I found 5 as well, using the search here: https://badges.fedoraproject.org/explore 21:30:22 <shillman_> Same set. 21:31:01 <shillman_> When we looked at the json for you, and looked for infrastructure, there were three others that I think were not here. 21:31:08 <shillman_> But maybe that's not a useful search method 21:31:21 <mizmo> well 21:31:24 <mizmo> prod doesn't have the team series feature 21:31:28 <mizmo> and we dont have access to devel i think 21:31:40 <mizmo> so let's just keep the guess that this user has 6, and there's a total of 12 21:31:45 <shillman_> OK. 21:31:56 <sayan> jcline: and Vagrant+Ansible setup too, so that mizmo and shillman_ could setup tahrir quickly 21:31:57 <mizmo> sayan: ^ does that sound right? 21:32:23 <mizmo> sayan: we haves badges_count = 12 but series_info for that user/team has 6 badges 21:32:38 <mizmo> so we're guessing the 12 is the total number of infra badges, and the 6 badges are the 6 of the 12 that the user has earned 21:33:12 <jcline> It'll be nice (and this is a long way off) when you can set up all our apps in Vagrant environments and auto-configure them to talk to each other so you can have a mini fedora-infra deployment on your laptop 21:33:36 <sayan> mizmo: 12 badges for that infrastructure team 21:33:43 <mizmo> sayan: awesome 21:33:45 <sayan> 6 badges part of series 21:34:15 <sayan> jcline: yup 21:34:18 <shillman_> ... series_info is about specific series, not about what a user has of that series... 21:34:19 <shillman_> Yes? 21:34:36 <sayan> shillman_: right 21:34:45 <mizmo> shillman_: well wait 21:34:46 <mizmo> which series info are you talking about 21:35:04 <mizmo> because the series_info variable we're dumping into the web page, is the series info for the badges that user has 21:35:15 <shillman_> mizmo, Are you sure? 21:35:28 <shillman_> So we know they have at least one of the ones in that series? 21:35:35 <shillman_> *confused* 21:35:57 <shillman_> https://pagure.io/fork/sayanchowdhury/fedora-hubs/raw/d102a16c913d53ec4ccdecbf398f948ba8ac96cd/f/payload.json 21:36:01 <mizmo> shillman_: yes sec 21:36:01 <shillman_> Is what I was talking about. 21:36:43 <mizmo> shillman_: that json only has 6 badges in it 21:36:49 <shillman_> Yes. 21:36:58 <mizmo> shillman_: that's the same json we're loading in. that's the static data the server is spitting over to us 21:37:00 <shillman_> I believe that those are the 6 badges in the series involving frogs. 21:37:13 <shillman_> And that the user in question has at least one of those badges. 21:37:15 <mizmo> OH 21:37:24 <mizmo> i see. it's the 6 n the frog series. and the 12 is all infra, of which the frog series is one part 21:37:28 <mizmo> well 21:37:42 <mizmo> the duffy user has all 6 of those 21:37:42 <mizmo> maybe we shuld use a different user 21:37:49 <mizmo> how old is your fas account? did you create it at the beginning of the internship? 21:37:49 <shillman_> I have none. 21:37:57 <shillman_> During the inkscape tutorial 21:38:05 <shillman_> Maybe? 21:38:05 <mizmo> your fas account is wispfox isn't it? or shillman? 21:38:06 <mizmo> fas account = fedora account 21:38:12 <shillman_> How do I check? 21:38:13 <shillman_> it 21:38:15 <shillman_> s wispfox 21:38:30 <shillman_> yeah, at the inkscape tutorial 21:38:31 <mizmo> you used it to log into hubs 21:38:32 <mizmo> okay 21:38:33 <mizmo> so it's a pretty young account. let's use it :) 21:38:33 <mizmo> and see what happens 21:38:34 <mizmo> although 21:38:35 <mizmo> this is all hard coded 21:38:36 <shillman_> 2016-08-05. 21:38:46 <mizmo> i think no matter what we'll get the same 6 21:38:50 <shillman_> Yeah. 21:38:57 <mizmo> sayan so we are pretty confused about the json payload 21:39:19 <mizmo> sayan: https://pagure.io/fork/sayanchowdhury/fedora-hubs/blob/badge-path-support/f/hubs/widgets/badgespath.py#_29 21:39:38 <mizmo> sayan: that line 29 seems to indicate that the payload is meant to take into account the user's earned badges for that team right? 21:39:53 <mizmo> then we do series_info = payload.get('series_info', []) 21:40:12 <mizmo> since we're working with static / hardcoded data it's hard to know what we're supposed to expect here 21:40:41 <mizmo> if i set username = 'wispfox' and she only has 1 of the badges on the infrastructure team 21:40:42 <sayan> mizmo: the complete series info list 21:40:52 <mizmo> will series_info have all badges in the tadpole series? or the 1 she earned? 21:41:20 <mizmo> if it has the compelte series info, why is it taking the username into account? 21:41:21 <mizmo> what is it doing with the username? anything? 21:41:22 <sayan> all the badges will be there, but there is one field is_awarded 21:41:46 <mizmo> AH ok 21:41:47 <mizmo> perfect 21:41:55 <shillman_> And in this data set, they are all awarded? 21:41:57 <shillman_> Correct? 21:42:02 <sayan> yes 21:42:04 <mizmo> sayan: so it says badge count 12 but theres' only 6 in the series. so does that mean infrastructure has 6 other badges? 21:42:05 <shillman_> (at least that'swhat it looks like) 21:42:10 <mizmo> if so how do we get access to the 6 other badges? 21:42:20 <sayan> mizmo: yes 21:44:08 <mizmo> is there another variable they're in? 21:45:32 <sayan> mizmo: so this is the script that I use to populate data in tahrir database 21:45:35 <sayan> mizmo: https://github.com/fedora-infra/tahrir-api/blob/01_populate_script/tahrir_api/scripts/populatedb.py 21:45:56 * mizmo looks 21:45:59 <sayan> so here infrastructure has two series: https://github.com/fedora-infra/tahrir-api/blob/01_populate_script/tahrir_api/scripts/populatedb.py#L135 21:46:19 <sayan> copr series and infrastructure series 21:46:38 <sayan> copr series has 6 badges - https://github.com/fedora-infra/tahrir-api/blob/01_populate_script/tahrir_api/scripts/populatedb.py#L86 21:47:06 <sayan> I meant copr and fas series instead of infrastructure series 21:47:21 <sayan> and fas series has 6 badges - https://github.com/fedora-infra/tahrir-api/blob/01_populate_script/tahrir_api/scripts/populatedb.py#L95 21:47:37 <sayan> so in total 12 badges within infrastructure team 21:47:52 <sayan> divided in 2 series 21:48:00 <mizmo> okay 21:48:38 <mizmo> so we need to figure out how to get access to all of the series and any non series badges in a team from the flask template 21:49:37 <mizmo> because we need to know, of the 12 badges that are part of the team, which ones are is_awarded true so we can get a coutn for how many of the infra badges the user has 21:49:46 <sayan> mizmo__: non-series is not possible as of now. I mean it does on have a API endpoint written 21:50:10 * sayan opens the mockup 21:50:11 <shillman_> That would make writing the code difficult, yes. :) 21:50:23 <mizmo__> https://pagure.io/fedora-hubs/issue/raw/files/d26642740eadf474f0d21b0b7c8c8023dd53b987375931836473379010edf137-team-badges.png 21:50:46 <mizmo__> team badges: in the upper left, 26. that means the logged in user has 26 of the total badges (we probably should say 26 of 32 or whatever rather than just 26 for clarity) 21:51:20 <mizmo__> we can do the team badge missions part of this mockup altho i dont know how to get the copr series into the template 21:51:36 <shillman_> what's a copr? 21:51:58 <shillman_> And do missions involve the series? 21:52:06 <shillman_> serieses 21:52:26 <mizmo> shillman_: copr is copr.fedoraproject.org and my guess is copr badges are awarded for doing things on that app 21:52:38 <mizmo> shillman_: yes a mission == series 21:52:51 <shillman_> Aaah. 21:53:49 <sayan> wait, there was a terrible bug :( 21:54:16 <mizmo> uh oh :( 21:54:35 <shillman_> Noooooooooo! 21:55:09 <sayan> mizmo: not a big one 21:56:18 <sayan> since there are 2 series technically series_info should have both the series in the json 21:56:44 <sayan> but right now it has only the infrastructure ones and not the copr ones 21:59:03 <shillman_> mizmo, we have been at this for 3 hours. Maybe work on this more another time? 22:00:35 <mizmo> shillman_: yes i think so i'm burnt out 22:00:41 <shillman_> Me, too. 22:00:43 <mizmo> shillman_: we haven't hit any actual html coding yet, but are you getting much out of this? 22:00:51 <mizmo> shillman_: do you kind of see the process you have to go thru to get the data into the template? 22:01:08 <shillman_> Eh. Some? Mostly I'm getting a sense of the stuff around the actual coding, but things that will make the coding easier to do. 22:01:10 <sayan> mizmo: shillman_ https://pagure.io/fork/sayanchowdhury/fedora-hubs/raw/badge-path-support/f/payload.json 22:03:27 <shillman> mizmo: I sort of see the process, but at the moment my brain is too full to be sure. 22:03:46 <shillman> I'll take another look at this log tomorrow and see if I can sort it out into something a little more clear. 22:03:54 <mizmo> shillman: lol sleep on it and digest it. we can pick back up on tuesday? 22:04:00 <shillman> Sure. :) 22:04:05 <mizmo> we'll stick to just html then 22:04:06 <mizmo> #endmeeting