Skip to content

Instantly share code, notes, and snippets.

@rossbruniges
Forked from jbuck/MoFactor Apps.md
Last active December 11, 2015 11:28
Show Gist options
  • Save rossbruniges/4593426 to your computer and use it in GitHub Desktop.
Save rossbruniges/4593426 to your computer and use it in GitHub Desktop.
A couple of additions on the awesome doc initiated by @jbuck

The Mo-Factor App

In the spirit of Twelve-Factor Apps, this is a list of concrete things that you can do to make your software better. Some of it overlaps with Twelve-Factor Apps, but it's all good.

Uses git/Github

All of our apps will use git and Github for hosting repositories. This gives us a great collaboration and code review tool, an issue tracker, a wiki, and free static web hosting. All MoFactor apps should be owned by the Mozilla organzation

Unless we absolutely need to, everything with do on Github should be completely open and transparent. Examples of things that might need to be private include:

  • Security bugs (file these on Bugzilla)
  • Application configuration
  • Service credentials

Has a README

The README.md should answer common questions like:

  • What does your software do? Is it an application? A library?
  • Links through to important sections of the wiki. Like installation instructions
  • How do I contribute code? Link to contributors file
  • Where is the community around this software? List IRC channels, mailing lists, issue trackers, code repositories, etc.

Has a github wiki

The wiki should contain more complex instructions/documents that would otherwise clog up the README. WIKI's feel very 'MoFactor' to me and being a bit more fluid seem a better place for this kind if info.

  • How do I install and run your software? What are the prerequisites? What operating systems does it run on?
  • How do I change the configuration of your software? What is the API for your software? Provide examples, as well as a reference. For larger software packages, you may need to move this documentation somewhere else. If do you, then link to it from here.

Has a contributors document

Github will add a banner to the new pull request page when you add a file named "CONTRIBUTING" or "CONTRIBUTING.md" to your repository:

Pull request banner

This contributors document should be the canonical place for answers to:

  • What are some ways I can contribute?
  • Where can I file bugs? What makes a good bug report?
  • What do I need to do to contribute code? What will make my pull request immediately mergeable?
  • What is the code review process?
  • What sort of organizational schema is used for Github Issues? What labels are used, and what do they mean? How are milestones handled?

Rather than dictate a process that every MoFo project will follow, every MoFo project has a contribution process that exists in the contributors document.

Has a license

Every project must have a license assigned to it, and the copyright for the project assigned to the Mozilla Foundation. If you're not sure what license you should be using, default to the Mozilla Public License v2.0. Other licenses that we currently use are:

If a MoFo project is using any other license, it is strongly suggested to switch to the MPL v2.0 if possible.

Has a list of contributors

It's important to have a list of contributors to your project for two reasons:

  1. You need a list of people to contact if you need to change your license
  2. It's good to recognize people for their code contributions

Just put each contributors name and email in a CONTRIBUTORS document. Also humans.txt?

Has an IRC notification bot

Github has a built-in service hook for IRC that sends a message to a channel of your choice when:

  • Commits are pushed to a repo
  • A pull request is opened
  • Branches are created or deleted
  • Builds break?

It's a great way to keep an eye on repository activity throughout the day.

Has continuous integration

Continuous integration can be used to automate tools such as:

  • Linting
  • Unit tests
  • Style checking
  • Builds

Travis CI is free, integrates with any language, and integrates status directly into each pull request. There is absolutely no reason to not use Travis CI.

Has a Procfile

A Procfile in the root of the repository enables deployment to Heroku. Any developer can run a application on Heroku for free, and the Foundation can use it for dev/staging/production environments.

Has a git mirror

In the event that Github goes down, it's always nice to have a backup so you can keep working. Fortunately, Mozilla already provides one for us: http://gitmirror.mozilla.org/. Mirror setup instructions are located at https://intranet.mozilla.org/Git.

TODO

  • There has been no mention of tagging. But do we really need tags? A commit hash is unique, and if we want to get to the point where anyone can deploy, not tagging is one hurdle that wouldn't need to be crossed
    • Date tagging vs semver tagging
  • How do we do deployments?
    • Should Heroku on prod be the gold standard we aim for?
    • How do we deal with Heroku going down, can we do back-up deployments on Labs infrastructure?
    • Packaging apps into .deb/.rpm?
  • We should mention security reviews in here somewhere

Anything missing?

Fork this document! Improve it!

I thought a standard set of tags would be beneficial in allowing ease of browsing of our issues by contributors. I did a bit of analysis, a bit of thinking and came up with these as a starting point for discussion - https://mofowebdev.etherpad.mozilla.org/github-webmaker-tags

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