]> git.ipfire.org Git - thirdparty/patchwork.git/log
thirdparty/patchwork.git
8 years agolib/apache2: Update location to wsgi python script stable/1.1
Florian Fainelli [Thu, 11 May 2017 23:25:30 +0000 (16:25 -0700)] 
lib/apache2: Update location to wsgi python script

Commit 8fe68d96f18e ("wsgi: Move wsgi file to expected location")
relocated lib/apache2/patchwork.wsgi to patchwork/wsgi.py but did not
update the Apache2 example configuration file under
lib/apache2/patchwork.wsgi.conf.

Fixes: 8fe68d96f18e ("wsgi: Move wsgi file to expected location")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
(cherry picked from commit 114ff6061d4005b2458e75da52f3a6cf4ae19bf5)

8 years agoviews: Don't munge the 'From' field of patches v1.1.3
Doug Anderson [Sat, 19 Nov 2016 19:32:09 +0000 (19:32 +0000)] 
views: Don't munge the 'From' field of patches

At the moment patchwork always uses the official submitter name (as
patchwork understands it) as the "From" for patches that you receive.
This isn't quite what users expect and has some unfortunate
consequences.

The biggest problem is that patchwork saves the "official" name for an
email address the first time it sees an email from them.  If that name
is wrong (or was missing) patchwork will be confused even if future
emails from this person are fixed.  There are similar problems if a
user changes his/her name (get married?).

It seems better to just have each patch report the actual "From" that
was used to send that patch.  We'll still return the submitter in
'X-Patchwork-Submitter' just in case someone wants it.

Conflicts:
patchwork/tests/test_mboxviews.py

Reported-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Stephen Finucane <stephen@that.guru>
(cherry picked from commit d365402fb98dfb2c4aea4b58346096f85bdfa0c3)

8 years agotravis: Integrate on stable branch
Stephen Finucane [Tue, 31 Jan 2017 19:31:12 +0000 (19:31 +0000)] 
travis: Integrate on stable branch

This helps us detect regressions on the branch.

Signed-off-by: Stephen Finucane <stephen@that.guru>
StableOnly

8 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
(cherry picked from commit aec764b7c5c8250185025f5b4d7c8fc47d9e3533)

8 years agopwclient: Fix encoding problems
Robin Jarry [Thu, 15 Dec 2016 16:56:18 +0000 (17:56 +0100)] 
pwclient: Fix encoding problems

All data returned by the xmlrpc object is unicode decoded with 'utf-8' (on
python 3, unicode == str). Add from __future__ import unicode_literals
to make sure that everything is unicode and avoid surprises.

On python 2, printing unicode to stdout causes it to be encoded to str
(byte string) with the 'ascii' codec:

  >>> print some_unicode_string
  ...
  UnicodeEncodeError: 'ascii' codec can't encode character u'\u0142'
  in position 468: ordinal not in range(128)

Work around ths by avoiding any explicit call to unicode() and by
replacing sys.stdout and sys.stderr by unicode-aware file objects (as
returned by io.open()).

Guess the encoding of stdout and stderr by looking at (in that order):
sys.stdout.encoding, locale.getpreferredencoding(), the PYTHONIOENCODING
environment variable. If no encoding is defined, assume 'utf-8' as
output encoding.

Conflicts:
    patchwork/bin/pwclient

Tested-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
(cherry picked from commit 046419a3bf8f012fcb019c3ec8d78653da685908)

8 years agopwclient: Fix Python 3 encoding of received strings
Thomas Monjalon [Tue, 13 Dec 2016 10:37:47 +0000 (11:37 +0100)] 
pwclient: Fix Python 3 encoding of received strings

The conversion encode("utf-8") makes a byte stream which is
poorly printed with Python 3.
However this encoding is required for Popen.communicate() but must be
done after str.join() which applies to a real string.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
(cherry picked from commit 52654da17967a930a3cac962fc654e0d5de2855b)

Conflicts:
patchwork/bin/pwclient

8 years agopwclient: Support proxy configuration
Thomas Monjalon [Tue, 13 Dec 2016 10:37:46 +0000 (11:37 +0100)] 
pwclient: Support proxy configuration

The environment variables http_proxy and https_proxy can be used
to configure the HTTP transport.

The TCP connection is made with the proxy host, whereas the original host
is maintained in the HTTP POST URI via "handler" in "send_request".

The send_request() method of xmlrpclib has a different signature
and behaviour in Python 2 and 3.

Fixes #47

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
(cherry picked from commit 53fe8b16431833b7bff6271c41ca8b79b0a7701e)

8 years agopwclient: Rework HTTP authentication
Thomas Monjalon [Tue, 13 Dec 2016 10:37:45 +0000 (11:37 +0100)] 
pwclient: Rework HTTP authentication

Transform the HTTP authentication class into a generic transport class.
The credentials become optional so this transport class is always used.

A side effect is to fix the Python 3 support for the authentication.
Fixes #59

It will help to bring proxy support while combining http/https and
authentication cases.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
(cherry picked from commit 0bcb1bf6466461043bcb84c4856166105d5d5738)

8 years agoRevert "Allow assigning of any user as delegate" v1.1.2
Stephen Finucane [Sun, 25 Sep 2016 21:37:11 +0000 (22:37 +0100)] 
Revert "Allow assigning of any user as delegate"

This reverts commit e0fd7cd91a5fbe0a0077c46bea870ccd09c8920d.

This change does not scale with a larger number of lists, and clearly
needs more work. Revert until such a time as this is carried out.

Signed-off-by: Stephen Finucane <stephen@that.guru>
(cherry picked from commit 198139e4112cf337ffea403000441931b4ddad06)

8 years agoparser: parse headers containing invalid characters or codings
Daniel Axtens [Mon, 19 Sep 2016 14:23:58 +0000 (00:23 +1000)] 
parser: parse headers containing invalid characters or codings

If there is a non-ascii character in a header, parsing fails,
even on Py27.

This has huge Py2/Py3 complexities. The Py3 email package has tools
to handle this - we just need to use them. Py2, on the other hand,
needs a lot of hand-holding, as explained in the comments.

Additionally, support headers that claim an encoding, but fail to
decode with that encoding.

This is handy for mails with malformed headers containing weird
bytes.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reported-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
(cherry picked from commit 6625d4b0dcdf1820b73227c40118625d4db9e130)

9 years agotemplates: Move comments to above patch v1.1.1
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>
Signed-off-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 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 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 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>
9 years agopy3: Ensure map is wrapped in list
Stephen Finucane [Fri, 5 Feb 2016 17:16:58 +0000 (17:16 +0000)] 
py3: Ensure map is wrapped in list

The map function doesn't return a list in Python 3, which means it
can't be used like one. Many of these issues were previously resolved
but there were some uncovered code paths. Resolve these, adding tests
to ensure it doesn't regress.

In addition, change what's serialized and returned. Instead of
returning a subset of the serialized values, only serialize a subset
of the original values. This means n items are serialized instead of
max.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agomodels: Allow to unselect maintainer projects in user profile
Thomas Monjalon [Sat, 30 Jan 2016 15:34:34 +0000 (16:34 +0100)] 
models: Allow to unselect maintainer projects in user profile

The admin page for user profiles have a field "Maintainer projects"
to grant maintainer rights to an user. It is a list of available
projects. When a project was selected, it was impossible to revoke.
It is now possible to unselect by clicking while holding the "Ctrl"
key.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agodocs: Reconfigure page structure
Stephen Finucane [Wed, 3 Feb 2016 21:01:37 +0000 (21:01 +0000)] 
docs: Reconfigure page structure

There are two distinct types of documentation available: documentation
for patchwork developers and documentation for patchwork deployers.
Rework the mkdocs configuration such that this hierarchy is
established.

As part of this change, the installation doc is renamed to deployment.
This guide should be used to install patchwork in a production
environment and not necessarily a deployment one. The existing name
was misleading so fix it.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agodocs: Remove remainder of non-GHFM references
Stephen Finucane [Tue, 2 Feb 2016 23:30:40 +0000 (23:30 +0000)] 
docs: Remove remainder of non-GHFM references

The GitHub Format Markdown style of Markdown links breaks in some
Markdown renderers. Change to the style now used in all other files.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agodocs: Rework the development guide
Stephen Finucane [Tue, 2 Feb 2016 23:21:33 +0000 (23:21 +0000)] 
docs: Rework the development guide

patchwork has undergone a number of changes recently that can make
deployment of a development environment much simpler than it was
previously. Unfortunately, these were not illustrated in the
documentation. Resolve this oversight by rewriting the developer guide
to reflect, for example, the usefulness of the 'parsearchive' script or
the fact that environment variables like 'PW_TEST_DB_USER' do not
always need to be exported.

This includes changes to the provided 'default_projects' fixture: the
existing projects weren't chosen for any particular reason and the
rewritten guide expects a 'patchwork' project to exist.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agodocs: Add an upgrading guide
Stephen Finucane [Tue, 2 Feb 2016 23:13:56 +0000 (23:13 +0000)] 
docs: Add an upgrading guide

The guide details the general pitfalls such users may encounter when
upgrading a patchwork. Upgrading older deployments of patchwork,
particularly those that are pre-1.0, can be a daunting task and this
guide should support users in this task. However, it should not
replace the UPGRADING document but rather supplement it with more
general, non-version specific advice.

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

This guide serves to illustrate import aspects of patchworks release
process: when, why and how. It also serves as a helpful reminder for
the maintainers themselves.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agodocs: Add a contributors guide
Stephen Finucane [Tue, 2 Feb 2016 23:10:13 +0000 (23:10 +0000)] 
docs: Add a contributors guide

This guide details the steps one should follow to submit patches for
patchwork. It's nothing onerous but rather common sense. This requires
moving the testing section from the development guide to this new
document.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agodocs: Add a README
Stephen Finucane [Thu, 28 Jan 2016 11:34:17 +0000 (11:34 +0000)] 
docs: Add a README

This is mostly a copy/paste of 'index.md' with added badges. This will
be useful to provide an overview to people who stumble upon patchwork
on GitHub.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agopep8: Resolve some issues with lambda functions
Stephen Finucane [Tue, 26 Jan 2016 22:13:43 +0000 (22:13 +0000)] 
pep8: Resolve some issues with lambda functions

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agofilters: Re-add removed constant
Stephen Finucane [Fri, 5 Feb 2016 17:14:14 +0000 (17:14 +0000)] 
filters: Re-add removed constant

There was a rebase mistake in 'f439f54': a constant that should not
have been removed was. Resolve this issue.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoAllow assigning of any user as delegate
Stephen Finucane [Mon, 24 Aug 2015 13:21:43 +0000 (14:21 +0100)] 
Allow assigning of any user as delegate

Currently, Patchwork only allows to delegate patches to developers who
are registered as "maintainers" of the project in Patchwork or set up
as autodelegate "targets". This is a bit annoying as "maintainers" in
the Patchwork sense have the power to change the state of *any* patch.

Allow delegation of patches to developers who are not the submitter of
the patch in question, a maintainer of the project or an autodelegate
"target". This request is documented here:

    https://lists.ozlabs.org/pipermail/patchwork/2015-July/001351.html

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoAdd delegate filter autocomplete support
Stephen Finucane [Mon, 24 Aug 2015 10:05:47 +0000 (11:05 +0100)] 
Add delegate filter autocomplete support

It would be helpful to provide autocomplete functionality for the
delegate filter field, similar to that provided for the submitter
field. This will provide a way to handle larger delegate lists without
overloading the user with options.

Add this functionality through use of Selectize, which is already used
to provide similar functionality for filtering of "submitters".

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agotox: Add 'venv' target
Stephen Finucane [Tue, 19 Jan 2016 22:05:45 +0000 (22:05 +0000)] 
tox: Add 'venv' target

The venv command provides access to the tox virtual environment
without the need to source the actual virtualenv 'activate' file.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agotox: Cleanup '.pyc' files before run
Stephen Finucane [Tue, 19 Jan 2016 22:02:52 +0000 (22:02 +0000)] 
tox: Cleanup '.pyc' files before run

Sometimes leftover '.pyc' files can cause tests to fail. Ensure this
never happens by always removing these files on start.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agomodels: Rename 'Check.__unicode__' to '__str__'
Stephen Finucane [Thu, 21 Jan 2016 09:49:24 +0000 (09:49 +0000)] 
models: Rename 'Check.__unicode__' to '__str__'

This causes issues with Python 3.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agomodels: Resolve SubfieldBase deprecation warnings
Stephen Finucane [Tue, 8 Dec 2015 17:03:10 +0000 (17:03 +0000)] 
models: Resolve SubfieldBase deprecation warnings

SubfieldBase has been deprecated. It is necessary to add a
'from_db_value' function in place of this mixin.

https://docs.djangoproject.com/en/1.9/releases/1.8/#subfieldbase

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agosettings: Place most-used path first
Stephen Finucane [Sun, 10 Jan 2016 23:00:47 +0000 (23:00 +0000)] 
settings: Place most-used path first

Make the settings file a little easier to parse by placing the most
used (i.e. the one used with recent versions of Django) first.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agosettings: Add TEMPLATES setting
Stephen Finucane [Tue, 8 Dec 2015 15:37:52 +0000 (15:37 +0000)] 
settings: Add TEMPLATES setting

This was added in Django 1.8 and will be required by Django 1.10.

https://docs.djangoproject.com/en/1.9/ref/templates/upgrading/#the-templates-settings

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agourls: Remove reverse by Python path urls
Stephen Finucane [Mon, 7 Dec 2015 23:14:20 +0000 (23:14 +0000)] 
urls: Remove reverse by Python path urls

Reversing by Python paths has been deprecated in Django 1.8, causes
warnings in Django 1.9 and will be removed in Django 2.0. Resolve the
warnings and prevent issues in the future by importing by module
instead.

https://docs.djangoproject.com/en/1.9/releases/1.8/#passing-a-dotted-path-to-reverse-and-url

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoUse URL names in place of Python paths
Stephen Finucane [Tue, 8 Dec 2015 15:09:00 +0000 (15:09 +0000)] 
Use URL names in place of Python paths

Reversing by Python paths has been deprecated in Django 1.8, causes
warnings in Django 1.9 and will be removed in Django 2.0. Resolve the
warnings and prevent issues in the future by referring to URLs by name,
rather than by Python path.

https://docs.djangoproject.com/en/1.9/releases/1.8/#passing-a-dotted-path-to-reverse-and-url

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agourls: Add url names
Stephen Finucane [Tue, 8 Dec 2015 15:08:11 +0000 (15:08 +0000)] 
urls: Add url names

Reverse by name is an alternative to reverse by Python path. The names
must be added as a prerequisite for removing reverse by Python path,
per Django documentation.

https://docs.djangoproject.com/en/1.9/ref/urlresolvers/#django.core.urlresolvers.reverse

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoMove view-related code from utils->views/__init__
Stephen Finucane [Mon, 7 Dec 2015 21:07:48 +0000 (21:07 +0000)] 
Move view-related code from utils->views/__init__

These functions are view-related and belong in the views folder.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoviews: Split up 'base'
Stephen Finucane [Sun, 6 Dec 2015 18:13:25 +0000 (18:13 +0000)] 
views: Split up 'base'

This is a collection of unrelated functions, many of which belong in
their own file. Do this, taking the opportunity to rename some of these
functions to better indicate their purpose in the process.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agotox: Cleanup file
Stephen Finucane [Sat, 5 Dec 2015 03:53:00 +0000 (03:53 +0000)] 
tox: Cleanup file

Remove some unnecessary code and reorder in a logical fashion

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agotox: Add django19 targets
Stephen Finucane [Sat, 5 Dec 2015 03:50:24 +0000 (03:50 +0000)] 
tox: Add django19 targets

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agopy3: 'dict_keys' object has no attribute 'sort'
Stephen Finucane [Tue, 19 Jan 2016 21:50:44 +0000 (21:50 +0000)] 
py3: 'dict_keys' object has no attribute 'sort'

Resolve an issue causing the aforementioned issue.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoCHANGELOG: Add autodelegation and Python3 features
Stephen Finucane [Tue, 19 Jan 2016 21:15:54 +0000 (21:15 +0000)] 
CHANGELOG: Add autodelegation and Python3 features

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoReport if a patch is delegated and to whom
Mauro Carvalho Chehab [Sat, 28 Nov 2015 12:14:43 +0000 (10:14 -0200)] 
Report if a patch is delegated and to whom

When a patch is delegated, it can be important to report it via
pwclient, as handing delegated patches may be different. So, add
an optional field at the email's body if this is happening.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
Suggested-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
9 years agoparsemail: Generate useful retcodes
Mauro Carvalho Chehab [Sat, 28 Nov 2015 12:14:46 +0000 (10:14 -0200)] 
parsemail: Generate useful retcodes

When things are broken at parsemail, we need to be able to
debug it. So, add some messages to it, in order to allow
checking what it actually did, and to let it return 1 if
an email got skipped by parsemail.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoforms: Allow the delegate field to keep its current value
Laurent Pinchart [Sat, 28 Nov 2015 12:14:40 +0000 (10:14 -0200)] 
forms: Allow the delegate field to keep its current value

When a patch is delegated at parse time (either through the
X-Patchwork-Hint mail header or through delegation rules), the delegate
might not be in the list of project maintainers.

Add the current delegate to the list of acceptable values for the
delegate field to allow the current value to be kept when editing the
patch.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoparser: Set the delegate using Delegation rules
Laurent Pinchart [Sat, 28 Nov 2015 12:14:39 +0000 (10:14 -0200)] 
parser: Set the delegate using Delegation rules

v2: Resolve issues with unit tests

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agoparser: Add patch_get_filenames()
Laurent Pinchart [Sat, 28 Nov 2015 12:14:38 +0000 (10:14 -0200)] 
parser: Add patch_get_filenames()

The function returns the list of files touched by a patch, after
stripping the leading component of the path name.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agomodels: Add DelegationRule object
Laurent Pinchart [Sat, 28 Nov 2015 12:14:37 +0000 (10:14 -0200)] 
models: Add DelegationRule object

Delegation rules are used to automatically set the delegate of a patch
based on the files touched by the patch.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
9 years agotox: 'flake' -> 'flake8'
Stephen Finucane [Tue, 12 Jan 2016 18:57:53 +0000 (18:57 +0000)] 
tox: 'flake' -> 'flake8'

The 'flake8' target specified the wrong dependendency. Resolve this.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>