PyCon 2016

I come from a place  where everyone worships competitive coding and thus cpp, so the experience of attending my first pycon was much awaited for me.

This year’s PyCon India happened in Delhi and i along with a couple of my friends reached on 23rd September, the first day. We were a bit late but it was all right because, we didn’t miss anything.

Day 1

We had workshops and devsprints on the first day. I, along with Farhaan, were taking a devsprint for Pagure project. It was nice to see a couple of new contributors whom i meet on IRC asking for help and trying to make a contribution. It went all day long but i did manage to roam around a little.

Sayan came to the spot where we were sitting for devsprint with a camera in hand. I don’t know if he was hired as an official photographer for PyCon or not but if he wasn’t i am sure he must have clicked more photographs than all the rest of people combined.

I am not a sort of person who meets a lot of people. I, generally, feel awkward meeting new people and it’s not easy for me to get comfortable with anyone. With Farhaan and especially Sayan, this wasn’t the case. They made me comfortable in our first encounter. In fact, the most shocking thing about PyCon was simplicity of the people. I expected them to be nice but they were better. ūüôā

I then attended Pycharm workshop. Sayan was sitting in the first row and i and Farhaan joined him there. This workshop turned out to be really funny because we were comparing how we did things in Vim to the corresponding method in Pycharm. Pycharm does make things a little easier but moving the hand to mouse/touchpad for every little thing is too much to ask. We came to know that Sayan uses arrow keys instead of h/j/k/l in Vim (and he told me not to judge him for this :-p).

At the end of day one, I, my friend Saptak(saptaks), Farhaan, Sayan and Subhendu (subho or Ghost-Script) decided to visit Ambience Mall which was nearby, for some food. We ended up at KFC where we spend some time and  got to know each other better. Sayan told us about his academic history and  Hackerearth. We also talked about his experience of flock this year. After this, Sayan told me that i was a completely different person than i thought i would be :-p .

Day 2

It was a busy day for everyone. There were a lot of interesting talks. I managed to get a ticket to PyCon for one of my friend who sat¬† all day, the day before in the hotel room. At the end of the last day, i had joined the volunteers group since, most of the dgplug members were in the volunteers group and i didn’t want to miss anything. So, i was basically moving around during the talks doing small things. I couldn’t really concentrate on any particular talk except talk whose title read: ‘Helix and Salt: Case study in high volume and distributed python applications’, given by a linkedin guy named Akhil Malik and i didn’t understand much. At the end of the talk, Saptak asked me if i wanted to have a cold drink to which i replied: “I will need a harder drink than that.”. I didn’t realize Kushal was sitting just a row behind me and could easily have listened to this conversation.

At the end of second day, all the volunteers were supposed to have dinner together and i was supposed to meet a close friend of mine who lives in Delhi. Thankfully, I managed to do both but, i missed the starters :/ . The four of us from last night were joined by Farhaan and since, me and Farhaan both were present, the talk naturally shifted to our GSoC experiences. Sayan told me about writing blogs more often and he did have some valid points.

cttei5euaaawhj4-jpglarge

Day 3

¬†It was the last day and somehow i was feeling a little low because… i didn’t want it to end. I wasn’t interested in talks anymore. But, i did attend the lightening talks and was roaming rest of the time. There was a dgplug “staircase” meeting which i attended. Kushal was leading the talk and he was surrounded by about 30 people, most of whom hadn’t started their FOSS journey. He talked mainly about how they should start with something small and they will get better. It is a really nice initiative, i personally feel.

I had met Kushal last night at dinner and he said he had something to give to me and Farhaan. Just before the lightening talk, i was sitting in the second row and he came to me and stood by my side. He told me to be seated and gave me dgplug sticker and a set of stickers of fedora. This was a nice moment for me. Earlier that day, he had mentioned me and Farhaan for our contributions to pagure in his talk. In the small period of time that i have seen or been with Kushal, he has managed to earn a lot of respect from me.

At the end of this day, everybody had to leave so, the four people from first day and one other friend of mine, decided to visit the same mall once again, for food and roaming around. The Cab driver that we booked turned out to be very patriotic and got offended by my comment that we didn’t study at JNU (where the event was held) and we were “foreigners”. He kept talking about me being a foreigner the whole ride, no matter how many times i said i didn’t mean it. Obviously, everyone enjoyed it.

At the mall, there were no juniors or seniors. There were just 5 (single) computer science guys: being mean, pulling each other’s legs and talking about stuff i shouldn’t mention here. It turned out that Sayan and Subhendu got to know a few of my negative points as well. Sayan also managed to ask Saptak, me and Shubham (my other friend) to start contributing to fedora hubs.

Overall, it was a great experience meeting people whom i talk to on IRC. I won’t be able to mention all the people whom i have met during the event but it doesn’t matter. The important thing is that i enjoyed a lot and i am able to connect with them better.

GSoC Wrap Up

GSoC 2016 finished last week and i am writing this blog to list the work done by me in last three months for Fedora. My project was to adjust pagure and write script(s) so that we can have pkgs.fedoraproject.org on a pagure instance. We have it in staging currently http://pkgs.stg.fedoraproject.org/pagure/

https://pagure.io/pagure/pull-request/1007

https://pagure.io/pagure/pull-request/1035

https://pagure.io/pagure/pull-request/1036

https://pagure.io/pagure/pull-request/1045

https://pagure.io/pagure/pull-request/1050

https://pagure.io/pagure/pull-request/1058

https://pagure.io/pagure/pull-request/1071

https://pagure.io/pagure/pull-request/1094

https://pagure.io/pagure/pull-request/1095

https://pagure.io/pagure/pull-request/1097

https://pagure.io/pagure/pull-request/1114

https://pagure.io/pagure/pull-request/1120

https://pagure.io/pagure/pull-request/1149

https://pagure.io/pagure/pull-request/1150

https://pagure.io/pagure/pull-request/1151

https://pagure.io/pagure/pull-request/1157

https://pagure.io/pagure/pull-request/1177

https://pagure.io/pagure/pull-request/1210

https://pagure.io/pagure/pull-request/1211

https://pagure.io/pagure/pull-request/1219

https://pagure.io/pagure/pull-request/1218

https://pagure.io/pagure/pull-request/1158

Besides these, there is a script for getting user acls from pkgdb:

https://infrastructure.fedoraproject.org/cgit/ansible.git/commit/?id=de67bcbea22bb4539e32d195a10448948bc6d765

For me, the experience has been perfect. I like the work environment at #fedora-apps. My mentor, Pierre-Yves Chibon is nice to everyone and i hope i haven’t annoyed or disappointed him in last 3 months. It’s hard to find a person who can guide so patiently. I am saying this not because i see one of my friend working for FOSS Asia but, because he is genuinely good.

If GSoC wasn’t there, even then i would have spent my last 3 months in the same way (without mine and my father’s new mobile phone). I contribute here because i like the work environment that they have created and i get to learn new things while working on real life projects.

So, thanks Google for the money and Fedora for such an awesome experience.

User’s project watch list on pagure

Not long ago, Gaurav added watch feature on pagure. But, It had one thing missing from it: a user could not see what all projects he/she is watching. So, with pull request #1158, i tried to solve that problem.

For those of you are not aware of this feature, a user can now subscribe for emails for development of a project. He/She will receive emails for any changes on the issue tracker or if anything happens in any pull request. By default, the admin of a project is watching the project. However, if he wishes, he can unwatch it and he won’t receive emails for that project anymore. This can help in situations when the user is admin of a lot of projects and is no longer interested in some of them.

I won’t go in details of how this was implemented since, it involves simple function calls and minor addition in the UI (plus, there is a link to the PR). I will, however, attach screenshot of how it will look, when it will be live on¬†pagure.io.

Screenshot from 2016-08-16 17-03-29

pkgs.fedoraproject.org on a pagure instance

pkgs.fedoraproject.org currently has more than 18k git repositories and it’s relying on cgit which is not capable of git collaboration. On the other hand, we have pagure which is a git collaboration tool and it’s live on pagure.io.¬†As part of my Google Summer of Code project, i was supposed to prepare script and adjust pagure so that we can have pkgs.fp.org on a pagure instance.

For those who are not familiar with pagure, it’s a free and open source git collaboration tool written on top of pygit2 by¬†pingou. It has a similar workflow as¬†Github¬†. One can fork a project, make changes and ask to merge the changes to the main project by creating a pull request.¬†pagure.io¬†already has more than 250 projects hosted on it and it’s increasing everyday. Feel free to play with pagure on¬†stg.pagure.io.

The idea is, we will make pkgs.fedoraproject.org a pagure instance. With this change, it will be easier for anybody to contribute to any of the git rpms hosted on pkgs.fp.org . This is the major reason for the shift. Currently, only the rpm maintainers can make changes to the repository. But, once we have these rpms on a pagure instance, anybody with a FAS account can fork the project and make a pull request.

Here are a few points which makes pagure adaptable for pkgs.fp.org :

  • Turn on/off user management: Since, the acls for the git repositories come from pkgdb, user management should be turned off on the instance level.
  • Turn on/off Issue Tracker: The git rpms are not exactly projects, so it’s turned off at the instance level as well.
  • Turn on/off project creation: The git rpms need approval for creation of a project, thus a user shouldn’t be able to create a project.
  • Pseudo namespace: Pagure doesn’t have namespaces for a project (although, forks have). Thus, pseudo namespace was introduced. We can have a list of namespaces allowed for an instance.

Honestly speaking, almost all the above mentioned work was already done. After this, we just needed to adjust the script which currently gets acls from pkgdb so that it updates pagure database as well.

The work is almost complete and the shift should not take long once pingou returns from his vacation.

For any further query, you can ping me on #fedora-apps (nick: vivek_)

Happy coding,

Vivek

Access levels of user/group in a pagure project

Currently in pagure, we have only two access levels in a project Рeither you have no access or admin access. There have been a few discussions of more levels of access Р#892,  #792

With the new changes, there will be four different levels of access –

  • None: As the name suggests, no special power. Just a normal user.
  • Ticket: Edit the metadata of issues which includes tagging, assigning and changing the status of the issue. They can’t¬†delete or edit the issue itself.
  • Commit: All the access an admin of the project has except access to settings of the project.
  • Admin: He is the boss of the project.

As you can see, the levels are hierarchical in nature. The committers have all the access a user with ticket access has and similarly, the admin has all the access a committer has plus, some other accesses.

Ticket access is sort of “entry” level access to the project. They can play with the metadata of the issue and that’s it. The committers can merge/close a pull request, can commit to the project repository directly, edit/remove issues/comments. Basically, they can do anything in the project but touch the settings. Since, the admins are the only ones with access to settings, they are the only ones who can add/remove a user/group from a project or update their accesses.

In pagure, groups are dealt in a similar way as a user is. So, they too can have all the mentioned access levels. If you provide a group with some access in a project, all the users in the group will automatically get that access. In cases when a user already has some access “a”, and is also present in a group with some other access “b”, he gets greater level of access out of “a” and “b”.

Implementation (in short)

We already have admin access level in pagure so adding two more levels wasn’t a big deal. It has been implemented in a similar way. Here are few of the points:

  • Introduction of a new table: access_levels in the pagure db and foreign keys of the same in user_projects and projects_groups tables.
  • project.users¬†now returns the list of users with at least ticket access , earlier it returned the list of users with admin access. Similar is the case with project.groups . Similar relations: project.admins, project.committers, project.admin_groups, project.committer_groups.
  • Two functions:¬†is_repo_committer¬† and¬†is_repo_user¬† to check for the rights of the user on the project.¬†is_repo_admin was already there.
  • Update code to allow RW+ right for committers in¬†gitolite¬†file.
  • Changes in the conditional statements across the pagure code.

Pull request related to this is¬†here. Tests and docs haven’t been updated yet.

My Story till now

As the title suggests,¬†it won’t be anything technical. This is a one time post, others won’t be like this. Also, before i get started i want to mention that i have a foggy brain and i am someone¬†who is not excellent at any mode of communication. If you don’t like what i have written, then “please try to understand that i haven’t written this for you”.polite(), i have written this because i wanted to. But, suggestions (and compliments ūüėõ ) are always welcome.

Before College:

I had zero programming experience before joining my college. I had computer at my home since 2004 but, the most i used it was for finding the best college that would suit me after the Entrance Exam results. I had used google, ¬†knew what facebook was, but didn’t know how it worked. The reasons behind this was that i always lived in hostels where any electronic items weren’t allowed and i was just too much involved in cricket. I have always been a hard worker. I stood second in my class throughout class 8th to 10th and also was involved in cricket as much as any body else there, if not more. I was always part of Panipat U-14 and U-17 in the those three years. Panipat is the city where my school was. I am not going to talk about the two years after my tenth class. Those were the worst years till now for me as well as my family.

First Year of College:

As i have already made it clear, if there was the team of newbies in computer science, i would still be among the worst players. So, it was a steep learning curve for me. If you love competitive coding, there is probably no place in India which is better than my college. The ranking of students as well as institute ranking across different coding platforms is a proof of that. So, the standard of coding among my classmates was too damn high, relative to me. Few of them have already been coding in java for 5 years! Others have done in c++ for 2 years. Still there were a lot of people like me who were new to coding. My problem was not only i didn’t know any programming language, i didn’t like the whole idea of working on a code and submitting to an online judge and repeating the same each day. Finally, i decided competitive coding is not for me. Productivity wise, the only thing i learnt was basics of my first programming language ‘C’.

The second semester was a lot of fun mainly because, i got to play cricket with leather ball again after about 3 years. Even though i wasn’t playing at my best, i was good enough to be in my college team. Our college team went to Gwalior for Inter college tournament and we were runners up. The big thing that gave me a lot of confidence was the tournament we played after returning to college.

It was an intra college tournament, played between different batches. In my batch, i was the only one who had some experience in playing cricket with leather balls. One other guy did play the tournament in gwalior but that was his only experience. Naturally, i was chosen captain. I literally trained my teammates in every department of the game. Also, had to wake them up every morning for practice sessions. Being the youngest in college and the fact that only two players made to college team, our team was considered the weakest. That made my job a bit harder. I used to tell them to just give their 100% and we can challenge anyone in the college. It wasn’t just for motivation, part of me felt it after playing for the college team.

But, it became clear after the first two games, that we *can* be good. We chased down the highest total and defended the least total in those two games. I won’t deny the fact that we had a bit of help from the opponents in the first game and a bit of luck but we were good in the last moments of the game. The second game however, we met a disaster in the first innings. We scored just 69 runs in 12 overs. It was the lowest total in the tournament and every winning score was above 100 including a 172. There was a live commentary going on just beside the sitting area for audience and you could listen them making fun of us. I, for the second consecutive time didn’t score any runs and i was supposed to be the best batsman in the team. Naturally, i was angry with myself. I could see in the body language of my team members that they believed it’s over. So, i asked them the same thing i did during the practice sessions: “Just give your 100%” and i made them see the situation from a different angle: “We just have to ball better than them. If they can restrict us on 69, if we ball better than them, we can stop them before that score”. Our balling was spot on. Team mates followed everything what i said before and during the game even then, the game was still in their favor until the last 4 overs of whose 2 were to be balled by me and 2 by another guy. The other guy had got some thrashing in our first game but we didn’t have a choice. As it turned out, we both delivered our best performances and we won the game by 3 runs. My balling spell was economically and wicket wise the best but, it was the other guy, Shikhar, who defended 7 runs in the last over. I got myself badly injured in the second game while fielding. I had dived on the athletics track which had no grass at all and was very rough combined with pebbles. There were blood coming out from both the elbows, both of my ankles and bruises at multiple places on the body. I couldn’t afford a substitute fielder because i had to ball and it was the last stages of the game.

I could hardly move myself in the morning.The next day was supposed to be the last day of the tournament so, i had no time to recover. So, I just took some painkillers and went to play. The team we were up against were the best team in college, without a doubt. They had a solid batting line up and even a better balling lineup. I knew we had to score more than we did in the last game and against a much better balling lineup. ¬†Obviously, it was high time that my batting clicked. It did. And the opponent didn’t see that one coming ^ ^. With a similar balling performance as the last game, we won the game quite easily. The confidence of our team after that game was very high and after defeating the best, we believed we can win the tournament. We did. Everybody’s performances clicked and with a perfect team effort, we won the final with ease as well.

For others, it was a just a fun tournament. For me, it was a lot more than just fun and i feel after the horror of 2 years in 11 and 12th grade, i needed such an event. I was able to express myself and it was after a long time that i did.

The other good thing that happened in the second semester was Mozcafe. I came across the terms FOSS and GSoC in that event. It was organized by our seniors:¬†¬†Aditya Chaturvedi, Rahul Ranjan, Charul Agarwal and Jatin Mehta along with a few volunteers. Shahid Farooqui from mozilla was the chief guest of the event. I didn’t understand a lot in that event, but i did come across those terms and came to know that these seniors also didn’t like competitive coding as well. This was the first batch of IIITA which got involved in FOSS and later on they also got a place in GSoC. I also came to know that Python was their preferred language. So, i learned the basics of python after that event, but i didn’t implement it.

Second Year:

After doing a course in Cisco Networking during the summer, i got a chance to be a part of Student Networking Team of the college. Most of the 3rd semester passed in getting better at networking itself, because they teach networking course in 5th semester here. Later on, another good thing happened to me. Aditya sir wanted two juniors for a project “opinator” and my friend was in good touch with him. So, he took me along with him. It was my first experience in working on any project, and i learned a lot from it. It is the project due to which i learned python well. I got introduced to git, github, used Scrapy which is an open source software, got introduced to flask. During the project, i realized that i liked the idea of making projects and it is far far better than just submitting the code to an online judge.

Third Year:

With the benefits that i got from working on opinator project, from the beginning of third year, i had one thing in my mind: i will get more involved in FOSS. As it turned out, i started contributing to Fedora. So far, i learned a lot from it, i still am. It has been an awesome journey so far. The people there are really nice and helping. I also got involved in freelancing a bit. This one really helps in case you want to spend some money and you don’t want your parents to know about it. ūüėÄ

Two days ago, i got selected for GSoC 2016 and i can’t thank fedora people enough for that, especially, pingou. Even though i am very happy to be selected for GSoC, i don’t want to think this as a final outcome of my efforts in open source but as a beginning of something better. ūüôā

Happy coding,

Vivek