Navigation Menu

Skip to content

vipulgupta2048/SugarPort

Repository files navigation

                          ____                         ____            _   
                         / ___| _   _  __ _  __ _ _ __|  _ \ ___  _ __| |_ 
                         \___ \| | | |/ _` |/ _` | '__| |_) / _ \| '__| __|
                          ___) | |_| | (_| | (_| | |  |  __/ (_) | |  | |_ 
                         |____/ \__,_|\__, |\__,_|_|  |_|   \___/|_|   \__|
                                      |___/                                

HitCount Open Source Love PyPI - Python Version License: GPL v3

All source code related to the project that was used and made for Google Summer of Code 2018 under Sugar Labs is housed here. Project Details - GSoC Official Website | Blogs - Mixster --> GSoC#2018 | Progress Tracker and meeting MoM's - Sugar Tracker

Update: Click here to find list of all activities fixed and PR's made.

Introduction

SugarPort started out as WikiPort before I was retasked to work on a similar project with a different aim of setting up the new Activity Server for Sugar Labs called ASLOv3. This repository will work as a holdout until the project is ready for all the scripts and code that would be written for its deployment and maintenance.

Sugar Labs is a community-run software project whose mission is to produce, distribute, and support the use of Sugar, an open source desktop environment and learning platform. Sugar Labs is a member of the Software Freedom Conservancy, an umbrella organization for free software (FLOSS) projects. Sugar is widely used by children from under-developed countries, as a medium to learn new things from and improve their skills.

Sugar Labs also participates in Google Code-in, Google Summer of Code which serves as an outlet for young programmers.

(Edited from Wikipedia)

Aim

The aim of the project is to fix metadata of programs called as activities that run on the Linux-based distro, Sugar, and other related platforms to facilitate the development and deployment of the new activity server, ASLOv3.

Extended work, also includes the deployment of the activity server. Hence the work for the same will be done parallelly.

Work Done

  • To properly deploy ASLOv3, the activity metadata is fixed in activity repositories hosted on Github under the organization, SugarLabs. With correct metadata, accurate information can be displayed on the web portal. (statistics - There are about 161+ identified activities present. Out of them, only 84 are working)

  • Hence, to automate analyzes and fixing of metadata, Python scripts were created that work as a Repo-Analyzer online and offline separately to facilitate the fixing of scripts.

  • Online_checker.py uses PyGitHub and GitHub APIv3 to parse data through ConfigParser finding parameters that are missing and storing the clean output in a separate file for future reference. This method is the online way of doing things. A bit slow as GitHub induces a delay in API calls hence creating a bottleneck that is not feasible for our project. Hence, I had to find a way around it.

  • offline_license.py - Clones repositories and runs multiple checks and processes on user-defined parameters on the activity. These are very flexible and easy to maintain. After analysis gets completed, activities are fixed with their metadata updated as necessary.

The offline checker makes it easier and more efficient to fix activity metadata with least manual work involved. The changes are either pushed manually or automatically (Alpha phase) to the fork that was created of the upstream GitHub repo to create a pull request and suggest changes in the codebase. The repo-caller function has been tested with over 50 activities at once.

For a detailed methodology behind the scripts, refer here.

Testing (for Ubuntu 16.04 or above)

  • Fork and clone this repository
git clone [Forked repository URL]
  • Create and activate a virtual environment preferably through Python3
python3 -m virtualenv env
source env/bin/activate
  • Install the requirements listed in the requirements.txt file
pip install -r requirements.txt

From here both analysis scripts can be used, further instructions as follows.

Online Script (GitHub APIv3 + PyGitHub)

  • A GitHub API access token would be needed for authentication, hence refer to this tutorial to generate a personal token.
  • Open the online_checker.py and enter the token where listed.
  • Run the script using the command.
python3 -u online_checker.py | tee output.txt
  • It takes time to execute completely. After execution, output.txt is generated containing the result of the analysis.

Offline Script (ConfigParser + OS + Subprocess)

  • Run the script using the command.
python3 -u offline_checker.py | tee output.txt
  • Enter your GitHub username when prompted. (example - vipulgupta2048)
  • Enter one or more repository names that you have forked from Sugar Labs when prompted (Press enter to stop adding to the list)
  • Every repository listed which is forked under the username provided will be cloned.
  • Fix the errors and anomalies listed, get the changes committed and pushed to your fork. When ready, press either r to run the tests again or y to make a pull request.
  • When the list is exhausted, and the script has finished execution output.txt is generated containing the result of the analysis.

License

The source code is under GPLv3 or later

About

All source code made for Google Summer of Code 2018 under Sugar Labs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages