Kodi Community Forum

Full Version: GSOC 2018 - Add-on Submissions Project
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Summary
Creating a user-approachable add-on submission website for people interested in contributing to Kodi in any way, using Python and Flask. The other technologies used throughout the project include PyGithub and Bootstrap. 

How will I achieve this?
Essentially, we will be building a simple website with a Flask backend that works to submit add-ons easily. I propose using PyGithub for handling the Github side of this project, and using Bootstrap along with other core web-development essentials to deal with the UI/UX of the project. 

Altogether, my suggested way of going about this project would be something like this: 

Backend: The backend of the project will be handled using Python and Flask. Here Flask will deal with page management, submission requests, and also user-management if required. I feel like the most important component of this aspect would be security of the author’s profile.

PyGithub: dealing with Github is fairly simple using PyGithub. Essentially it comes down to simple user authentication and pull requests for the user. Another important aspect of the project will be selecting the relevant repo from the list of repos for the specific addon. All of this can be done with PyGithub. 

Corrections and Checking: 
We could do this server side or client side, both have their own strengths and weaknesses : 
Server side - This would basically allow us to run any linting tool we want on the code the user has submitted, as well as any additional code check scripts written in Python (such as the existing add-on checker). Of course this means users would have to upload their files through the tool before receiving any feedback. We could also make this a customizable “checker pipeline” where new scripts could be added in easily. 
Client side - The feedback in this case would most likely be not as rich, as there just aren’t that many existing linters written in Javascript that we could utilize. So we’d have to write our own linter (a very complex thing to do!) or stick to simple sanity checks such as the ones in the current add-on checker. 

Submission: Once the checks are completed and the code is declared clean, we are ready to submit. Again, this is handled by PyGithub, and a log of the same will be maintained (obviously) and updates and status of the pull request can also be displayed on another page. A nice feature to have would be for code to submitted either using a zip file, or directly pulling from the link to a git repo that the developer has been using to develop his addon (also done using PyGithub). On submission, a direct GitHub link to the PR will also be provided, so that more experienced devs / reviewers can directly work with the PR if they do not want to use the tool. 
 
Overall UI: The central idea here is to create an abstraction on top of GitHub to make it easier for new users to submit addons. So this should be like a central source for all things associated with the submission process, right from creating a new branch for uploaded code, to displaying review comments, to possibly even displaying continuous integration results, and finally selecting the branch to submit code into. And most importantly, all of this in a UI that won’t scare potential contributors away. 

What will the project focus on?
This project focuses completely and only on a better way to have add-on submissions for Kodi contributors and authors. Here, there are many important aspects to properly consider.

Cleaner submissions: Running checks on submitted code server side will allow us to setup a pipeline of tests to run against all submitted code, which should improve the quality of submissions before a human has to ever look at them. 
Approachable UI/UX: The reason for this project very deeply lies in the need for a more user-friendly experience for add-on contributors. So, it obviously becomes important to have an approachable, fast and efficient user experience. This can be managed using Bootstrap and some solid Javascript and CSS.
Stable and Trustworthy submissions: Another important aspect to consider is that the project should be as stable as actually submitting the add-ons via Github itself. Also, it becomes important to have a properly integrated testing environment. Once the actual required tests are discussed, an essential aspect of the project is to work in this direction. 

Benefits
Potential increase in user submissions due to lowering the bar of entry for new developers to submit their code.
Cleaner new submissions due to improved static code analysis and also clean git practices
Centralized dashboard for all things associated with submitting an add-on.


Goals

Create a user-friendly website that can prove to be easier to submit add-ons through than the currently followed system.
Provide assurance to authors of security and clear profile management.
Test and correct the submitted code on the client-side to prevent messy PRs.

Future goals (stuff I’d love to work on if there’s time left over in summer, or at a later date if there isn’t)
Integrate a simple IRC onto this site, and auto-login anyone who logs into this tool into the Kodi dev channel, thereby streamlining the process of communicating with reviewers. 

What does it touch in Kodi?
This project is a completely new development whose primary purpose is to improve the development tools ecosystem for new devs, and therefore it does not directly interact with any of Kodi’s core components. Instead, the focus is on understanding and sticking to the community’s version control practices closely, and potentially re-using existing code-checking scripts in order to do static code analysis. 

Requirements
This project requires a few common technologies. These are:
Experience with web development using Python.
Experience with Bootstrap for user interface design.
PyGithub and understanding of how it deals with interactions with github and user management. 
Understanding the community’s accepted add-on submission workflow. 
Understanding the most important sanity checks to be deployed on submissions before they are submitted.
Integrating a linting tool with our pipeline so as to run static code analysis.