]> git.ipfire.org Git - thirdparty/patchwork.git/log
thirdparty/patchwork.git
9 years agoui: Update page titles
Stephen Finucane [Tue, 29 Mar 2016 15:38:49 +0000 (16:38 +0100)] 
ui: Update page titles

Since the page title is displayed in the navbar, they must be limited
length and contain little to no special formatting. Do this.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoui: Cleanup the navbar "brand"
Stephen Finucane [Tue, 29 Mar 2016 16:10:20 +0000 (17:10 +0100)] 
ui: Cleanup the navbar "brand"

The text shown in the top-left corner of a navbar, known as the "brand"
in Bootstrap parlance, normally brings you to the homepage. However,
when viewing patches or details about a project this name of this
project is included in this link. This gave some users the idea that
clicking this button would return them to the project patch list
instead. To resolve this confusion, break the project name and any
other non-Patchwork title out of this clickable link. A new
"navbar-subnav" style is introduced to do this, seeing as Bootstrap
does not appear to support something like this natively.

Once this is done, this also allows for the removal of the "All
Projects" button, which both duplicates this functionality and did
nothing when there was only one project available on an instance.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoui: Center-align the checkboxes
Stephen Finucane [Tue, 29 Mar 2016 12:46:54 +0000 (13:46 +0100)] 
ui: Center-align the checkboxes

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoui: Higher density of patches
Stephen Finucane [Tue, 29 Mar 2016 12:37:00 +0000 (13:37 +0100)] 
ui: Higher density of patches

THe Bootstrap'ification of Patchwork signficantly reduced the
information density of the patch list page, but this results in less
patches per page. Resolve this by reducing the padding on each row.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agosettings: Help caching with content-aware static file names
Damien Lespiau [Thu, 4 Feb 2016 13:56:51 +0000 (13:56 +0000)] 
settings: Help caching with content-aware static file names

If we always serve the "style.css" file, even when its content changes,
we run into the situation where the browser (or any HTTP aware middle
man) will cache the file and not download a newer version.

This can be solved by appending the file hash to its filename. If the
content changes, the file name changes and the new version is used right
away. We can also use far future Expires headers with such static files,
they will really never change.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
---
v2: Disable for Django < 1.7

9 years agotools: Use 'Patchwork' consistently
Stephen Finucane [Fri, 25 Mar 2016 21:31:56 +0000 (21:31 +0000)] 
tools: Use 'Patchwork' consistently

The docs referred to both 'patchwork' and 'Patchwork'. Use the title
case variant consistently.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agodocs: Refer to 'Patchwork' consistently
Stephen Finucane [Fri, 25 Mar 2016 21:30:50 +0000 (21:30 +0000)] 
docs: Refer to 'Patchwork' consistently

The docs referred to both 'patchwork' and 'Patchwork'. Use the title
case variant consistently.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agotemplates: Use 'Patchwork' consistently
Stephen Finucane [Fri, 25 Mar 2016 21:29:41 +0000 (21:29 +0000)] 
templates: Use 'Patchwork' consistently

The templates referred to both 'patchwork' and 'Patchwork'. Use the
title case variant consistently.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agomodels: Add missing unicode decorator
Stephen Finucane [Fri, 25 Mar 2016 15:56:35 +0000 (15:56 +0000)] 
models: Add missing unicode decorator

This is required for Python 3 compatibility.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoREADME: Correct some typos
Stephen Finucane [Fri, 25 Mar 2016 21:08:49 +0000 (21:08 +0000)] 
README: Correct some typos

- The two presentation links were backwards
- The quickstart section's code blocks weren't indented correctly

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agotemplates: Move comments to above patch
Jeremy Kerr [Tue, 29 Mar 2016 01:29:12 +0000 (09:29 +0800)] 
templates: Move comments to above patch

It's much more likely that existing comments will affect the user's
actions, rather than the patch content itself, so put the comments
first.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoparsemail: Fix return value for find_content error case
Jeremy Kerr [Mon, 28 Mar 2016 03:31:38 +0000 (11:31 +0800)] 
parsemail: Fix return value for find_content error case

If we fail to decode a message payload, we'll fail with the following:

  Traceback (most recent call last):
    File "./patchwork/bin/parsemail.py", line 563, in <module>
      sys.exit(main(sys.argv))
    File "./patchwork/bin/parsemail.py", line 553, in main
      return parse_mail(mail, args['list_id'])
    File "./patchwork/bin/parsemail.py", line 464, in parse_mail
      (patch, comment, filenames) = find_content(project, mail)
  ValueError: need more than 2 values to unpack

- as the error condition for find_content only returns a 2-tuple. This
change fixes the error case to the 3-tuple return type.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agotemplates: don't emit tags for empty URLs, allow both web_url & webscm_url
Jeremy Kerr [Sun, 27 Mar 2016 04:53:06 +0000 (12:53 +0800)] 
templates: don't emit tags for empty URLs, allow both web_url & webscm_url

Rather than always outputting one of web_url or webscm_url, only output
when these are present. This prevents us from emitting empty links if
both are missing.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoUpdate permissions on grant-all scripts
Jeremy Kerr [Sun, 27 Mar 2016 04:53:05 +0000 (12:53 +0800)] 
Update permissions on grant-all scripts

We need access to Check & Delegationrule.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoparsemail: Fix default value of verbosity argument
Jeremy Kerr [Sun, 27 Mar 2016 04:53:04 +0000 (12:53 +0800)] 
parsemail: Fix default value of verbosity argument

With the current parsemail.py, the default value for the verbosity
argument does not exist in the VERBOSITY_LEVELS dict, so we get:

  Traceback (most recent call last):
    File "./patchwork/bin/parsemail.py", line 569, in <module>
      sys.exit(main(sys.argv))
    File "./patchwork/bin/parsemail.py", line 555, in main
      logging.basicConfig(level=VERBOSITY_LEVELS[args['verbosity']])
  KeyError: 20

This change uses an actual key instead.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoparsemail.sh: Always return a zero exit status
Jeremy Kerr [Sun, 27 Mar 2016 04:53:03 +0000 (12:53 +0800)] 
parsemail.sh: Always return a zero exit status

This reverts changes to parsemail.sh introduced by
cbe992d84fba57831d44afb3a21cdf83454018b2.

When parsemail is used as a delivery command from a mail server like
postfix (as it is intended to be), a non-zero exit code will cause a
bounce message to be returned to the user. From the postfix manual:

  When  the  command  fails, a limited amount of command output is
  mailed back to the  sender.   The  file  /usr/include/sysexits.h
  defines  the expected exit status codes.

For cases where patchwork is unavailable, we absolutely do not want to
start bouncing messages to all patch contributors.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agopep8: Remove errant imports
Stephen Finucane [Fri, 25 Mar 2016 14:18:26 +0000 (14:18 +0000)] 
pep8: Remove errant imports

These were introduced in the recent Django 1.9 changes.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agorequirements: Use any supported Django version
Stephen Finucane [Fri, 25 Mar 2016 13:47:16 +0000 (13:47 +0000)] 
requirements: Use any supported Django version

Patchwork now supports Django 1.9. It continues to support Django 1.8,
1.7 and 1.6, though the latter two are not supported upstream and are
therefore not recommended. Update development requirements to reflect
this.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Reviewed-by: Andy Doan <andy.doan@linaro.org>
9 years agoRemove 'requestcontext'
Stephen Finucane [Mon, 21 Mar 2016 17:45:17 +0000 (17:45 +0000)] 
Remove 'requestcontext'

This is no longer needed.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Tested-by: Andy Doan <andy.doan@linaro.org>
9 years agoutils: Make use of 'compat'
Stephen Finucane [Thu, 24 Mar 2016 11:55:56 +0000 (11:55 +0000)] 
utils: Make use of 'compat'

Even though it's not necessary, it's more consistent to use the wrapped
'render_to_string' provided by 'compat' everywhere.

In addition, remove a context parameter that's unused in the called
template.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Tested-by: Andy Doan <andy.doan@linaro.org>
9 years agoviews: Use messages framework in 'generic_list'
Stephen Finucane [Mon, 21 Mar 2016 17:30:16 +0000 (17:30 +0000)] 
views: Use messages framework in 'generic_list'

Finalise the use of the messages framework by using it in the
aforementioned function. This allows for removal of messages-related
code from the 'PatchworkRequestContext' dictionary.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Tested-by: Andy Doan <andy.doan@linaro.org>
9 years agoviews: Use messages framework in 'patch'
Stephen Finucane [Mon, 21 Mar 2016 16:31:11 +0000 (16:31 +0000)] 
views: Use messages framework in 'patch'

Django provides the messages framework as part of the core library.
This framework allows for "toast"-style notifications to the user,
for things like post-form processing notifcations. At the moment
patchwork provides this functionality using custom code. However, this
code is not well tested and, like any code, incurs some degree of
maintenance overhead. It would be easier to use the "batteries" that
Django provides so begin doing just that.

This change only covers one of two places in which this custom
messages framework is currently used. By extension, it also covers one
of the two places in which 'render_to_response' is still used. This
"other place" will be addressed in a follow-up commit.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Tested-by: Andy Doan <andy.doan@linaro.org>
9 years agosettings: Enable the 'message' application
Stephen Finucane [Mon, 21 Mar 2016 16:09:35 +0000 (16:09 +0000)] 
settings: Enable the 'message' application

Most of the configuration is already done: only the application itself
needs to be enabled.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Tested-by: Andy Doan <andy.doan@linaro.org>
9 years agoviews: Use context dictionaries in '__init__'
Stephen Finucane [Mon, 21 Mar 2016 17:37:42 +0000 (17:37 +0000)] 
views: Use context dictionaries in '__init__'

Remove the use of PatchworkRequestContext in one function of this view
as it is not required and causes a 'RemovedInDjango110Warning' warning.
This requires the use of 'render', rather than 'render_to_response'.

The remaining use of this context option will be addressed in a
follow-up patch.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Tested-by: Andy Doan <andy.doan@linaro.org>
9 years agoviews: Use context dictionaries in 'bundle'
Stephen Finucane [Mon, 21 Mar 2016 13:54:56 +0000 (13:54 +0000)] 
views: Use context dictionaries in 'bundle'

Remove the use of PatchworkRequestContext in this view as it is not
required and causes a 'RemovedInDjango110Warning' warning. This
requires the use of 'render', rather than 'render_to_response'.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Tested-by: Andy Doan <andy.doan@linaro.org>
9 years agoviews: Use context dictionaries in 'mail'
Stephen Finucane [Mon, 21 Mar 2016 13:30:20 +0000 (13:30 +0000)] 
views: Use context dictionaries in 'mail'

Remove the use of PatchworkRequestContext in this view as it is not
required and causes a 'RemovedInDjango110Warning' warning. This
requires the use of 'render', rather than 'render_to_response'. It
also requires adding a 'request' parameter to 'render_to_string' calls
so that the default context processors continue to be passed through.

This removes a context variable that was not used.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Tested-by: Andy Doan <andy.doan@linaro.org>
9 years agoviews: Use context dictionaries in 'user'
Stephen Finucane [Wed, 16 Mar 2016 16:00:18 +0000 (16:00 +0000)] 
views: Use context dictionaries in 'user'

Remove the use of PatchworkRequestContext in this view as it is not
required and causes a 'RemovedInDjango110Warning' warning. This
requires the use of 'render', rather than 'render_to_response'. It
also requires adding a 'request' parameter to 'render_to_string' calls
so that the default context processors continue to be passed through.

This includes a typo fix for another template.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Tested-by: Andy Doan <andy.doan@linaro.org>
9 years agoviews: Use context dictionaries in 'pwclient'
Stephen Finucane [Tue, 15 Mar 2016 22:05:33 +0000 (22:05 +0000)] 
views: Use context dictionaries in 'pwclient'

Remove the use of PatchworkRequestContext in this view as it is not
required and causes a 'RemovedInDjango110Warning' warning. This
requires the use of 'render', rather than a combo of 'response.write'
and 'render_to_string'.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Tested-by: Andy Doan <andy.doan@linaro.org>
9 years agoviews: Use context dictionaries in 'help'
Stephen Finucane [Tue, 15 Mar 2016 22:05:15 +0000 (22:05 +0000)] 
views: Use context dictionaries in 'help'

Remove the use of PatchworkRequestContext in this view as it is not
required and causes a 'RemovedInDjango110Warning' warning. This
requires the use of 'render', rather than 'render_to_response'.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Tested-by: Andy Doan <andy.doan@linaro.org>
9 years agoviews: Use context dictionaries in 'project'
Stephen Finucane [Tue, 15 Mar 2016 21:17:22 +0000 (21:17 +0000)] 
views: Use context dictionaries in 'project'

Remove the use of PatchworkRequestContext in this view as it is not
required and causes a 'RemovedInDjango110Warning' warning. This
requires the use of 'render', rather than 'render_to_response'.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Tested-by: Andy Doan <andy.doan@linaro.org>
9 years agocompat: Wrap 'render_to_string'
Stephen Finucane [Thu, 24 Mar 2016 11:05:45 +0000 (11:05 +0000)] 
compat: Wrap 'render_to_string'

The 'dictionary' and 'context_instance' parameters for the
'render_to_string' function produce 'RemovedInDjango110' warnings
in Django 1.9 and will be removed in Django 1.10. However, these
parameters are still valid for Django < 1.8. Provide a shim to
allow use of the Django>=1.8-style parameters, while retaining
backwards compatibility with Django < 1.8.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Tested-by: Andy Doan <andy.doan@linaro.org>
9 years agocontext: Add 'site' context processor
Stephen Finucane [Mon, 21 Mar 2016 14:07:01 +0000 (14:07 +0000)] 
context: Add 'site' context processor

This allows us to use the current "site" value in all templates without
requiring PatchworkRequestContext. As a custom context processor is
being enabled, the 'TEMPLATE_CONTEXT_PROCESSORS' value must be
specified for versions of Django < 1.8 (it's already specified for
other versions).

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Tested-by: Andy Doan <andy.doan@linaro.org>
9 years agomigrations: Optimize 0007 migration
Andy Doan [Thu, 24 Mar 2016 18:20:43 +0000 (13:20 -0500)] 
migrations: Optimize 0007 migration

By handling comment copying/deletion via SQL we can make migration take
< 3 minutes rather than > 30 minutes for big instances. The SQL used is
vendor specific, but covers the two DBs supported by Patchwork.

Signed-off-by: Andy Doan <andy.doan@linaro.org>
Reviewed-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agosettings: Use explicit setup for the Debug Toolbar
Stephen Finucane [Wed, 23 Mar 2016 18:24:03 +0000 (18:24 +0000)] 
settings: Use explicit setup for the Debug Toolbar

The 'django-debug-toolbar' application provides an automatic method of
configuring the plugin. However, as noted in the documentation [1],
this can cause issues like circular imports. In this case, a
"Table 'patchwork.patchwork_state' doesn't exist" exception was being
raised when attempting to do an initial migration.

Resolve this by using the manual configuration provided in the docs.

[1] https://django-debug-toolbar.readthedocs.org/en/1.4/installation.html

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Closes-bug: #29
---
v2: Don't rely on 'settings.DEBUG', as this is set to False in tests

9 years agosettings: Disable Debug Toolbar for all Django<1.7
Stephen Finucane [Wed, 23 Mar 2016 11:37:35 +0000 (11:37 +0000)] 
settings: Disable Debug Toolbar for all Django<1.7

The django-debug-toolbar project doesn't support Django 1.6, but the
check used to disable this plugin for this version only works for
Django 1.6.0 and less. Enable it for all versions of Django < 1.7.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agotests: Don't override 'settings.DEBUG'
Stephen Finucane [Thu, 24 Mar 2016 15:17:31 +0000 (15:17 +0000)] 
tests: Don't override 'settings.DEBUG'

This isn't used, so remove it.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Closes-bug: #30

9 years agotemplates: Fix regression in reversed URL
Stephen Finucane [Tue, 15 Mar 2016 21:14:39 +0000 (21:14 +0000)] 
templates: Fix regression in reversed URL

'f8cc68d' introduced a regression on the changes made in 'fd3bfaa'.
Namely, Python path-style reversing was used, rather than reverse by
name. Resolve this regression.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoviews: Prefetch 'Patch.check_set'
Stephen Finucane [Tue, 15 Mar 2016 11:39:35 +0000 (11:39 +0000)] 
views: Prefetch 'Patch.check_set'

The checks for each Patch are queried each time patches are listed.
This causes a deluge of queries (around one per patch). Mitigate this
by instead prefetching this related attribute. This reduces the number
of queries for a list of 100 patches from an average of 119 to 20.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Reviewed-by: Andy Doan <andy.doan@linaro.org>
9 years agomodels: Pull common email behavior into mixin
Stephen Finucane [Thu, 15 Oct 2015 23:32:01 +0000 (00:32 +0100)] 
models: Pull common email behavior into mixin

A "Patch" and "Comment" share a common ancestor: emails. As a result
of this many fields are similar between the two. Rather than
duplicating code, pull the similar code out of the aforementioned
classes and into a Mixin.

This has the side effect of removing restrictions on Comment.content,
but this is probably OK: it's possible that someone could send an
empty mail in reply to a patch and we should show that.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Reviewed-by: Andy Doan <andy.doan@linaro.org>
9 years agomodels: Merge patch and first comment
Stephen Finucane [Sat, 6 Feb 2016 20:32:20 +0000 (20:32 +0000)] 
models: Merge patch and first comment

At the moment a patch is split into two model entries: a Patch and a
linked Comment. The original rationale for this was that a Patch is
really a sub-class of Comment. A comment is a record of the text
content of an incoming mail, while a patch is that, plus the patch
content too. Hence the separation and a one-to-one relationship when a
patch is present. However, this decision was made before Django added
support for model inheritance and is no longer necessary. This change
flatten the models in preparation for some email subclassing work. This
is achieved by copying over the non-duplicated fields from the Comment
to the linked Patch, then deleting the Comment.

The migrations are broken into two steps: a schema migration and a data
migration, per the recommendations of the Django documentation [1]. SQL
migration scripts, where necessary, will need to be created manually as
there appears to be no way to do this in a way that is
RDBMS-independant [2][3].

[1] https://docs.djangoproject.com/en/1.9/topics/migrations/#data-migrations
[2] https://stackoverflow.com/q/6856849/
[3] https://stackoverflow.com/q/224732/

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Reviewed-by: Andy Doan <andy.doan@linaro.org>
9 years agotrivial: Add some documentation for 'models'
Stephen Finucane [Thu, 15 Oct 2015 21:29:24 +0000 (22:29 +0100)] 
trivial: Add some documentation for 'models'

This involves shuffling some lines around but nothing requiring a
migration.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Reviewed-by: Andy Doan <andy.doan@linaro.org>
9 years agofields: Simplify HashField
Stephen Finucane [Fri, 11 Mar 2016 18:31:01 +0000 (18:31 +0000)] 
fields: Simplify HashField

The HashField was written to be configurable. It supports customisable
hash types and provides fallbacks for a missing 'hashlib', which was
only introduced in Python 2.5. However, the customisable hash types
are not used anywhere (the actual hashing is hardcoded to use 'sha1')
and Python 2.7/3.3+ are the only versions of Python currently
supported. As a result, it is possible to remove much of the code
without losing any real functionality. Do this.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Reviewed-by: Andy Doan <andy.doan@linaro.org>
9 years agotests: Add sanity test for HashField
Stephen Finucane [Fri, 11 Mar 2016 19:09:58 +0000 (19:09 +0000)] 
tests: Add sanity test for HashField

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Reviewed-by: Andy Doan <andy.doan@linaro.org>
9 years agofields: Move all custom fields to specific file
Stephen Finucane [Fri, 11 Mar 2016 17:21:23 +0000 (17:21 +0000)] 
fields: Move all custom fields to specific file

Keep things modular.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Reviewed-by: Andy Doan <andy.doan@linaro.org>
9 years agojs: Allow shift-select of checkboxes
Stephen Finucane [Mon, 14 Mar 2016 16:11:56 +0000 (16:11 +0000)] 
js: Allow shift-select of checkboxes

Allow bulk modification of patches through shift-select of the check
boxes on each line.

This allows for the removal of the 'common.js' file, which was only
being used in one location.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agorequirements: Loosen testing requirement versions
Stephen Finucane [Tue, 15 Mar 2016 10:57:06 +0000 (10:57 +0000)] 
requirements: Loosen testing requirement versions

There's not really any reason to pin the requirements for dependencies
only used in tests, so don't do it. Replace these specific versions
with broader, major-version checks.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoAdd support for 'django-debug-toolbar'
Stephen Finucane [Fri, 8 Jan 2016 16:14:47 +0000 (16:14 +0000)] 
Add support for 'django-debug-toolbar'

This tool is exceptionally helpful for debugging issues with Django:
install it as part of the 'dev' configuration. This only works on
Django > 1.6, due to a lack of support for older versions in the
upstream.

A note is included to help users avoid the issues seen when running
patchwork on a different machine.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agodocs: Refer to fixtures by name, not path
Stephen Finucane [Sun, 13 Mar 2016 22:38:05 +0000 (22:38 +0000)] 
docs: Refer to fixtures by name, not path

It's not necessary to use paths for fixtures, so update the docs and
Vagrant install scripts to remove these.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoRevert "tox: Cleanup '.pyc' files before run"
Stephen Finucane [Fri, 11 Mar 2016 19:04:28 +0000 (19:04 +0000)] 
Revert "tox: Cleanup '.pyc' files before run"

This reverts commit 8e58c29f23b9cc072c003268d641f00084ce3b3b.

The benefits added by this change did not outweigh the cost it
introduces in test run time.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoparsemail: Correct issue with '--verbosity' flag
Stephen Finucane [Fri, 11 Mar 2016 11:16:46 +0000 (11:16 +0000)] 
parsemail: Correct issue with '--verbosity' flag

Use the log level dictionary _values_, not the user-provided _key_.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Closes-Bug: #21

9 years agopep8: Remove errant line
Stephen Finucane [Thu, 10 Mar 2016 18:02:57 +0000 (18:02 +0000)] 
pep8: Remove errant line

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agotox: Also white list PW_TEST_DB_TYPE
Damien Lespiau [Fri, 4 Mar 2016 09:42:27 +0000 (09:42 +0000)] 
tox: Also white list PW_TEST_DB_TYPE

That's the variable we use to select the database backend.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agosettings: Don't use 'postgre'
Damien Lespiau [Thu, 3 Mar 2016 23:30:38 +0000 (23:30 +0000)] 
settings: Don't use 'postgre'

From:
  https://wiki.postgresql.org/wiki/Postgres#Changing_name_from_PostgreSQL_to_Postgres

"Does not encourage weird derivations such as 'Postgre'"

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agodocs: Release v1.1.0 v1.1.0
Stephen Finucane [Thu, 3 Mar 2016 14:54:29 +0000 (14:54 +0000)] 
docs: Release v1.1.0

This release is now ready. Update the respective references.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agopwclient: Add 'check-info' command
Stephen Finucane [Fri, 26 Feb 2016 19:54:50 +0000 (19:54 +0000)] 
pwclient: Add 'check-info' command

Get information about a given check.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Tested-by: Andy Doan <andy.doan@linaro.org>
9 years agopwclient: Make 'check-list' a little more useful
Stephen Finucane [Fri, 26 Feb 2016 19:54:49 +0000 (19:54 +0000)] 
pwclient: Make 'check-list' a little more useful

Update the 'check-list' command to show more fields per check.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Tested-by: Andy Doan <andy.doan@linaro.org>
9 years agopwclient: Rename 'checks' -> 'check-list'
Stephen Finucane [Fri, 26 Feb 2016 19:54:48 +0000 (19:54 +0000)] 
pwclient: Rename 'checks' -> 'check-list'

Rename this function to ensure all check-related commands have a
'check-' prefix.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Tested-by: Andy Doan <andy.doan@linaro.org>
9 years agopwclient: Fix bug with 'checks' target
Stephen Finucane [Fri, 26 Feb 2016 19:54:47 +0000 (19:54 +0000)] 
pwclient: Fix bug with 'checks' target

This function passed two unexpected arguments to the server. Remove
these, thus fixing the command.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Tested-by: Andy Doan <andy.doan@linaro.org>
9 years agomailmap: Add new mailmap file
Stephen Finucane [Thu, 25 Feb 2016 11:20:30 +0000 (11:20 +0000)] 
mailmap: Add new mailmap file

This adds a mailmap to make shortlog work as expected. There are
currently two entries added.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years agoCHANGELOG: Minor fixes
Stephen Finucane [Thu, 25 Feb 2016 11:07:41 +0000 (11:07 +0000)] 
CHANGELOG: Minor fixes

Remove some duplication and otherwise rework some points in the
CHANGELOG.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoREADME: Add list of talks on patchwork
Stephen Finucane [Thu, 25 Feb 2016 11:06:13 +0000 (11:06 +0000)] 
README: Add list of talks on patchwork

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoREADME: Add quickstart section for devs
Stephen Finucane [Thu, 25 Feb 2016 10:47:25 +0000 (10:47 +0000)] 
README: Add quickstart section for devs

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoxmlrpc: Add a check_create function
Andy Doan [Thu, 25 Feb 2016 20:49:29 +0000 (14:49 -0600)] 
xmlrpc: Add a check_create function

This changes adds the ability to create Check objects via the XMLRPC
interface. It includes a corresponding helper to the pwclient script.
The command can be used like:

 pwclient check_create -c context1 -s success -u http://f.com \
    -d "desc of check" PATCH_ID

Signed-off-by: Andy Doan <andy.doan@linaro.org>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoviews: Redirect when only one TODO exists
Stephen Finucane [Thu, 18 Feb 2016 21:26:55 +0000 (21:26 +0000)] 
views: Redirect when only one TODO exists

At the moment, the page listing all TODOs will display like the page
detailing a single TODO. This is misleading. Instead, use the same
approach as the index page, where the user is automatically redirected
to the appropriate project's page when only one project exists.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agotests: Remove duplicated bulk patch creation
Stephen Finucane [Thu, 18 Feb 2016 15:27:11 +0000 (15:27 +0000)] 
tests: Remove duplicated bulk patch creation

A number of tests were bulk creating patches. Seeing as this is a
common operation, it's better to move this into a common location.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agofilters: Re-add mistakenly removed method
Stephen Finucane [Thu, 18 Feb 2016 15:25:52 +0000 (15:25 +0000)] 
filters: Re-add mistakenly removed method

Removing this method resulted in an issue whereby a user could not
access their "TODO list". Add tests to ensure this doesn't happen
again.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agotests: Remove check for 'tbody'
Stephen Finucane [Thu, 18 Feb 2016 15:59:02 +0000 (15:59 +0000)] 
tests: Remove check for 'tbody'

As part of 'f8cc68', the response for the patch list page changed
slightly. This means one of the things we were checking in a test is
no longer valid. Remove this check.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoviews: Correct typos in reverse paths
Stephen Finucane [Thu, 18 Feb 2016 11:36:29 +0000 (11:36 +0000)] 
views: Correct typos in reverse paths

There are two issues to do with reverse URLs:

* Some reverse URL names are incorrect
* One URL uses the old module path-style reference that's been
  deprecated in Django 1.9

Correct both issues.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agotemplatetags: fix syntax display of CRLF's
Andy Doan [Tue, 16 Feb 2016 21:20:00 +0000 (15:20 -0600)] 
templatetags: fix syntax display of CRLF's

Patches that include CRLF's include extra lines in the UI. Rather than
each patch line being:

 <span ...>content</span>

Its source will be:
 <span ...>content
 </span>

Signed-off-by: Andy Doan <andy.doan@linaro.org>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agosettings: Use environment variables by default
Stephen Finucane [Tue, 9 Feb 2016 12:12:37 +0000 (12:12 +0000)] 
settings: Use environment variables by default

The Django documentation suggests using environment variables as a way
to allow devs to commit settings files via source control without
including confidential information therein [1]. As such, change the
provided 'production' settings to do this. This should promote best
practices while also ensuring provisioning tools like
'ansible-django-stack' [2] work as expected.

[1] https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
[2] https://github.com/jcalazan/ansible-django-stack

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agodocs: Add notes for v1.1.0
Stephen Finucane [Sun, 14 Feb 2016 16:19:35 +0000 (16:19 +0000)] 
docs: Add notes for v1.1.0

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agodocs: Rewrite deployment guide
Stephen Finucane [Tue, 2 Feb 2016 23:32:18 +0000 (23:32 +0000)] 
docs: Rewrite deployment guide

The existing deployment could do with a little bit of fleshing out.
Do this, adding notes about the possibility of sidestepping much of
the process using deployment tools or PaaS solutions.

This also drops notes on deploying using MySQL/MariaDB or non-Ubuntu
distros. While it would be good to cover all use cases, it simply
isn't practical. Do one thing and do it well, providing notes for
users who want other options.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Suggested-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agolib: Add nginx and uWSGI configuration files
Stephen Finucane [Tue, 2 Feb 2016 23:44:34 +0000 (23:44 +0000)] 
lib: Add nginx and uWSGI configuration files

nginx and uWSGI are a well-known option for deploying Django
applications today - might as well embrace them.

Conversely, the mod_python variable and fastcgi service are both
deprecated and should not be used. Remove these.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Suggested-by: Thomas Monjalon <thomas.monjalon@6wind.com>
9 years agoREADME: Add waffle.io badge
Stephen Finucane [Fri, 12 Feb 2016 14:26:48 +0000 (14:26 +0000)] 
README: Add waffle.io badge

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agodocs: Combine MySQL init/reinit instructions
Stephen Finucane [Wed, 10 Feb 2016 19:41:55 +0000 (19:41 +0000)] 
docs: Combine MySQL init/reinit instructions

Apply some learnings for the Vagrant work and combine the commands used
to configure a MySQL database for first time use with those used to
reset an existing database. This should simplify installation.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agodocs: Add note about Vagrant support
Stephen Finucane [Wed, 10 Feb 2016 19:50:42 +0000 (19:50 +0000)] 
docs: Add note about Vagrant support

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agovagrant: Add Vagrant-based development environment
Stephen Finucane [Tue, 9 Feb 2016 22:26:13 +0000 (22:26 +0000)] 
vagrant: Add Vagrant-based development environment

Integrate Vagrant by way of a Vagrantfile and a simple install script.
This follows many of the instructions found in the development guide
with the exceptions of the superuser creation, which is optional, the
loading of archives, which requires per-user authentication, and the
use of virtual environments, which are unnecessary in a teardown
environment such as this.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agorequirements: Remove psycopg2
Stephen Finucane [Wed, 10 Feb 2016 19:58:47 +0000 (19:58 +0000)] 
requirements: Remove psycopg2

It would be good to provide the required packages for devs using both
MySQL and PostgreSQL. However, there does not appear to be any way to
specify an exclusive-or condition in pip requirements files and the
existing behavior of including dependencies for both RDBMSs means
system packages have to be installed for both, when you are likely
only using one. This is particularly problematic when you want to
set up a fast dev environment using something like Vagrant.

Settle on MySQL for now, until such a time as the consensus is to go
all-in with PostgreSQL (including docs, for example).

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agotemplates: Cleanup patch-list
Stephen Finucane [Sun, 10 Jan 2016 15:26:37 +0000 (15:26 +0000)] 
templates: Cleanup patch-list

Cleanup this file before doing any work on it. Items addressed:

* Move complex logic into template tags
* Move related content closer together
* Random whitespace annoyances

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoui: Make the project a unit with 'Patchwork' in the menu bar
Damien Lespiau [Mon, 21 Dec 2015 12:12:28 +0000 (12:12 +0000)] 
ui: Make the project a unit with 'Patchwork' in the menu bar

Both should be styled the same and be a link to the home page.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
9 years agoui: Make "All Projects" on the main page consistent with the rest
Damien Lespiau [Mon, 21 Dec 2015 12:07:02 +0000 (12:07 +0000)] 
ui: Make "All Projects" on the main page consistent with the rest

The pages we're on are now represented with a little icon and active.
Make the one on the main page look like the rest.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoui: Split the tiles in columns and increase the mininum size
Damien Lespiau [Sun, 20 Dec 2015 17:20:29 +0000 (17:20 +0000)] 
ui: Split the tiles in columns and increase the mininum size

Let's try to make that page looks better when the natural size of the
tiles are different (because the contents have varying sizes).

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoui: Put the project name by default on project pages
Damien Lespiau [Sun, 20 Dec 2015 16:35:08 +0000 (16:35 +0000)] 
ui: Put the project name by default on project pages

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoui: Switch to HTML5 doctype and fix issues
Damien Lespiau [Sun, 20 Dec 2015 03:53:53 +0000 (03:53 +0000)] 
ui: Switch to HTML5 doctype and fix issues

A few common things:

- Remove the 'role' attribute of <nav>
- Don't use the self closing syntax ('/>') on non void elements
- Don't use the language attribution in <script>
- Remove spurious attributes
- The 'check' attribute of <input> doesn't take any value

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoui: Redesign the projects page
Damien Lespiau [Sat, 19 Dec 2015 22:09:00 +0000 (22:09 +0000)] 
ui: Redesign the projects page

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoui: Redesign the pagination widgets
Damien Lespiau [Sat, 19 Dec 2015 11:18:05 +0000 (11:18 +0000)] 
ui: Redesign the pagination widgets

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoui: Merge the TODO list into the user dropdown
Damien Lespiau [Fri, 18 Dec 2015 17:34:29 +0000 (17:34 +0000)] 
ui: Merge the TODO list into the user dropdown

We still leave the badge on the top bar so we can see, at a glance, the
number of items on the TODO list. The actual menu item is folded into
the dropdown.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoui: Merge the admin link into the user dropdown
Damien Lespiau [Fri, 18 Dec 2015 17:17:59 +0000 (17:17 +0000)] 
ui: Merge the admin link into the user dropdown

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoui: Use <h1> for page titles
Damien Lespiau [Fri, 18 Dec 2015 16:50:15 +0000 (16:50 +0000)] 
ui: Use <h1> for page titles

<h2> is used for titles within the page, but shouldn't be used for page
titles, which are a level higher.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoui: Use bootstrap container-fluid class
Damien Lespiau [Fri, 18 Dec 2015 16:48:37 +0000 (16:48 +0000)] 
ui: Use bootstrap container-fluid class

It's time to use more of Boostrap. Having the top level element use the
framework makes the rest work.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoui: Redesign navigation
Damien Lespiau [Thu, 17 Dec 2015 18:08:56 +0000 (18:08 +0000)] 
ui: Redesign navigation

We get rid of the breadcrumbs in favour of items always present in the
top navigation bar.

Based on BĂ©len's new design iteration.

v2: Rebase onto master

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoui: Let the bootstrap inverse navbar style shine through
Damien Lespiau [Mon, 14 Dec 2015 18:04:23 +0000 (18:04 +0000)] 
ui: Let the bootstrap inverse navbar style shine through

Time for another iteration of the design. Let's start by using the
inverse bootsrap style with a slightly whiter color for font for better
contrast.

That color change has repercussions in the style sheet, mostly in the
custom containers/boxes we're still using on the secondary pages
(login/register/...)

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agourls: Create a project version of bundles
Damien Lespiau [Thu, 17 Dec 2015 18:33:29 +0000 (18:33 +0000)] 
urls: Create a project version of bundles

We'd like to have a per-project list of bundles as we present all data
in the context of a single project anyway.

Still keep the instance-wide list bundles around.

v2: Rename the existing 'bundle-list' url to 'user-bundles', as this is
more inkeeping with the other URLs

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoui: Make 'Patch count' look a bit less formal
Damien Lespiau [Sat, 4 Apr 2015 14:04:26 +0000 (15:04 +0100)] 
ui: Make 'Patch count' look a bit less formal

I'm really not anything of a UX designer, nor a native speaker, but I
can try to make tools a bit less 'dry'. 'Number of patches' would have
worked as well, but opted for a shorter one.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoui: Move the background color of the table headers to a class
Damien Lespiau [Mon, 1 Dec 2014 15:07:28 +0000 (15:07 +0000)] 
ui: Move the background color of the table headers to a class

As we are using "sticky headers", the column headers stay apparent when
scrolling down, we need to specify a white background to hide what's
underneath.

With the addition of Seres, the patchlist table is not the only table we
want this behaviour on, so let's make it a CSS class rather then a
selector on the patchlist id.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoui: Don't display the '<' and '>' characters in the message-id
Damien Lespiau [Sun, 25 Oct 2015 23:18:37 +0000 (23:18 +0000)] 
ui: Don't display the '<' and '>' characters in the message-id

Suggested-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoui: Don't allow to the date to wrap
Damien Lespiau [Mon, 26 Oct 2015 08:17:09 +0000 (08:17 +0000)] 
ui: Don't allow to the date to wrap

When rendered on smaller screens, the mininum column size for the date
was reached and the text was wrapping. We can force it to not wrap with
white-space: nowrap; and bootstrap already includes a convenient
text-nowrap class.

v2: Extend the use of 'text-nowrap' to existing classes

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agorequirements: Use PostgreSQL in production
Stephen Finucane [Fri, 5 Feb 2016 15:12:25 +0000 (15:12 +0000)] 
requirements: Use PostgreSQL in production

The example "production" settings expect a PostgreSQL database backend,
yet the requirements file for the same scenario install MySQL
dependencies. Correct this mismatch.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agowsgi: Move wsgi file to expected location
Stephen Finucane [Fri, 5 Feb 2016 17:31:57 +0000 (17:31 +0000)] 
wsgi: Move wsgi file to expected location

Django places a wsgi.py file in the root of each application's
directory. Do this, adding a symlink to preserve existing
operation for users.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoxmlrpc: Treat negative max_count as meaning "return last N results"
Adam Jackson [Mon, 30 Nov 2015 19:59:45 +0000 (14:59 -0500)] 
xmlrpc: Treat negative max_count as meaning "return last N results"

This is most useful when listing patches, as it lets you get the most
recent results instead of the oldest.

v2: Resolve "Negative indexing is not supported." issue and include
    unit tests to ensure this doesn't regress. Bump API version to
    1.2

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>