Kodi Community Forum

Full Version: GSOC 2018 - Interested in Add-On Submissions Project
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone, I’m Vedant Chakravadhanula. I’m from the Indian Institute of Technology, Guwahati currently in my sophomore year of undergraduate study. I’m majoring in Mechanical Engineering with a minor in computer science.
Project Details:
I’m interested in working on the add-on submission website/tool as mentioned on the GSoC ideas list.

Since add - on functionality is such an essential part of Kodi, and seeing as there are so many different kinds of add-ons being written by a bunch of users, an interface for add-on submissions should encourage easy add-on creation and make sure that users can send in better add-ons.

I propose to work on a website for add-on submission, written in Python/Flask for the back-end. A simple user interface will be a major goal of the project, with a straightforward flow to ensure that even users who are less comfortable with Git/Github can easily write add - ons. To interface with Github, I propose to use the PyGithub module which would be suited to our specific needs. In addition to the mentioned technologies, HTML5, CSS and Bootstrap would ensure a good UI. Javascript would of course be a requirement to this project.

Also, the website must give opinions on the current code to try and catch some common errors early on.
Since the project is fairly easy, I propose the following additional feature:
Although the project idea does mention that the interface should offer some opinions on the code, I propose to extend this functionality to something similar to the add-on checker. As mentioned in another idea description, the current add-on checker is fairly straightforward, and does only a few simple checks. I propose that we perform more of the code tests initially before submitting the PR, which will ensure that less user(add-on author) and developer time is spent waiting to make minor adjustments in order to get the PR merged. Among the checks that we run, some errors could automatically be fixed (for example, a linter check) while the unfixable issues would be reported to the author. I would like to discuss the code quality parameters with the mentor(s) before deciding what features would be needed in this tool. Since add - ons are by nature somewhat independent of the rest of the codebase, running tests on the individual add-ons would help catch many of the probable errors beforehand.To summarize the above, my proposal would implement the following flow for the author of an add-on.
  1. The author signs in to github using the interface(securely).
  2. A list of possible repositories from which PRs could be generated are shown, and the user selects the appropriate repo.
  3. The code tests are run, depending on what tests we decide to implement.
  4. If the code is error free, the PR is created.
  5. Otherwise, we suggest the changes to be made to improve the PR.
  6. If a PR is already open, the interface can update the PR if there are changes.

This is only a brief high-level overview of the project, and I would like to get some feedback on the proposed features before going into further detail about the implementation.In the meantime, if the mentors feel there is anything I should be doing in terms of getting familiar with the codebase or the community, I would like to get started with that. I have not contributed to Kodi before, but have worked with open source organisations. I have looked through XMBC’s Github(especially the add-on checker), but since my project is somewhat independent of the rest of the codebase, I’m unable to find anything that would help me familiarise myself with the tech. 

About Myself: 

Tell us about the computer(s) and devices you have available for working on your SoC project? 
I use a MacBook Air 13” running macOS High Sierra, and have access to equally(if not more) powerful Ubuntu machines at my University. 

When did you first start programming?
I've had programming as a school course since 8th grade, but I have really started coding actively over the past 3 years.
I have experience mostly in C/C++ and Python, apart from HTML/CSS/JS/Bootstrap.

Are you a user of Kodi? When did you first start using it?
I’ve been using Kodi since around a year now. 

What do you primarily use Kodi for?
Kodi helps keep my entertainment and media in one place. So essentially, I use it for music and TV. 

Have you contributed to other Open Source projects? If so, which projects and can we see some of your code?
I have started contributing to the open source over the past 6 to 8 months. Most of my open source contributions are towards Mozilla, where I worked on a bunch of bugs in the Engineering Productivity team (Automated Testing). Over around 6 months that I contributed to the team, my major work included porting the Mozbase(a system of packages for automated testing) from Python 2 to 3 with backward compatibility. Thus, I have acquired a lot of experience as to how open source organizations work, especially with respect to version control(Mercurial and Git) and code quality and standards). (Bugzilla Profile)Apart from that, I have contributed to a few open source orgs on Github(including SymPy, Coala, and Mozilla). (Github Profile)

If you have not contributed to open source projects, do you have other code we can look at? 
What sorts of programming projects have you done on your own time? 
I have worked on a website for my universities Model United Nations module (IITGMUN) which is on Github, here.
I worked on this website with one other student.
In addition, I was solely responsible for making a small web application for the MUN conference, which was built using Python and Flask(relevant to the GSoC project!).
(App repo)In addition to these, I have also worked on a chatbot for the Microsoft Code.Fun.Do hackathon, which was once again written in python/flask using Api.ai for the AI interface. The code is on my repository, here.
I have also worked on another simple chatbot for jokes, facts and quotes(here)

How much time do you have available, and how would you plan to use it?
I have no other commitments throughout the summer as of the moment. Since I am a student and my university breaks for the summer (May 5th to July 26th) most of my time will be spent in this project.I intend to dedicate 6-7 hours every day to the project.

Do you plan to have a job or study during the summer in conjunction with Summer of Code?
No, I do not intend to work or study during the summer.
Welcome, nice to have you here Smile

What I would like to do is basically just use the addon-checker to run the check and just report that to the user. So we can update the checker indipendently.
Most of the work should be on how the workflow after submitting the initial request is.
Especially UX wise, what happens when we review, how do you display those reviews and how do authors get back, how do they update their code in a nice way. Preferably without us looing comment history.

It might also be enought to just do the submit part and an update part and let the commit workflow being handled by github.
Thanks for the feedback!

Okay, so basically we want most of the focus being on the workflow and status of the PR after it's created. 
I feel like that would be kind of a small project to do over three months...
In any case, should I start to think about how the UX should be for the entire process? Any suggestions you have regarding that would be nice.

Thanks again!
Well there are always some other nice to haves, we could extend this with.
Having this as a basis is just a start Smile
Hey @Razze, I think it would be better to have a Github PR type code review screen
Because git manipulations and possible addon checks are time-consuming, you will surely need a Celery-based async task runner.
Hi, from the UX perspective that you elaborated upon, what I see is that Github already provides such functionality on the pull requests and about the code checker, one can easily integrate the repository with Travis etc. I'm not completely sure as to what are the requirements that are different from the current existing solution provided by Github itself. Am I missing something here?
Main thing it lowering the bar to submit an addon. Just from a technical pov.

At the moment you will have to do the following things right:
1. Choose the right repo (repo-plugin, repo-script...)
2. Choose the right branch for your addon (is it already in one of the branches, it it a breaking change and only supports newer versions)
3. Only change the files in your addons folder.
4. If your PR, needs changes, change the git branch and squash the commit.

Those are quiet scary for newcomers, as there are so much to read/know about. To even get to the point to send a PR on github, which you also might not have any experience with.
So If I got this right, a very crude and basic idea of the app is as follows:
The web app (or standalone) aids in the submission of add-ons to the correct repo and ensures all the version dependencies(only versions greater than the current ones used by Kodi) are satisfied along with a few checks before automatically generating a PR. Along with this, before a PR is generated, it can have a discussion forum sort of structure (details can be worked upon) where the contributors can comment upon the code. Once the code is approved, a PR with the author's name can be generated in the appropriate repo of Kodi. This will ensure ease of process-handling for those who are not used to Kodi's regular codebase and will save them from the tedious task of generating a pull request manually.

If there's any other point/perspective I'm missing, please clarify since I would love to work on this project and have already started preparing my proposal for the same (will share on this forum for reviews as soon as it is ready).
Yep thats basically it, but always think from the submitters perspective. The idea is to make it easier without them having to load up special clients or repositories.

The way I did it on my 3rd party repository was to analyse a zip upload with server side PHP and extract all the basic elements into a mysql database. From there you can copy the files somewhere else, moderate it, approve, reject, categorize and all sorts. Actually getting it onto GitHub could be the last step.

There are many ways to achieve this of course Wink