]> git.ozlabs.org Git - patchwork/log
patchwork
13 years agoUse generic email confirmation object
Jeremy Kerr [Thu, 12 Aug 2010 04:15:48 +0000 (12:15 +0800)]
Use generic email confirmation object

Rather than having a UserPerson-specific confirmation, add an
EmailConfirmation object to allow multiple types of confirmations (eg,
opt-out requests in future).

To do this, we use a view (patchwork.views.confirm) that will call the
type-specific view with the confirmation object.

Also, add tests to check that the User/Person linkage system works.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoforms: Fix MultipleBooleanField.to_python when the field value is missing
Guilherme Salgado [Wed, 13 Apr 2011 06:11:07 +0000 (06:11 +0000)]
forms: Fix MultipleBooleanField.to_python when the field value is missing

If you write a test for, say, the bundle form of a patch list, you'd
still have to specify the 'no change' value to other form (e.g. the
multiple update one) fields using MultipleBooleanField or else it'd
raise a ValueError when field.clean() is called as part of
form._get_errors().

Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agomodels: use implied line continuations
Jeremy Kerr [Thu, 14 Apr 2011 06:58:10 +0000 (14:58 +0800)]
models: use implied line continuations

Use the implied line continuations, and make the indentation more clear.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agomodels: Project.is_editable to check whether a user has edit rights
Guilherme Salgado [Tue, 12 Apr 2011 11:35:10 +0000 (11:35 +0000)]
models: Project.is_editable to check whether a user has edit rights

This is to replace the couple of places where we duplicate this same
check.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoviews: Refactor generic_list() to make it less complicated
Guilherme Salgado [Tue, 12 Apr 2011 11:34:57 +0000 (11:34 +0000)]
views: Refactor generic_list() to make it less complicated

When a form is submitted it now delegates to separate processing
functions according to the action.  Apart from being more readable it's
now a lot easier to add extra forms for processing lists of patches.

Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoadmin: Streamline admin model registration
Dirk Wallenstein [Fri, 1 Apr 2011 07:12:15 +0000 (07:12 +0000)]
admin: Streamline admin model registration

Use autodiscover and the new way to hook AdminSite into the URLconf.
AdminSite.root() will be removed in Django-1.3 as noted here:
http://docs.djangoproject.com/en/dev/internals/deprecation/

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agosettings: Remove hard-coded absolute paths
Guilherme Salgado [Mon, 28 Feb 2011 02:38:29 +0000 (02:38 +0000)]
settings: Remove hard-coded absolute paths

This is so that you don't have to change a dozen variables when you
deploy an instance somewhere other than on /srv/patchwork.

Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agopatchwork-update-commits: add missing `update` to command line
Paul Menzel [Wed, 23 Mar 2011 17:10:31 +0000 (18:10 +0100)]
patchwork-update-commits: add missing `update` to command line

Otherwise the following error is shown:

    Too many arguments specified

Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoRemove a bunch of unused variables
Guilherme Salgado [Mon, 28 Feb 2011 02:40:44 +0000 (02:40 +0000)]
Remove a bunch of unused variables

Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoUse the 'in' operator instead of dict.has_key(), which has been deprecated
Guilherme Salgado [Mon, 28 Feb 2011 02:39:36 +0000 (02:39 +0000)]
Use the 'in' operator instead of dict.has_key(), which has been deprecated

Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoparser: Get rid of some code duplication in parsemail-batch.sh
Guilherme Salgado [Mon, 28 Feb 2011 01:54:18 +0000 (01:54 +0000)]
parser: Get rid of some code duplication in parsemail-batch.sh

Change parsemail-bash.sh to uses parsemail.sh (instead of parsemail.py),
as the former sets the required environment variables that were being
set in parsemail-batch.sh.

Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agotemplates: remove redundant 'about' link from main nav
Jeremy Kerr [Mon, 28 Mar 2011 09:32:31 +0000 (17:32 +0800)]
templates: remove redundant 'about' link from main nav

We have a link to the about page right below.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agomodels: use User.post_save signal to create UserProfile objects
Jeremy Kerr [Thu, 10 Mar 2011 10:06:50 +0000 (18:06 +0800)]
models: use User.post_save signal to create UserProfile objects

Rather than relying on the registration app's callback mechanism to
create the UserProfile object, use the post_save signal on auth.User.

This means that the UserProfile will be created regardless of how the
User was created.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoReplace tab characters with spaces on .py files
Guilherme Salgado [Wed, 9 Mar 2011 10:00:56 +0000 (10:00 +0000)]
Replace tab characters with spaces on .py files

Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoRemove unused imports
Guilherme Salgado [Wed, 9 Mar 2011 01:15:06 +0000 (01:15 +0000)]
Remove unused imports

This is so that we can use static analysis tools like pyflakes to find
undefined names (and other common mistakes we often make) without being
swamped with unused imports warnings.

Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoviews: use id__in = get_patch_ids() to get the modified patch set
Jeremy Kerr [Wed, 9 Mar 2011 05:20:10 +0000 (13:20 +0800)]
views: use id__in = get_patch_ids() to get the modified patch set

Currently, we generic_list processes patches in order of the patch_id:X
parameter, which is arbitrarily decided by the browser.

By using id__in, we get patches sorted by the default Patch model
ordering. This means that the (arbitrary) order of get_patch_ids()
doesn't affect the ordering of patches that we process, and bundles
are created with a reasonable default patch order.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoforms: Fix archiving/unarchiving of patches on patch lists
Guilherme Salgado [Mon, 28 Feb 2011 02:37:03 +0000 (02:37 +0000)]
forms: Fix archiving/unarchiving of patches on patch lists

It was broken because MultipleBooleanField() was leaking string values instead
of boolens as expected by MultiplePatchForm.

Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoparser: Allow pull requests to include a diff
Guilherme Salgado [Mon, 28 Feb 2011 01:50:24 +0000 (01:50 +0000)]
parser: Allow pull requests to include a diff

If a patch comes along with a pull request and a diff, add both to the
Patch model.

Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoRemove unused templates and some code for processing them
Guilherme Salgado [Wed, 23 Feb 2011 06:34:40 +0000 (06:34 +0000)]
Remove unused templates and some code for processing them

These seem to be what was used in the past to archive/unarchive and delete
patches.

Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agofilters: quote param names and values when constructing querystrings
Jeremy Kerr [Mon, 28 Feb 2011 06:43:31 +0000 (14:43 +0800)]
filters: quote param names and values when constructing querystrings

Use urllib.quote to sanitise parameter names and values; prevents
escaped ampersands in the input qs from appearing unescaped in the
link output.

Add a testcase for the unescaped qs fragments

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agotests: Support execution of single tests
Dirk Wallenstein [Wed, 16 Feb 2011 08:41:30 +0000 (08:41 +0000)]
tests: Support execution of single tests

Django does not use suite() when executing single tests.  Importing all
tests directly into __init__.py has the same effect as the replaced
version of suite().

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agopatchwork-update-commits: autodetect patchwork install directory
Sascha Silbe [Fri, 11 Feb 2011 04:49:21 +0000 (04:49 +0000)]
patchwork-update-commits: autodetect patchwork install directory

Make patchwork-update-commits work from outside the Patchwork git
repository so it can be used for other projects.

Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agohelpers: Change patchwork.wsgi to include the apps/ dir in sys.path
Guilherme Salgado [Tue, 15 Feb 2011 02:30:54 +0000 (02:30 +0000)]
helpers: Change patchwork.wsgi to include the apps/ dir in sys.path

Without this, templates will crash as they reference patchwork.<module>
directly.

Also removes the patchwork.wsgi symlink from the root and use the real
file in patchwork.wsgi.conf instead, as suggested by Dirk Wallenstein.

Signed-off-by: Guilherme Salgado <guilherme.salgado@linaro.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoparser: Recognize mail headers for delegate and state
Dirk Wallenstein [Wed, 26 Jan 2011 05:12:29 +0000 (05:12 +0000)]
parser: Recognize mail headers for delegate and state

Introduce two new Patchwork mail headers that determine the initial
state and delegate of a patch.  They take a state name as displayed in
Patchwork and the email address of the wanted delegate.  An example:

X-Patchwork-State: Changes Requested
X-Patchwork-Delegate: maintainer@project.tld

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoadmin: Embellish model change lists
Dirk Wallenstein [Tue, 18 Jan 2011 00:16:00 +0000 (00:16 +0000)]
admin: Embellish model change lists

Add fields to the admin change list pages of patchwork models, and add
filters and search boxes where appropriate.

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agotests/parser: Add test for wrapped git pull requests
Jeremy Kerr [Fri, 11 Feb 2011 01:45:54 +0000 (09:45 +0800)]
tests/parser: Add test for wrapped git pull requests

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoparser: Account for mail client line wrapping in pull requests
Dirk Wallenstein [Mon, 17 Jan 2011 00:40:43 +0000 (00:40 +0000)]
parser: Account for mail client line wrapping in pull requests

If a mail client wraps the line with the sha, there won't necessarily be
a space after 'commit'.

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agomodels: Don't require optional model fields in forms
Dirk Wallenstein [Sun, 16 Jan 2011 23:46:48 +0000 (23:46 +0000)]
models: Don't require optional model fields in forms

Add blank = True for nullable fields, to allow forms to be subitted
without a value for these fields.

The keyword 'blank' concerns only validation and does not change what
will be stored in the database.

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agomodels: Implement __unicode__ in models instead of __str__
Dirk Wallenstein [Sat, 15 Jan 2011 01:16:21 +0000 (01:16 +0000)]
models: Implement __unicode__ in models instead of __str__

According to the Django documentation at [1] it is recommended to
implement __unicode__ and not __str__.  Django's model base class
provides a __str__ method that will use the __unicode__ method and
convert to utf-8.  Also, every text value returned from the DB through
the model is unicode.

It is now possible to edit Patches and Persons that have values with
non-ASCII characters through the admin interface.

[1] http://docs.djangoproject.com/en/1.2/ref/unicode/

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agotemplates: Spelling fix
Dirk Wallenstein [Wed, 12 Jan 2011 23:05:07 +0000 (23:05 +0000)]
templates: Spelling fix

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoReplace tab in indentation with space
Dirk Wallenstein [Wed, 12 Jan 2011 23:05:08 +0000 (23:05 +0000)]
Replace tab in indentation with space

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agotemplates: Fix pwclient no-match messages
Dirk Wallenstein [Wed, 12 Jan 2011 23:05:09 +0000 (23:05 +0000)]
templates: Fix pwclient no-match messages

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agodocs: Fix link creation example
Dirk Wallenstein [Wed, 12 Jan 2011 23:05:06 +0000 (23:05 +0000)]
docs: Fix link creation example

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agotests/parser: Add subject encoding tests
Jeremy Kerr [Fri, 11 Feb 2011 00:45:51 +0000 (08:45 +0800)]
tests/parser: Add subject encoding tests

We should now be able to decode internationalised Subject headers, so
add tests for this.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoparser: Decode the subject header
Dirk Wallenstein [Wed, 12 Jan 2011 22:37:56 +0000 (22:37 +0000)]
parser: Decode the subject header

The clean_header function decodes internationalized headers.  Use it for
the subject, too.

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoRevert "Decode patch from UTF-8 while parsing from stdin"
Jeremy Kerr [Thu, 10 Feb 2011 03:19:23 +0000 (11:19 +0800)]
Revert "Decode patch from UTF-8 while parsing from stdin"

This reverts commit 7fd7d0bbe4e3fce405e02e9e630ef70023fdd43e.

parse_patch() will never be handed anything but unicode, so no need to
do the decode.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoDecode patch from UTF-8 while parsing from stdin
martin f. krafft [Fri, 5 Feb 2010 03:33:25 +0000 (04:33 +0100)]
Decode patch from UTF-8 while parsing from stdin

Patchwork (rightfully) hashes patches using UTF-8:

  parser.py:
    def hash_patch(str):
      […]
      hash.update(line.encode('utf-8') + '\n')

This patch makes sure that it treats the incoming data as UTF-8 as well.

Signed-off-by: martin f. krafft <madduck@madduck.net>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agopwclient: fix handling of UTF-8 char in submitter name
Andreas Bießmann [Tue, 7 Dec 2010 15:48:20 +0000 (16:48 +0100)]
pwclient: fix handling of UTF-8 char in submitter name

This patch fixes following bug in 'list':

---8<---
# pwclient list -p uboot -w andreas.devel | grep New
Traceback (most recent call last):
  File "/Users/andreas/bin/pwclient", line 463, in <module>
    main()
  File "/Users/andreas/bin/pwclient", line 411, in main
    action_list(rpc, filt, submitter_str, delegate_str)
  File "/Users/andreas/bin/pwclient", line 182, in action_list
    (person['name'], person['email'])
UnicodeEncodeError: 'ascii' codec can't encode character u'\xdf' in
position 32: ordinal not in range(128)
--->8---

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agotemplates: use custom templates for password change
Jeremy Kerr [Fri, 10 Dec 2010 04:24:14 +0000 (12:24 +0800)]
templates: use custom templates for password change

Add a couple of templates to keep the password change flow in the same
look & feel as the rest of the site.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoAdd link to password change form on user profile page
Sascha Silbe [Mon, 29 Nov 2010 17:44:29 +0000 (12:44 -0500)]
Add link to password change form on user profile page

Signed-off-by: Sascha Silbe <sascha-pgp@silbe.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agomodels: Fix HeaderParser import on python 2.4
Jeremy Kerr [Tue, 2 Nov 2010 17:23:53 +0000 (13:23 -0400)]
models: Fix HeaderParser import on python 2.4

We need to add an import for HeaderParser on python 2.4; email.Parser
appears to contain the right stuff.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoAdd support for git-pull requests
Jeremy Kerr [Fri, 22 Oct 2010 06:14:10 +0000 (14:14 +0800)]
Add support for git-pull requests

Add a a pull_url to the Patch object, and update the parser to look for
git-pull style emails.

Requires SQL migration script.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoparsemail: change tab to space
Jeremy Kerr [Fri, 22 Oct 2010 04:41:37 +0000 (12:41 +0800)]
parsemail: change tab to space

minor whitespace fix.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoparser: Recognize X-list list header
Ralf Baechle [Wed, 22 Sep 2010 15:17:30 +0000 (16:17 +0100)]
parser: Recognize X-list list header

Ecartis inserts X-list list headers.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agotests/updates: Add delegate clear test
Jeremy Kerr [Fri, 3 Sep 2010 04:40:43 +0000 (12:40 +0800)]
tests/updates: Add delegate clear test

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoforms: change MultiplePatchForm from a ModelForm to a Form
Jeremy Kerr [Fri, 3 Sep 2010 03:29:28 +0000 (11:29 +0800)]
forms: change MultiplePatchForm from a ModelForm to a Form

ModelForm was causing validation issues, especially with no-change
fields on required model fields.

Add a test for updating a required field (state) through
MultiplePatchForm.

Change it to a normal form, and call instance.setattr manually. This
makes the new test pass.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agotests/updates: Add multiple invalid state change test
Jeremy Kerr [Thu, 2 Sep 2010 11:11:53 +0000 (19:11 +0800)]
tests/updates: Add multiple invalid state change test

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoviews/patch: remove unused code
Jeremy Kerr [Thu, 2 Sep 2010 10:51:20 +0000 (18:51 +0800)]
views/patch: remove unused code

The number of times I've edited this code and wondered why nothing
changes...

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoforms.MultiplePatchForm: remove no-change fields on clean()
Jeremy Kerr [Thu, 2 Sep 2010 10:47:38 +0000 (18:47 +0800)]
forms.MultiplePatchForm: remove no-change fields on clean()

We need to remove no-change fields, as newer versions of django are
checking for proper types on validation.

Fixes MultipleUpdateTest.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agotests: Add multiple patch update test
Jeremy Kerr [Thu, 2 Sep 2010 10:46:37 +0000 (18:46 +0800)]
tests: Add multiple patch update test

Add a test for updating mulitple patches. Currently fails with django
1.1.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoviews/user: don't refer to request.POST for non-POST requests
Jeremy Kerr [Wed, 11 Aug 2010 08:28:25 +0000 (16:28 +0800)]
views/user: don't refer to request.POST for non-POST requests

We're ending up wth form errors due to using request.POST, which is
empty.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agocss: specify a sans-serif font
Jeremy Kerr [Tue, 10 Aug 2010 04:22:20 +0000 (12:22 +0800)]
css: specify a sans-serif font

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agotemplates: remove "beta"
Jeremy Kerr [Tue, 10 Aug 2010 04:17:03 +0000 (12:17 +0800)]
templates: remove "beta"

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoviews: implement CSRF protection
Jeremy Kerr [Tue, 10 Aug 2010 04:11:40 +0000 (12:11 +0800)]
views: implement CSRF protection

Since we've got the csrf token present, we may as well check it for
requests.

We're using RequestContext already (via PatchworkRequestContext), so we
just need to switch it on in the settings, and add an exemption on the
xmlrpc interface.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agotemplates: Add CSRF (cross-site request forgery) values to form posts
John 'Warthog9' Hawley [Thu, 24 Jun 2010 16:38:06 +0000 (09:38 -0700)]
templates: Add CSRF (cross-site request forgery) values to form posts

This is a fairly simple patch, basically it does what the error message
told me to do:
"add In the template, there is a {% csrf_token %} template tag inside each POST form that targets an internal URL."

Signed-off-by: John 'Warthog9' Hawley <warthog9@kernel.org>
13 years agoparser: decode stdin from utf-8
Jeremy Kerr [Tue, 10 Aug 2010 03:55:57 +0000 (11:55 +0800)]
parser: decode stdin from utf-8

We need to decode stdin from the patch parser as UTF-8, rather than
python assuming ascii.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agotests/utils: Specify content encoding on MIMEText() construction
Jeremy Kerr [Tue, 10 Aug 2010 03:41:58 +0000 (11:41 +0800)]
tests/utils: Specify content encoding on MIMEText() construction

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agotools: add simple patchwork-update-commits script
Jeremy Kerr [Tue, 10 Aug 2010 03:33:35 +0000 (11:33 +0800)]
tools: add simple patchwork-update-commits script

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agosql: Add uncommitted migration scripts
Jeremy Kerr [Tue, 10 Aug 2010 03:22:01 +0000 (11:22 +0800)]
sql: Add uncommitted migration scripts

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agodocs: fix apache2 references
Jeremy Kerr [Tue, 10 Aug 2010 03:18:50 +0000 (11:18 +0800)]
docs: fix apache2 references

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoRemove broken registration symlink
Jeremy Kerr [Tue, 10 Aug 2010 02:40:24 +0000 (10:40 +0800)]
Remove broken registration symlink

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agolib/apache2: Add WSGI Handler
Martin Krafft [Sun, 31 Jan 2010 01:32:45 +0000 (02:32 +0100)]
lib/apache2: Add WSGI Handler

Patchwork/Django can be run directly with WSGI, which is bound to be
faster and less complex than FastCGI. This patch provides the necessary
Apache configuration and the WSGI handler, as well as an update to the
docs.

Since python-flup is deprecated and WSGI supersedes FastCGI, it should
be(come) the preferred method. Hence I documented it first.

For the xmlrpc interface to work with WSGI, the HTTP authorization
information needs to be passed to the WSGI handler. This is done by
setting WSGIPassAuthorization On in the apache2 config file snippet.

Ref: http://www.arnebrodowski.de/blog/508-Django,-mod_wsgi-and-HTTP-Authentication.html

Signed-off-by: martin f. krafft <madduck@madduck.net>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agodocs: Document password-based pgsql login
Martin Krafft [Sun, 31 Jan 2010 02:03:10 +0000 (03:03 +0100)]
docs: Document password-based pgsql login

As an alternative to ident-based authentication for PostgreSQL, one can
use password-based authentication. This patch adds the alternative to
the docs.

Signed-off-by: martin f. krafft <madduck@madduck.net>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agodocs: reformat INSTALL
Jeremy Kerr [Tue, 10 Aug 2010 02:20:06 +0000 (10:20 +0800)]
docs: reformat INSTALL

Fix up some tabs.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agodocs: elaborate on lib/ dirs in INSTALL
Jeremy Kerr [Tue, 10 Aug 2010 02:17:58 +0000 (10:17 +0800)]
docs: elaborate on lib/ dirs in INSTALL

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agodocs: update INSTALL for commonly-available packages
Jeremy Kerr [Tue, 10 Aug 2010 02:16:31 +0000 (10:16 +0800)]
docs: update INSTALL for commonly-available packages

We probably don't need to download django or django-registration
anymore.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoRegistration framework maintained on bitbucket
Martin Krafft [Fri, 29 Jan 2010 21:03:52 +0000 (22:03 +0100)]
Registration framework maintained on bitbucket

The django-registration framework is now maintained on bitbucket, which
requires some changes to the in-tree symlink and the documentation.

Signed-off-by: martin f. krafft <madduck@madduck.net>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agotools: Update license for post-receive hook.
Jeremy Kerr [Tue, 10 Aug 2010 01:19:05 +0000 (09:19 +0800)]
tools: Update license for post-receive hook.

Martin has allowed distribution under the GPL.
 http://lists.ozlabs.org/pipermail/patchwork/2010-June/000263.html

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agotools: Add a simple sample Git post-receive hook
Martin Krafft [Thu, 4 Feb 2010 17:33:14 +0000 (17:33 +0000)]
tools: Add a simple sample Git post-receive hook

This patch adds a post-receive hook to lib/git, which can be used to
update Patchwork following a push to the Git repository.

Surely, it can be improved. One thing to do would be to export the state
map to git-config somehow.

Signed-off-by: martin f. krafft <madduck@madduck.net>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agotools: De-hyphenate Git commands in update-patchwork-status.py
Martin Krafft [Thu, 4 Feb 2010 16:18:54 +0000 (16:18 +0000)]
tools: De-hyphenate Git commands in update-patchwork-status.py

Even though update-patchwork-status.py doesn't really do anything yet,
it uses the ancient way to call Git commands, so this patch fixes that.

Signed-off-by: martin f. krafft <madduck@madduck.net>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agotemplates/patch-list: add default text for patches with no name
Jeremy Kerr [Tue, 10 Aug 2010 00:58:12 +0000 (08:58 +0800)]
templates/patch-list: add default text for patches with no name

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoviews/bundle/public: Lookup on user
Jeremy Kerr [Mon, 19 Jul 2010 06:17:35 +0000 (08:17 +0200)]
views/bundle/public: Lookup on user

Currently, the public bundle view is only looking up bundles by their
name. This may return multiple bundles if two users have bundles with
the same name.

This change adds the user to the bundle lookup.

Reported-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
13 years agoAdd TODO item: changing primary email addresses
Jeremy Kerr [Tue, 27 Apr 2010 02:41:04 +0000 (10:41 +0800)]
Add TODO item: changing primary email addresses

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agoviews: Use request scheme in sample pwclientrc file.
Jeremy Kerr [Fri, 19 Mar 2010 07:56:04 +0000 (15:56 +0800)]
views: Use request scheme in sample pwclientrc file.

Adapt the pwclientrc file to suit the current scheme in use.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agopwclient: allow authenticated https connections
Jeremy Kerr [Fri, 19 Mar 2010 07:20:47 +0000 (15:20 +0800)]
pwclient: allow authenticated https connections

If the xmlrpc server is using HTTPS, we need to adapt our custom
transport to use SafeTransport.make_connection

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Tested-by: Paul Mundt <lethal@linux-sh.org>
14 years agopwclient get: fix for handling messages encoded in UTF-8
Paul Menzel [Sun, 24 Jan 2010 20:06:57 +0000 (21:06 +0100)]
pwclient get: fix for handling messages encoded in UTF-8

Trying `pwclient get` with a message containing UTF-8 characters you
would get the following error.

    $ python -v pwclient get ID
    [...]
    # trying /usr/lib/python2.5/encodings/ascii.so
    # trying /usr/lib/python2.5/encodings/asciimodule.so
    # trying /usr/lib/python2.5/encodings/ascii.py
    # /usr/lib/python2.5/encodings/ascii.pyc matches /usr/lib/python2.5/encodings/ascii.py
    import encodings.ascii # precompiled from /usr/lib/python2.5/encodings/ascii.pyc
    Failed to write to subject.patch
    [...]

You can reproduce it with

    $ pwclient get http://patchwork.openembedded.org/patch/1440/

and the fix is the same as in 4fc6a16910e595401e919abde28cca436193e0dd
by Mauro Carvalho Chehab.

Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
14 years agopwclient: fallback to patch_get_by_hash
Jeremy Kerr [Tue, 24 Nov 2009 22:19:29 +0000 (09:19 +1100)]
pwclient: fallback to patch_get_by_hash

patch_get_by_project_hash isn't in older xmlrpc interfaces, so
fall back to patch_get_by_hash if we see an xmlrpc fault when
calling this function.

Reported-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agoAdjust postgres "grant all" script to new name of bundle table
Junio C Hamano [Tue, 3 Nov 2009 17:17:06 +0000 (09:17 -0800)]
Adjust postgres "grant all" script to new name of bundle table

Since c105cb0 (Initial bundle reordering support, 2009-01-29), the
patchwork_bundle_patches table and its associated id sequence does not
exist.  The script to grant appropriate privileges was not updated when
this change was made, and causes the set-up procedure described in
docs/INSTALL to fail.

This change adjust the script to grant appropriate access rights to
match the change in the DB schema.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agomodels: Add Reported-By to parsed comment fields
Jeremy Kerr [Fri, 23 Oct 2009 14:31:21 +0000 (10:31 -0400)]
models: Add Reported-By to parsed comment fields

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agodocs: Fix typo in INSTALL
Jeremy Kerr [Fri, 23 Oct 2009 14:30:06 +0000 (10:30 -0400)]
docs: Fix typo in INSTALL

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agopwclient,xmlrpc: Specify project for patch hash lookups
Jeremy Kerr [Thu, 22 Oct 2009 21:46:46 +0000 (17:46 -0400)]
pwclient,xmlrpc: Specify project for patch hash lookups

We may see the same hash for two patches if one is sent to two lists
tracked by patchwork.

This change adds a new xmlrpc method, patch_get_by_project_hash, which
adds the linkname parameter to the lookup. We need to add a new method
instead of replacing patch_get_by_hash, to avoid breaking existing
pwclient apps.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agopwclient: Add newline to 'no hash' message
Jeremy Kerr [Thu, 22 Oct 2009 21:30:05 +0000 (17:30 -0400)]
pwclient: Add newline to 'no hash' message

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agoCopy headers from original mail into patch mbox output
Jeremy Kerr [Wed, 30 Sep 2009 07:18:05 +0000 (17:18 +1000)]
Copy headers from original mail into patch mbox output

Preserve the Cc and To headers in the mbox output by parsing the saved
original headers, and adding them to the mail object.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agoUse psycopg2 as default DB engine
Jeremy Kerr [Wed, 30 Sep 2009 07:17:19 +0000 (17:17 +1000)]
Use psycopg2 as default DB engine

As the 'postgres' engine seems to have been deprecated, use the
postgres_psycopg2 engine instead

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agoAdd pwclient items to TODO
Jeremy Kerr [Fri, 18 Sep 2009 02:24:42 +0000 (10:24 +0800)]
Add pwclient items to TODO

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agoAdd Message-Id to xmlrpc patch_get_mbox headers
Thomas Gleixner [Thu, 17 Sep 2009 11:23:09 +0000 (13:23 +0200)]
Add Message-Id to xmlrpc patch_get_mbox headers

While trying to utilize patchwork for my daily workflow I noticed that
the xmlrpc patch_get_mbox function does not add the original message
id to the headers. That forces me to look it up with the browser which
is a major PITA.

Add Message-Id to the headers.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agopwclient fix for handling messages with UTF-8
Mauro Carvalho Chehab [Tue, 17 Feb 2009 10:34:51 +0000 (07:34 -0300)]
pwclient fix for handling messages with UTF-8

pwclient works fine viewing utf-8 messages, if you don't try to redirect stdout.

However, if you do things like pwclient view 5063 >/tmp/patch, it fails
due to the weird character handling logic in python:

Traceback (most recent call last):
  File "/usr/local/bin/pwclient", line 446, in ?
    main()
  File "/usr/local/bin/pwclient", line 411, in main
    print s
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 249: ordinal not in range(128)

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agoxmlrpc: Remove duplicated "name" field
Abhishek Kulkarni [Fri, 14 Aug 2009 18:03:56 +0000 (12:03 -0600)]
xmlrpc: Remove duplicated "name" field

Remove duplicated "name" field from the list of allowed
fields for a patch list filter in the XML RPC interface.

Signed-off-by: Abhishek Kulkarni <adkulkar@umail.iu.edu>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agotests: check some edge cases in bundle reordering tests
Eduardo Habkost [Thu, 13 Aug 2009 21:09:17 +0000 (18:09 -0300)]
tests: check some edge cases in bundle reordering tests

While testing BundleReorderTest, I felt like adding more test cases to
check if reordering is touching only the right patches on the bundle.

This increases the number of patches on the test bundle to 5, and
changes the code to do the following tests:

- Reorder all patches
- Reorder only the first 3 patches
- Reorder only the last 3 patches
- Reorder only the middle 3 patches
- On all above tests, check if the 'order' field on the BundlePatch
  objects is still consistent

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agotests: Fix 'order_start' on BundleReorderTest unit test
Eduardo Habkost [Thu, 13 Aug 2009 20:21:23 +0000 (17:21 -0300)]
tests: Fix 'order_start' on BundleReorderTest unit test

The 'order_start' parameter on the reorder form should be a patch ID,
not the 'order' field of BundlePatch.

This fixes the following test failure:

> ======================================================================
> FAIL: testBundleReorder (patchwork.tests.bundles.BundleReorderTest)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/mnt/common/code/admin/rh-patchwork/apps/patchwork/tests/bundles.py", line 358, in testBundleReorder
>     self.failUnlessEqual(response.status_code, 200)
> AssertionError: 404 != 200
>
> ----------------------------------------------------------------------
> Ran 123 tests in 4.527s
>
> FAILED (failures=1)

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agoparser: allow short-form List-Id headers
Jeremy Kerr [Sat, 1 Aug 2009 06:05:37 +0000 (16:05 +1000)]
parser: allow short-form List-Id headers

Some lists (eg, nongnu.org) have short-form List-Id headers. For
example:

List-Id: qemu-devel.nongnu.org

Although RFC 2919 prescribes that:

 list-id-header = "List-ID:" [phrase] "<" list-id ">" CRLF

we should allow for these headers anyway.

Based on an original patch from "J.H." <warthog9@kernel.org>.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agodocs: add note about -pass-header Authorization' to INSTALL
Jeremy Kerr [Sat, 11 Jul 2009 02:03:55 +0000 (12:03 +1000)]
docs: add note about -pass-header Authorization' to INSTALL

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agoFix unarchive action
Carl-Daniel Hailfinger [Wed, 8 Jul 2009 02:49:32 +0000 (12:49 +1000)]
Fix unarchive action

We want to un-archive, not re-archive.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agoAdd nacked-by tag
Jeremy Kerr [Wed, 8 Jul 2009 02:39:37 +0000 (12:39 +1000)]
Add nacked-by tag

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
14 years agoviews: order bundle correctly
Jeremy Kerr [Tue, 9 Jun 2009 05:49:32 +0000 (15:49 +1000)]
views: order bundle correctly

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
15 years agotemplates: close table cell in project maintainer list
Jeremy Kerr [Thu, 2 Apr 2009 06:16:42 +0000 (17:16 +1100)]
templates: close table cell in project maintainer list

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
15 years agoviews: separate project views into separate file
Jeremy Kerr [Thu, 2 Apr 2009 06:23:45 +0000 (17:23 +1100)]
views: separate project views into separate file

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
15 years agodocs: remove completed todo items
Jeremy Kerr [Fri, 27 Feb 2009 06:31:02 +0000 (17:31 +1100)]
docs: remove completed todo items

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
15 years agodocs: add items to todo
Jeremy Kerr [Fri, 27 Feb 2009 06:28:19 +0000 (17:28 +1100)]
docs: add items to todo

Additions to pwclient.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
15 years agotests: test creating bundles with existing names
Jeremy Kerr [Fri, 27 Feb 2009 02:43:08 +0000 (13:43 +1100)]
tests: test creating bundles with existing names

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>