Fedora-Hubs : Getting Started

Fedora-Hubs : Getting Started

The definition for fedora-hubs has changed over the months !
Hubs has come a long way from when it was initially started. From new milestones, to new goals, new road-maps.

13680039_1058512467557761_3247752188007831819_o

There have been new contributors willing to contribute to hubs, but facing issues while setting it up locally. Thus an initiative to help out new contributors hack their way into the project. Few common terms and words, not so common to the non-hubs world 😛

To begin with: We have taken efforts in keeping the README file updated. You might want to keep looking back to this file while setting it up locally.
Below, I have explained a tiny bit more in detail about a few things that might be confusing or where one can face issues, also how these files happen to be inter-related.
After having installed all the dependencies and cloned the project, you need to configure the project to authenticate against Ipsilon, fedora’s multi-protocol Identity Provider service.

oidc-register --debug https://iddev.fedorainfracloud.org/ http://localhost:5000

If one faces an error regarding verification of certificate, the following command will replace httplib2’s ca cert file, else you’ll be thrown back since you don’t have the http setting.

cp /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem ~/.virtualenvs/hubs/lib/python2.7/site-packages/httplib2/cacerts.txt

You also might want to keep clearing/refreshing your cookies. After having created the local configuration file as mentioned in the README, one needs to create the database.
Further which one can finish running the app by starting the devel server with their local config file.

Few not-so-common terminologies:
Hub: A hub can be associated with a page displaying the info that concerns the hub.
Widget: The various sized rectangular cards on a hub-page are termed as widgets.
One can find the various widgets under the widgets/ dir in the source-code.
Every widget has a respective html file under the widgets/templates dir.
User-Hub page: The hub page of a fas (fedora account system) user that lists down the                                          widgets he/she has configured and wishes to display on his/her page.
While hacking on the project, you might want to navigate to localhost:5000/ to view the widget on a user-hub page.
Group-Hub page: The hub page of the various teams such as Infrastructure, Design-team,                                    Commops, Marketing, i18n.
Similarly, while hacking on a widgets relevant to groups, you need to navigate to localhost:5000/ to view the respective widget on the group-hub page.

Again, when hacking on a new widget, according to the hub page you wish to display, one might want to add it either to the hubs/defaults.py file or to the populate.py file. One can look into it under the “Stubbing out a new widget” section of the README file.

You might see something similar to this on your localhost :

Screenshot from 2015-12-08 19-23-41

So, this is a group-hub page, Group:Infrastructure here, listing down the widgets with respect to the infrastructure group. Widgets are listed in the same order as added with their index values, in the populate.py file under the Infrastructure team.

This is a user-hub page:

Screenshot from 2016-03-17 03-28-52

fas_username: devyani7, listing down the widgets configured in the hubs/defaults.py file. Here, this user-hub page can be configured as the user wishes his/her page to appear to the visitors.

One channel where you can drop/lurk for further queries: #fedora-hubs on freenode.
We have weekly-meetings every Tuesday at 14:00 UTC 🙂
We also have a mailing-list: https://lists.fedoraproject.org/archives/list/hubs-devel@lists.fedoraproject.org

Advertisements

Sortable !

Sortable !

I wanted to finish working on this feature by the end of the previous week but university exams were keeping me busy. As they say, Better late than never ! eh? 🙂

Quick Recap : I was working on the bookmark-modal window which would feature the hub pages bookmarked by the user, that the bookmarks-bar cannot hold (overflowing bookmarks)

Week 1:
I hacked on the master.html file to get the edit_bookmarks modal window to pop-up on hitting the *edit* button. Added few hacks on style.css as well to bring it closer to Mizmo’s mockup.
Screenshot from 2016-06-19 11-52-28.png

Screenshot from 2016-06-08 23-08-49.png

Week 2:
Making the bookmarks toggle !
During the Hub’s meeting, Sayan suggested that the mockup required extra styling that wasn’t preferred. We wanted to use fedora-bootstrap alone, so that the modal window looked bootstrappy, thus dropping the idea to add styling.
The user is to be able to re-order the bookmarks at his will, so Pierre suggested to use something like jquery sortable() but using bootstrap. I tried experimenting using jqueryui and after several attempts, it finally worked ! 🙂 Though there is still more experiments to be done…

Screenshot from 2016-06-19 12-06-00.png

Screenshot from 2016-06-18 23-59-41.png

Preview : This week I plan to work on providing suggestions to the user to re-order hub-bookmarks depending on the frequency of the hub pages he/she visits often.

Till next week ! Good day to you 🙂

Scroll ! Think ! Bookmark !

Scroll ! Think ! Bookmark !

Hi there,
so we are in the second half of the year and its been quite exciting so far 😛
Looking forward to amazing times !

It’s been a week since the coding period began, the first feature that we plan to work on is the bookmark feature. Soon there will be quite some hub-pages for Users and also for groups, such as Infrastructure, Design, Marketing, Commops, etc.
So it might get difficult to keep track of the pages a user wishes to follow closely.
Currently, the hub pages are just added to the bookmarks bar.
We plan to provide the user with a *EDIT* bookmarks option, which would list down the hub pages that were bookmarked by the user initially, followed by the pages that are most frequently opened by the user, that exist in the overflowed list and not in the main bookmarks bar.
Aye ! that’s confusing 😛

Screenshot from 2016-05-31 16-59-55

So, we see here that the bookmarks were just added to the main bar.
Instead, an ‘Edit bookmarks’ option will be listing the hub pages that exist in the overflowed list, with those that user bookmarked in the top of the list.

9f55e46911d9e3589045fd0fe17e879e0a48573e878a8ff6448a7c50958367ed-edit-hubs-list

Thanks to Mizmo, Sayan, Pingou for providing a few pointers on the same in yesterday’s Hubs-meeting ! Discussed ideas were that the bookmarks shouldn’t change dynamically, rather we’ll be providing the user a suggestion to move the frequently opened bookmarks further up in the bookmarks list.
This is what I plan to accomplish this week. *fingers crossed* 🙂

A small info : We have our weekly Hubs meeting in #fedora-hubs at 14:00 UTC on Tuesdays. Anyone interested can attend or if you have any suggestions; they are most welcome !

That’s all folks ! See you next week 🙂

Fedora-Hubs: Google Summer of Code 2016

Fedora-Hubs: Google Summer of Code 2016

 

A warm hello to the Summer Coding World.

Devyani is a CS Undergraduate who will be working on Fedora-Hubs as her Google Summer of Code 2016 Project.

The Google Summer of Code 2016 results were declared on 22nd April 2016. The Community Bonding Period has been amazing: meeting like-minded people, making new friends and being a part of this awesome community !

Initially in May, I started to hack around the Feed-Widget of the Project, Fedora-Hubs.
The project is available on Pagure.

I had to go through the documentation, and hubs/widgets code more in detail thus, that week was pretty much a reading week rather than coding week. Hubs is implemented using Flask, which uses Flask-SQLAlchemy. Flask-SQLAlchemy wasn’t exactly my strength, especially the models and the relationships that exist. Hubs are related to widgets by many-to-many relationship. I went thoroughly through the Flask-SQLAlchemy documentation and googled more about establishing relationships amongst the fields. I tried to write down the code to establish relation between the databases to understand the connections between the various fields: Hubs, Users, Widgets 😛
This helped me a lot to understand the basic structure of Hubs.

I also had to go through the Feed-Widget to work on getting similar threads of the mailing-list posts together based on Mizmo‘s mockups. That’s still a work in progress, though.
Largely the summer goals will be to integrate hubs successfully, with all the widgets working efficiently. By the summer, we plan to provide the user with an individual hubs-page featuring the widgets; a cool bookmarks bar for the user to switch tabs at his will; provide info regarding the unread notifications that he/she follows or is subscribed to.
We also plan to work on the badges-widget before Flock 2016 that displays a cool path of the badges that can be achieved. For the more interested folks, I have my project proposal updated on the wiki 🙂

For more updates on Hubs, follow me @devyanikota. I go by the nick devyani7 on freenode, you can find me lurking on #dgplug, #fedora-apps, #fedora-hubs. My Github profile and Pagure profile.

Until next time, Happy hacking !

GSoC Battle 2016

GSoC Battle 2016

Hello reader,
The third attempt and yeah made it, this time. 😀
No more regrets in life ! soon a GSoCer !

I started contributing to Fedora infrastructure projects after I returned from PyCon India 2014 prior which was contributing to gnome-shell, one can say that after this event, meeting people and the environment as a whole motivated and inspired a lot, and since then I never backed down !
yeah, the trick was to not lose hope and keep working harder, guess that worked 🙂
After the Outreachy debacle, (which the lowest phase I guess) am blessed to have such motivating people around me who kept pushing me.
Huge thanks to Kushal da, Sayan, Subho, and Elita of course for helping me through it.

The cliche result night, for two seconds my mind said, “That’s alright, maybe not this time either. Am anyway not losing hope, will move on !” But, then there was my name. “phew!!”, “yay ! I finally made it”. Am so happy, I will be working on Fedora-hubs this summer.
I should thank my mentor RalphBean for helping me with my naive doubts, and for guiding me fix bugs all this time. Huge thanks to Pierre, MizmoJustin, Sayan, for reviewing my proposal and getting it done on time 😛
Am glad I will be working with them this summer, hacking on Hubs !

A little throwback: am really glad I finished the #dgplug summer training successfully that moulded me be what I am !

For those interested, can take a look at the proposal on fedora-wiki.
See ya all !

Happy Coding 🙂

 

 

Modelling Models !

Modelling Models !

Hey there reader !
Its been quite some time since I updated about brainstormings going on for the new widgets for the hubs pages.
So, I was working on an issue for the Subscriber/Subscribe widget, where I had to list the number of subscribers that were subscribed to this user(his/her hub page), and also the number of users he/she was subscribed to, basically the subscription stats.
pretty simple, eh? That’s what I thought too 😛
Well PR #111 fixes it !

I learned a lot while trying to figure out ways to solve this issue, jotting them down :

  • how easily one can access the attributes if we know the relation between two objects/tables.
  • using dir() function to see beyond an alphanumeric object !
  • write test-cases.

Structure of HUBS :
User : A user table with attributes like openid, fullname, and created_on.
Hub:   This is the individual user’s hub page(in simple terms-profile page) with attributes                like name, created_on, widgets, etc
So, we wanted to implement a many-to-many relationship between users and hubs, ‘coz many users can subscribe themselves to many hubs.
So, I spent quite some time with the flask-sqlalchemy tutorial to learn the pythonic implementation of the many-to-many relationship. 😛 my bad !!
Its really amazing to read code written by awesome developers. Ralph‘s code already had the ‘Association’ table to connect the users and hubs.

>>> for assoc in widget.hub.associations:
........sub_list = [u.name for u in assoc.user.subscriptions]
>>> subscribers = [u.username for u in widget.hub.subscribers]

‘widget.hub.associations’ returned a list of associated user objects.
This is where dir() function came to my rescue 😛
So I tried to print the attributes of the user objects that were being returned by simply printing the output of the same.

>>> print dir(widget.hub.associations)

Thus, displaying a list of the attributes of the object.Screenshot from 2016-03-15 02-38-05
Hub names were extracted, which helped extract the subscriptions of the respective hub_user’s page.
Rest, was a simple edit in the jinja template, that made the Subscribe/Unsubscribe button do its magic 😉

But, that was not the end !
I had tests failing ! 😦
I didn’t have any experience with writing tests.

Why were tests failing ?
‘coz the default values of the subscribers was still assigned ‘0’, when I had changed it into a list. Changing its default value to ‘[]’ and voila !
It works !

I came across an awesome quote when bugs overpower you 😛

Your Goals don’t care if its the weekend !

 

Fedora Hubs !

Fedora Hubs !

What have I been hacking on recently ?
Well, for the past um, a month and a half, was hacking on Fedora-Hubs !!

So, it was after I returned from PyCon India 2015 that I thought of applying for Outreachy Internship this winter, and that is when I came across this – Fedora-outreachy-wiki link.
Next, I mailed Ralph, who was listed as the mentor for the project, pinged him on IRC eventually 😉 and got an immediate response to go ahead with the ReadMe and get it up on my system.

What is Fedora-Hubs ?
It will be an ‘intranet’ page for the Fedora Project. A single place to get information on all the different projects on Fedora, as a contributor. It’s a social network for Fedora contributors. One place to go to keep up with everything across the project in ways that aren’t currently possible.

Possible tasks to hack on :

I started hacking on hubs beginning with a very small bug that Ralph had assigned, bug#46 that needed work in the “Community Rules” widget. I worked on the jinja2 template : PR#48, to link the users’ usernames to their hub-pages.
Next, I was assigned bug#49, where the ‘updates ready for stable’ widget needed work, where I needed to extract the name, version and release of the packages that were ready for the release from the bodhi url. Well, PR#51 fixes it ! pythonic ! 🙂
Screenshot from 2015-12-08 19-23-41
Bug#53 was a tricky one because it had an untamed list to deal with 😉 hehe
Learnt about Base Conglomerator, that was some cool thing ! The list_to_series() function would naturally process the list consisting of hubs that the user is subscribed to and returns a string – Subscribed to : <A>, <B>, and 5 others. The task to link them to their respective hub pages before being processed into a string, kinda needed a bit of tweaking to do ! Nevertheless, PR#54 fixes it. 🙂

Incase, you have plans to hack on it, the latest Source-Code is not on Github but on pagure.
HACKING : Like I said, the README is pretty clear.
Happy Hacking 🙂
There is a Prototype ready too.
The designs are really amazing, found these links on the fedora-outreachy wiki page itself :
mockup, design and for more 😉

The Outreachy results were supposed to be announced on the 17th of November 7pm UTC, a very cliche result night 😉
12.30am IST, these nights can get really intense,
Felt really awesome to see “You were accepted for the program” !
Fedora-Outreachy

But, yet again … !! :/
Catch up the rest of the story in my next Blog-Post !! 🙂