Skip to content

Instantly share code, notes, and snippets.

@ffledgling
Last active July 9, 2017 10:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ffledgling/71dc7bef3708546915f2 to your computer and use it in GitHub Desktop.
Save ffledgling/71dc7bef3708546915f2 to your computer and use it in GitHub Desktop.
How to Start contributing to Funsize/Senbonzakura

Funsize contributor's guide

What is Funsize?

Funsize (erstwhile Senbonzakura) is a Release Engineering project to improve the automation for the Update generation process for it's products. Read more about the internals on the project page for Funsize.

Etymology

The original working title for this project was 'Senbonzakura', which is roughly Japanese for 'Thousand Cherry Trees'. As you can imagine pronouncing and spelling 'Senbonzakura' is hard, thus began the search for a new name. As you will soon come to see, Funsize deals with a file format called MAR (Mozilla ARchive). What do you have when you have multiple MAR files? MARS! Funsize's job is to partly reduce the size of updates (Which are basically MAR files). I thought naming it 'mars-mini' would be clever. But we have a lot of people who also know the same delicious choclate by the name 'mars-funsize' Thus we decided to christen it 'Funsize'!

How Do I Start Hacking?

Congratulations and thank you for considering contributing to this project! To start hacking on this project there are a couple of things you need to do.

Prerequisites

You'll need a few things installed on your machine before you can start making changes to code.

  1. Python (2.7+)
  2. Git
  3. virtualenv
  4. RabbitMQ
  5. SQLite (This may change to MySQL in the future)

If you also wish to hack on the deployment bits, you will also need to install docker. For how to install docker, see the Installation section for your relevant OS at https://docs.docker.com/

If you already have these installed or know of a better way to install these than what is going to be described below, feel free to use your method of choice.

Common ways to install things on your machine:

For OSX:

brew install python git rabbitmq # installs pip automatically
pip install virtualenv

For Fedora:

sudo yum install python python-virtualenv rabbitmq-server sqlite

For Ubuntu:

Caveat: The following are a best guess based on http://packages.ubuntu.com, but have not been tested.

sudo apt-get install python python-virtualenv rabbitmq-server sqlite

For Windows:

Developing on Windows is generally a bad idea, unless you have special reason to do so.
This application has neither been tested, deployed or developed on Windows and is therefore not guaranteed to run on Windows.

Getting the code

The code resides in two locations at the moment:

Although Senbonzakura might be a couple of commits ahead at any point in time but build-funsize is the canonical repository and when in doubt, that's the one that should always be used. Unless ofcourse you know better.

TL;DR

virtualenv Funsize; cd $_; . bin/activate; git clone https://github.com/mozilla/build-funsize src;

Detailed Explanation

Typically Python applications are developed in isolated working environments called virtual environments or venvs . We will be setting one up for the development of our project as well.

The steps are as follows:

  1. Create a virtual environment for our application.
    virtualenv Funsize
  2. Enter the directory and activate the environment, this means we source another file into our shell env. . is a short-cut for the source command in bash.
    cd Funsize; . bin/activate
  3. Clone the repository from Funsize
    git clone https://github.com/mozilla/build-funsize src

Running the application

After you've got the application. Let's make sure everything works by generating a proper partial MAR file.

TL;DR

  • ./startup.sh
  • tail -f /usr/local/var/log/celeryworker.log (In a new tab/terminal/pane)
  • tests/curl-test.sh trigger-release
  • tests/curl-test.sh get release

Detailed Explanation

Running the tests

TL;DR

Detailed Explanation

TODO:

  • Running unit-tests.
  • Running end-to-end generation test.
  • Applying the update to firefox after generation.

Typical Workflow

TODO:

  • Correctly setting up your git.conf (username etc. etc.)
  • Git branches, new branch for new feature/bug# generate patch from master, rebaseing, merging, link to a good intro to git.

Before you do anything else, create a new branch for the feature/bug you're working on before touching any other code.

Finding an existing Bug to work on

If you're looking for an existing bug to work on you can find one in any of the following places:

Once you've found a bug you like, leave a comment on the bug expressing your interest. If the bug has a mentor mentioned you should log into IRC and contact the mentor. Even if the bug is not mentored, you're encouraged to drop by #releng and ask if someone can show you the ropes.

Note: If you're new and/or inexperienced look for a good first bug or a mentored bug. If you find none, ask in IRC and someone will be more than happy to give you something to work on. (Ask and Ye Shall Receive!)

Filling a Bug

If you've found a bug, please file a one and alert the people in #releng! All bugs for Mozilla related projects are filed in Bugzilla All bugs to be filed under:

Product: Release Engineering
Component: Tools

Important things to mention while filing a bug:

  • What platform are you on?
  • What steps did you take before you noticed the bug?
  • Can you reproduce it? If so, mention the steps to reproduce the bug.
  • Any other details that you think might be useful to someone who's trying to debug the problem!

Note: You will need a valid Bugzilla account to file a bug.

Submitting a Patch

  • Create patch using git format-patch
  • Attach a patch to the relevant bug on Bugzilla (if there isn't one, file one!).
  • Leave a comment asking for feedback (set the f? flag) and enter the mentor's name/irc nick/email if there is no mentor for you bug, simply ask in IRC if someone would be willing to look at your patch and give you feedback. More often than not you'll find multiple people willing to do so.
  • Improve/Update your patch based on the feedback and attach the new patch to the bug, asking for a review(set the r? flag for review).
    Note: Don't forget to mark the old attachment as obsolete
  • What else should go in here?

TODO: Expand this to be more detailed.

@aaayushsingh
Copy link

aaayushsingh commented Jul 8, 2017

error in line

Browse Bugzilla, or use this [readymade query](https://bugzilla.mozilla.org/buglist.cgi?quicksearch=funsize STATUS%3ANEW)

needs to be changed to

Browse Bugzilla, or use this readymade query

add "%20" instead of space

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment