Star a project on pagure

This feature was marked as “wishful” and it was supposed to be a low priority but i implemented it out of frustration. This should be there in the next feature release.

Star feature is already there on github and gitlab. I use this feature on github a lot. If I like an open source project, i star it. You also have a list of all the projects which you have starred which can be helpful if you have come across a project sometime ago and had starred it and you want to know more about it (given that you don’t exactly remember the name, otherwise you can just search). Also, if the project author/maintainer is anything like me, he would love to see the star count rising.

For sometime now, i had been asking people who use pagure often (and hopefully like pagure) to star it on github. The star count of pagure was 96 at the time i started my work on star project feature. Last year, at this time, it was in late 60s.

If you star a project on github, your followers come to know that you have liked a project. They can see that on their github homepage. If they see the project, like it, you already have helped pagure reach more people with almost zero effort. I can’t see one good reason if you like a project that you won’t star it.

Pagure doesn’t have the follow feature and i am not sure it will have in near future. This means the star project won’t have it’s full effect. But, one can star a project, there is a star count, there is a list of people who have starred, there is a list of starred projects of a user.

Here is how you can use this feature:

  1. Log in to pagure and go to a project’s home page.
  2. There is a star button, just beside the fork button. It has a star count just beside it.
  3. Star it if you like the project.

Screenshot from 2017-09-05 00-28-45

Here is where you will find your starred projects:

  1. Log in to pagure.
  2. The drop down on the top right corner will be “My Stars”

Screenshot from 2017-09-05 00-43-16

Here is where you can see who all have starred a particular projects:

  1. Right beside the star button on repo page, we have a star count which actually links to a page which lists all the users who have starred the project.

Screenshot from 2017-09-05 00-42-01

 

Advertisements

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.