Skip to content

Commit

Permalink
Merge pull request #558 from karlcow/436/1
Browse files Browse the repository at this point in the history
#436 436/1 Preliminary pull request for reorganizing the labels
  • Loading branch information
Mike Taylor committed Feb 13, 2015
2 parents fac670a + e8b3cb7 commit 5ff0793
Show file tree
Hide file tree
Showing 8 changed files with 226 additions and 136 deletions.
122 changes: 1 addition & 121 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,127 +181,7 @@ We do not use frameworks. However we use libraries, such suitcss-components-grid
## Working Environment setup
For testing code locally, you will need a very basic setup. There are a few requirements. These instructions have been made for working with Linux and MacOSX. If you install it successfully on Windows, we will appreciate a pull request on this documentation.
* Python 2.7
* node 0.10.0
* Github account with a fake repo
### Simple setup
#### Initializing Project source code
We use [Grunt](http://gruntjs.com/) as a task runner to perform certain things (minify + concat JS assets, for example). You need to have [Node.js](http://nodejs.org/download/) installed to be able to run Grunt.
``` bash
# clone the repo
git clone https://github.com/<username>/webcompat.com.git #replace your github username
# change to directory
cd webcompat.com
# initializing project
[sudo] make install
```
**Note**: if you got an error message, you may need to [install pip](#installing-pip) before running `make install` again.
### Detailed setup
#### Installing pip
We use `pip` to install other Python packages. You may need to install `pip` if you haven't do so for another project or Python development.
To determine if you need to, type the following command into the terminal:
```bash
type pip
```
If you see something like `pip is /usr/bin/pip`, you can proceed to install `virtualenv` (or go back and use `make install`). The exact path will likely be different.
If you see something like `-bash: type: pip: not found`, you will need to install `pip` like so:
```bash
sudo easy_install pip
```
(If `easy_install` isn't installed, you'll need to [install setuptools](https://pypi.python.org/pypi/setuptools#unix-wget).)
#### Installing virtualenv
``` bash
# Install pip (if not already installed)
# Install virtualenv
[sudo] pip install virtualenv
```
#### Installing Project source code
``` bash
# clone the repo
git clone git@github.com:username/webcompat.com.git
# change to directory
cd webcompat.com
# set up virtual environment
[sudo] virtualenv env
source env/bin/activate
# install dependencies
pip install -r requirements.txt
```
#### Installing Grunt
We use [Grunt](http://gruntjs.com/) as a task runner to perform certain things (minify + concat JS assets, for example). You need to have [Node.js](http://nodejs.org/download/) installed to be able to run Grunt. Once that's done, use `npm` to install the grunt dependencies. Version 0.10.0 or above is required.
First install the `grunt-cli` tool:
``` bash
[sudo] npm install -g grunt-cli
[sudo] npm install
grunt
```
### Configuring The Server
To test issue submission, you need to create a fake repo on github. Let's assume your username is `miketaylr`. Create a new repository called `nobody-look-at-this` (or the name of your choice).
``` bash
# set up config.py, filling in appropriate secrets and pointers to repos
cp config.py.example config.py
```
You can now edit `config.py` and
1. provide pointers to [repo issues URIs](https://github.com/webcompat/webcompat.com/blob/master/config.py.example#L68-L73). `ISSUES_REPO_URI = "<user>/<repo>/issues"`. With the example, we chose it would be `ISSUES_REPO_URI = "miketaylr/nobody-look-at-this/issues"`
2. It is **mandatory** to create your own personal bot for local development. The [instructions for creating a bot token](http://help.github.com/articles/creating-an-access-token-for-command-line-use) are given on GitHub. Once you created the token you can add it to the variable `BOT_OAUTH_TOKEN = ""`. This is the oauth token we use to report issues on behalf of people who don't want to give GitHub oauth access (or don't have GitHub accounts).
3. [get the secrets](https://github.com/webcompat/webcompat.com/blob/master/config.py.example#L46-L66) for config.py
**Note**: If you get a 404 at GitHub when clicking "Login", it means you haven't [filled in the `GITHUB_CLIENT_ID` or `GITHUB_CLIENT_SECRET`](https://github.com/webcompat/webcompat.com/blob/master/config.py.example#L47-L49).
![Auth 404](https://i.cloudup.com/8FDA5bVc7l.png)
### Starting The Server
``` bash
# start local server
python run.py
```
or
``` bash
# start local server
make start
```
You should now have a local instance of the site running at `http://localhost:5000/`. Please [file bugs](https://github.com/webcompat/webcompat.com/issues/new) if something went wrong!
### Building Project
You can build the entire project (CSS and JavaScript files and optimize images) by executing this command:
``` bash
make build
```
See docs/installation.rst
## Coding
Expand Down
File renamed without changes.
7 changes: 6 additions & 1 deletion docs/source/index.rst → docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ If you feel intimidated by the project, do not forget to check for `good first p
Contents:

.. toctree::
:maxdepth: 2
:maxdepth: 3

installation
contributing
api/intro
tools
history


Indices and tables
Expand Down
200 changes: 200 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
============
Installation
============

To install your own instance of Webcompat.com, you will need a couple of environment setup. These steps will lead you through installing the project for your own usage on your private computer.

Working Environment setup
-------------------------

For testing code locally, you will need a very basic setup. There are a
few requirements. These instructions have been made for working with
Linux and MacOSX. If you install it successfully on Windows, we will
appreciate a pull request on this documentation.

- Python 2.7
- node 0.10.0
- Github account with a fake repo

Simple setup
~~~~~~~~~~~~

Initializing Project source code
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

We use `Grunt`_ as a task runner to perform certain things (minify +
concat JS assets, for example). You need to have `Node.js`_ installed to
be able to run Grunt.

.. code:: bash
# clone the repo
git clone https://github.com/<username>/webcompat.com.git #replace your github username
# change to directory
cd webcompat.com
# initializing project
[sudo] make install
**Note**: if you got an error message, you may need to `install pip`_
before running ``make install`` again.

Detailed setup
~~~~~~~~~~~~~~

Installing pip
^^^^^^^^^^^^^^

We use ``pip`` to install other Python packages. You may need to install
``pip`` if you haven’t do so for another project or Python development.

To determine if you need to, type the following command into the
terminal:

.. code:: bash
type pip
If you see something like ``pip is /usr/bin/pip``, you can proceed to
install ``virtualenv`` (or go back and use ``make install``). The exact
path will likely be different.

If you see something like ``-bash: type: pip: not found``, you will need
to install ``pip`` like so:

.. code:: bash
sudo easy_install pip
(If ``easy_install`` isn’t installed, you’ll need to `install
setuptools`_.)

Installing virtualenv
^^^^^^^^^^^^^^^^^^^^^

.. code:: bash
# Install pip (if not already installed)
# Install virtualenv
[sudo] pip install virtualenv
Installing Project source code
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: bash
# clone the repo
git clone git@github.com:username/webcompat.com.git
# change to directory
cd webcompat.com
# set up virtual environment
[sudo] virtualenv env
source env/bin/activate
# install dependencies
pip install -r requirements.txt
Installing Grunt
^^^^^^^^^^^^^^^^

We use `Grunt`_ as a task runner to perform certain things (minify +
concat JS assets, for example). You need to have `Node.js`_ installed to
be able to run Grunt. Once that’s done, use ``npm`` to install the grunt
dependencies. Version 0.10.0 or above is required.

First install the ``grunt-cli`` tool:

.. code:: bash
[sudo] npm install -g grunt-cli
[sudo] npm install
grunt
Configuring The Server
~~~~~~~~~~~~~~~~~~~~~~

To test issue submission, you need to create a fake repo on github.
Let’s assume your username is ``miketaylr``. Create a new repository
called ``nobody-look-at-this`` (or the name of your choice).

.. code:: bash
# set up config.py, filling in appropriate secrets and pointers to repos
cp config.py.example config.py
You can now edit ``config.py`` and

1. provide pointers to `repo issues URIs`_.
``ISSUES_REPO_URI = "<user>/<repo>/issues"``. With the example, we
chose it would be
``ISSUES_REPO_URI = "miketaylr/nobody-look-at-this/issues"``
2. It is **mandatory** to create your own personal bot for local
development. The `instructions for creating a bot token`_ are given
on GitHub. Once you created the token you can add it to the variable
``BOT_OAUTH_TOKEN = ""``. This is the oauth token we use to report
issues on behalf of people who don’t want to give GitHub oauth access
(or don’t have GitHub accounts).
3. `get the secrets`_ for config.py

**Note**: If you get a 404 at GitHub when clicking “Login”, it means you
haven’t `filled in the ``GITHUB_CLIENT_ID`` or
``GITHUB_CLIENT_SECRET```_.
.. figure:: https://i.cloudup.com/8FDA5bVc7l.png
:alt: Auth 404
Auth 404
Configuring The Test Repo Labels
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The user interface of WebCompat is currently highly dependent of the labelling system in the github repo. It means you need to have the right set of labels. At this stage we create them by hand (we should `probably create a script`_ for initializing a repo on github with the right labels). The main labels to create are:
- ``status-needsdiagnosis``
- ``status-needscontact ``
- ``status-contactready``
- ``status-sitewait``
- ``status-closed-duplicate``
- ``status-closed-fixed``
- ``status-closed-invalid``

There are a couple of additional labels with ``browser-`` and ``os-``.


Starting The Server
~~~~~~~~~~~~~~~~~~~

.. code:: bash
# start local server
python run.py
or

.. code:: bash
# start local server
make start
You should now have a local instance of the site running at
``http://localhost:5000/``. Please `file bugs`_ if something went wrong!

Building Project
~~~~~~~~~~~~~~~~

You can build the entire project (CSS and JavaScript files and optimize
images) by executing this command:

.. code:: bash
make build
.. _Grunt: http://gruntjs.com/
.. _Node.js: http://nodejs.org/download/
.. _repo issues URIs: https://github.com/webcompat/webcompat.com/blob/master/config.py.example#L68-L73
.. _instructions for creating a bot token: http://help.github.com/articles/creating-an-access-token-for-command-line-use
.. _get the secrets: https://github.com/webcompat/webcompat.com/blob/master/config.py.example#L46-L66
.. _filled in the ``GITHUB_CLIENT_ID`` or ``GITHUB_CLIENT_SECRET``: https://github.com/webcompat/webcompat.com/blob/master/config.py.example#L47-L49
.. _file bugs: https://github.com/webcompat/webcompat.com/issues/new
.. _install pip: #installing-pip
.. _install setuptools: https://pypi.python.org/pypi/setuptools#unix-wget
.. _probably create a script: https://github.com/webcompat/webcompat.com/issues/557
8 changes: 4 additions & 4 deletions tests/test_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,16 @@ def test_issues_new(self):
{u'labels': [],
u'title': u"fake bug 1",
u'id': 1},
{u'labels': [{u'name': u'contactready'}],
{u'labels': [{u'name': u'status-contactready'}],
u'title': u"fake bug 2",
u'id': 2},
{u'labels': [{u'name': u'needsdiagnosis'}],
{u'labels': [{u'name': u'status-needsdiagnosis'}],
u'title': u"fake bug 3",
u'id': 3},
{u'labels': [{u'name': u'needscontact'}],
{u'labels': [{u'name': u'status-needscontact'}],
u'title': u"fake bug 4",
u'id': 4},
{u'labels': [{u'name': u'sitewait'}],
{u'labels': [{u'name': u'status-sitewait'}],
u'title': u"fake bug 5",
u'id': 5}]
result = '[{"labels": [{"name": "bug"}, {"name": "help wanted"}], "id": 0, "title": "fake bug 0"}, {"labels": [], "id": 1, "title": "fake bug 1"}]'
Expand Down
Loading

0 comments on commit 5ff0793

Please sign in to comment.