Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Commit

Permalink
Merge branch 'release/v0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jwhitlock committed Oct 13, 2014
2 parents 50a5210 + d96ac67 commit f7cfc01
Show file tree
Hide file tree
Showing 46 changed files with 3,427 additions and 774 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -8,5 +8,5 @@ python:
- "2.6"

install: pip install -r requirements.txt coveralls
script: python manage.py test --with-coverage
script: python manage.py test --with-coverage --cover-package=webplatformcompat,drf_cached_reads
after_success: coveralls
66 changes: 63 additions & 3 deletions CONTRIBUTING.rst
Expand Up @@ -2,17 +2,77 @@
Contributing
============

Contributions should follow the `MDN Contribution Guidelines`_:

* You agree to license your contributions under `MPL 2`_
* Discuss large changes on the `dev-mdn mailing list`_ or on a `bugzilla bug`_
before coding.
* Python code style should follow `PEP8 standards`_ whenever possible.
* Write tests! The Django site has `good testing docs`_, and
`Django REST framework`_ has some `additonal testing docs`_.
* All commit messages must start with "bug NNNNNNN" or "fix bug NNNNNNN"
* Reason: Make it easy for someone to consume the commit log and reach
originating requests for all changes
* Exceptions: "Merge" and "Revert" commits
* Notes:
* "fix bug NNNNNNN" - will trigger a github bot to automatically mark
bug as "RESOLVED:FIXED"
* If a pull request has multiple commits, we should squash commits
together or re-word commit messages so that each commit message
contains a bug number
* MDN module `owner or peer`_ must review and merge all pull requests.
* Reason: Owner and peers are and accountable for the quality of MDN code
changes
* Exceptions: Owners/peers may commit directly to master for critical
security/down-time fixes; they must file a bug for follow-up review.
* MDN reviewers must verify sufficient test coverage on all changes - either by new or existing tests.
* Reason: Automated tests reduce human error involved in reviews
* Notes: The Django site has `good testing docs`_, and
`Django REST framework`_ has some `additonal testing docs`_.

.. _`MDN Contribution Guidelines`: https://github.com/mozilla/kuma/blob/master/CONTRIBUTING.md
.. _`MPL 2`: http://www.mozilla.org/MPL/2.0/
.. _`dev-mdn mailing list`: https://lists.mozilla.org/listinfo/dev-mdn
.. _`bugzilla bug`: http://mzl.la/mdn_backlog
.. _`bugzilla bug`: https://bugzilla.mozilla.org/show_bug.cgi?id=989448
.. _`PEP8 standards`: http://www.python.org/dev/peps/pep-0008/
.. _`owner or peer`: https://wiki.mozilla.org/Modules/All#MDN
.. _`good testing docs`: https://docs.djangoproject.com/en/dev/topics/testing/
.. _`Django REST framework`: http://www.django-rest-framework.org
.. _`additonal testing docs`: http://www.django-rest-framework.org/api-guide/testing

What to work on
---------------
There is a `tracking bug`_ for this project, and a `specific bug`_ for the data
store, the primary purpose of this project. The dependant bugs represent
areas of work, and are not exhaustive. If you want to contribute at this phase
in development, take a look at the bugs and linked documents, to familiarize
yourself with the project, and then get in touch with the team on IRC (#mdndev
on irc.mozilla.org) to carve out a piece of the project.

.. _`tracking bug`: https://bugzilla.mozilla.org/showdependencytree.cgi?id=989448&hide_resolved=1
.. _`specific bug`: https://bugzilla.mozilla.org/showdependencytree.cgi?id=996570&hide_resolved=1

GitHub workflow
---------------
1. `Get your environment setup`_
2. Set up mozilla remote
(``$ git remote add mozilla git://github.com/mozilla/web-platform-compat.git``)
3. Create a branch for a bug
(``$ git checkout -b new-issue-888888``)
4. Develop on bug branch.

`Time passes, the mozilla/web-platform-compat repository accumulates new commits`
5. Commit changes to bug branch
(``$ git add . ; git commit -m 'fix bug 888888 - commit message'``)
6. Fetch mozilla
(``$ git fetch mozilla``)
7. Update local master
(``$ git checkout master; git pull mozilla master``)

`Repeat steps 4-7 till dev is complete`

8. Rebase issue branch
(``$ git checkout new-issue-888888; git rebase master``)
9. Push branch to GitHub
(``$ git push origin new-issue-888888``)
10. Issue pull request (Click Pull Request button)

.. _`Get your environment setup`: installation.html
1 change: 1 addition & 0 deletions HISTORY.rst
Expand Up @@ -10,6 +10,7 @@ In-progess versions are periodically deployed to Heroku at
http://doesitwork-dev.allizom.org. Here are some of the development
deployments:

* 0.2.0 - 2014-10-13 - Add features, supports, pagination
* 0.1.0d - 2014-09-29 - Add resource-level caching
* 0.1.0c - 2014-09-16 - Add sample feature view, simplify draft API
* 0.1.0b - 2014-09-05 - Add filtering, more JSON API tuning.
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Expand Up @@ -13,7 +13,7 @@ help:

clean: clean-build clean-pyc

qa: lint coverage
qa: lint coverage jslint

qa-all: qa docs sdist test-all

Expand All @@ -33,6 +33,9 @@ lint:
test:
./manage.py test

jslint:
if type jslint >/dev/null 2>&1 ; then jslint webplatformcompat/static/js/*; else echo "jslint not installed"; fi

test-all:
tox

Expand Down
2 changes: 1 addition & 1 deletion docs/draft/issues.rst
Expand Up @@ -51,7 +51,7 @@ These changes are:
- **name** - converted to localized text, or a string if the name is
canonical
- **sections** - replaces spec link
- **ancestors**, **siblings**, **children**, **descendants** - tree relations
- **parent**, **children** - tree relations for this feature
* supports_
- Was `browser-version-features`, but multi-word resources are problematic.
- **support** - Added a value "never", for cases where developers have
Expand Down
38 changes: 0 additions & 38 deletions docs/draft/resources.rst
Expand Up @@ -893,17 +893,9 @@ The **features** representation includes:
changes are ignored.
- **parent** *(one or null)* - The feature one level up, or null
if top-level. Can be changed by user.
- **ancestors** *(many)* - The features that form the path to the top of
the tree, including this one, in bread-crumb order (top to self). Can
not be changed by user - set the **parent** instead.
- **siblings** *(many)* - The features with the same parent, including
including this one, in display order. Can be re-ordered by the user.
- **children** *(many)* - The features that have this feature as parent, in
display order. Can be an empty list, for "leaf" features. Can be
re-ordered by the user.
- **descendants** *(many)* - The features in the local tree for this
feature. including this one, in tree order. Can not be changed by the
user - set the **parent** on the child feature instead.
- **history_current** *(one)* - Current historical_features_. User can
set to a valid **history** to revert to that version.
- **history** *(many)* - Associated historical_features_, in time order
Expand Down Expand Up @@ -941,10 +933,7 @@ A sample response is:
"sections": ["485"],
"supports": ["1125", "1212", "1536"],
"parent": "173",
"ancestors": ["2", "12", "173", "276"],
"siblings": ["275", "276", "277"],
"children": [],
"descendants": ["276"],
"history_current": "456",
"history": ["456"]
}
Expand All @@ -958,22 +947,10 @@ A sample response is:
"href": "https://browsersupports.org/api/v1/features/{feature.parent}",
"type": "features"
},
"features.ancestors": {
"href": "https://browsersupports.org/api/v1/features/{feature.ancestors}",
"type": "features"
},
"features.siblings": {
"href": "https://browsersupports.org/api/v1/features/{feature.siblings}",
"type": "features"
},
"features.children": {
"href": "https://browsersupports.org/api/v1/features/{feature.children}",
"type": "features"
},
"features.descendants": {
"href": "https://browsersupports.org/api/v1/features/{feature.descendants}",
"type": "features"
},
"features.history_current": {
"href": "https://browsersupports.org/api/v1/historical_features/{features.history_current}",
"type": "historical_features"
Expand Down Expand Up @@ -1019,10 +996,7 @@ A sample response is:
"sections": [],
"supports": [],
"parent": ["12"],
"ancestors": ["2", "12", "173"]
"siblings": ["167", "168", "169", "170", "171", "172", "173", "174", "175"],
"children": ["275", "276", "277"],
"descendants": ["173", "275", "276", "277"],
"history_current": "395",
"history": ["395"]
}
Expand All @@ -1036,22 +1010,10 @@ A sample response is:
"href": "https://browsersupports.org/api/v1/features/{feature.parent}",
"type": "features"
},
"features.ancestors": {
"href": "https://browsersupports.org/api/v1/features/{feature.ancestors}",
"type": "features"
},
"features.siblings": {
"href": "https://browsersupports.org/api/v1/features/{feature.siblings}",
"type": "features"
},
"features.children": {
"href": "https://browsersupports.org/api/v1/features/{feature.children}",
"type": "features"
},
"features.descendants": {
"href": "https://browsersupports.org/api/v1/features/{feature.descendants}",
"type": "features"
},
"features.history_current": {
"href": "https://browsersupports.org/api/v1/historical_features/{features.history_current}",
"type": "historical_features"
Expand Down
18 changes: 0 additions & 18 deletions docs/draft/views.rst
Expand Up @@ -46,10 +46,7 @@ A sample response is:
"sections": ["746", "421", "70"],
"supports": [],
"parent": "800",
"ancestors": ["800", "816"],
"siblings": ["814", "815", "816", "817", "818"],
"children": ["191"],
"descendants": ["816", "191"],
"history_current": "216",
"history": ["216"]
}
Expand All @@ -73,10 +70,7 @@ A sample response is:
"358", "359", "360", "361", "362", "363", "364",
"365", "366", "367", "368"],
"parent": "816",
"ancestors": ["800", "816", "191"],
"siblings": ["191"],
"children": [],
"descendants": ["191"],
"history_current": "395",
"history": ["395"]
}
Expand Down Expand Up @@ -728,22 +722,10 @@ A sample response is:
"href": "https://browsersupports.org/api/v1/features/{features.parent}",
"type": "features"
},
"features.ancestors": {
"href": "https://browsersupports.org/api/v1/features/{features.ancestors}",
"type": "features"
},
"features.siblings": {
"href": "https://browsersupports.org/api/v1/features/{features.siblings}",
"type": "features"
},
"features.children": {
"href": "https://browsersupports.org/api/v1/features/{features.children}",
"type": "features"
},
"features.descendants": {
"href": "https://browsersupports.org/api/v1/features/{features.descendants}",
"type": "features"
},
"features.history_current": {
"href": "https://browsersupports.org/api/v1/historical_features/{features.history_current}",
"type": "historical_features"
Expand Down
7 changes: 7 additions & 0 deletions docs/tools.rst
Expand Up @@ -16,6 +16,13 @@ Initialize with compatability data from the webcompat project. Usage::
* ``-v`` `(optional)`: Increase verbosity. Can be added multiple times. At least one is
recommended.

This script requires a fresh database (no compatability data) and a user with
write access. The bulk import will result in cascading cache invalidations,
which can be avoided by running the server without cached instances during the
import::

$ USE_INSTANCE_CACHE=0 ./manage.py runserver


sample_mdn.py
-------------
Expand Down

0 comments on commit f7cfc01

Please sign in to comment.