summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove references to django.conf.urls.defaultsJeremy Kerr2014-04-212-2/+2
| | | | | | | django.conf.urls.defaults has been deprecated, replace with django.conf.urls, and remove the 'import *' syntax. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views/order: Apply default ordering as secondaryJeremy Kerr2014-04-212-3/+15
| | | | | | | | | | If we're ordering by a certain non-default field, then the ordering of patches with that same field will be arbitrary. This change applies the default as a secondary ordering, so we're not left with an arbitrary sub-order. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* post-receive: Fix error message when pushing to an unmapped branchCarl Worth2014-01-291-1/+1
| | | | | | | | | | | | | | | | Previously, if STATE_MAP contained only refs/heads/master and a user pushed to a branch such as refs/heads/stable, the hook emitted a misleading error message: E: no mapping for refname refs/heads/master Fix this by correctly printing the reference being looked for, rather than the reference most recently found in STATE_MAP. Also, reword the message slightly to point the user to STATE_MAP and to use an actual word "branch" instead of the non-word "refname". Signed-off-by: Carl Worth <cworth@cworth.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* docs: Add a pointer to the git post-receive hookCarl Worth2014-01-291-0/+17
| | | | | | | | | | I had to stumble upon this feature before I realized it was here inside the tools directory all along. This documentation should make it easier for the next person coming along looking for a patchwork git hook. Signed-off-by: Carl Worth <cworth@cworth.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Make the post-receive hook more efficient (using pwclient info, not view)Carl Worth2014-01-291-2/+2
| | | | | | | | | | | | | | Older versions of patchwork shipped with a version of pwclient that had the view command, but not info command. Now that info exists, it's inefficient to use it to obtain the patchwork ID value, (since it requires the server to send the entire patch content in response to an XML RPC request). So be kind to the server by using info instead, (which has a small, fixed-length response). Signed-off-by: Carl Worth <cworth@cworth.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tools/post-receive.hook: don't update the previously pushed commitCarl Worth2014-01-291-1/+1
| | | | | | | | | | Previously, the post-receive hook would always examine one commit that had been previously pushed, (when the purpose of the hook is only to example newly-pushed commits). We fix this by simply dropping the '^' in the commit-range specification. Signed-off-by: Carl Worth <cworth@cworth.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pwclient: fix handling UTF-8 in patch infoAndreas Bießmann2014-01-281-1/+1
| | | | | | | | | | | | | | | | | | | This patch fixes following error when redirecting 'pwclient info' output: ---8<--- andreas@dockstar % pwclient info 295268 > /tmp/test.out Traceback (most recent call last): File "/home/andreas/bin/pwclient", line 508, in <module> main() File "/home/andreas/bin/pwclient", line 471, in main action_info(rpc, patch_id) File "/home/andreas/bin/pwclient", line 242, in action_info print("- %- 14s: %s" % (key, value)) UnicodeEncodeError: 'ascii' codec can't encode character u'\xdf' in position 29: ordinal not in range(128) --->8--- Signed-off-by: Andreas Bießmann <andreas@biessmann.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* docs: We're targetting django 1.5 nowJeremy Kerr2013-10-131-3/+3
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add a config option to FORCE_HTTPS_LINKSKonstantin Ryabitsev2013-10-132-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | In situations where SSL is terminated at the load-balancer, we cannot rely on guessing the scheme based on whether patchwork itself was accessed via http or https, since the last-leg is always going to be done over http. Unfortunately, wrongly using http:// URLs results in unusable .pwclientrc files, since xmlrpc does not handle http->https redirects and instead displays a traceback. This change introduces a FORCE_HTTPS_LINKS option, which forces pwclientrc links to always return "https" regardless of how the project itself is accessed. It appears that the http/https check is currently only used for generating pwclientrc -- a lot of other places seem to hardcode "http://" and rely on the server to transparently upgrade the connection. This is not a secure approach (it allows for MITM and SSL-Strip attacks) and therefore all places currently hardcoding http://{{site.domain}} and similar should be switched to using the "sheme" variable, the same as done for generating pwclientrc files. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/sql/migration: Fix column names for MySQL/MariaDBRalf Baechle2013-10-131-3/+3
| | | | | | | | | | | | | | | | | The first issue is that patchwork was no longer accepting new patches via the apps/patchwork/bin/parsemail.sh script. When I was trying to invoke it manually, it only printed "no project found". I was able to figure out that this was caused by changes to the database scheme which are taken care of by the two SQL scripts: lib/sql/migration/012-project-add-columns.sql lib/sql/migration/013-bundle-names.sql The catch - these first script don't run with MySQL - or rather MariaDB that Fedora has switched to. MariaDB doesn't like the quotes around the table and column names. Patch below. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests: Use strings from fields module for error testsJeremy Kerr2013-10-133-9/+11
| | | | | | | Rather than hard-coding expected error messages, grab the values from the fields module, and expose through the test utils. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Django 1.5 compatibility fixesRalf Baechle2013-10-1326-56/+56
| | | | | | | Django 1.5 wants plenty of quotes scattered over the templates. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parser: Add support for rename-only patchesJeremy Kerr2013-10-134-0/+98
| | | | | | | | | | | | | Yann E. MORIN reported a problem where patchwork drops patches with only renames: http://lists.busybox.net/pipermail/buildroot/2013-October/079999.html This change fixes the issue by adding a new state for patch 'meta' headers: header test which is not parsed as a hunk, but has the same behaviour as a hunk in that it will cause the patchbuf to be populated. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views/base: Implement limit for submitter autocompletionJeremy Kerr2013-10-133-6/+30
| | | | | | | Add a limit parameter to the completion view, and pass a limit of 20 results in the javascript. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views/base: Include email addresses in submitter autocomplete searchJeremy Kerr2013-10-133-1/+50
| | | | | | | | Currently, we only search names, which is a problem for Person objects with only an email address set. This change includes the email addresses in the search. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* docs: also mention that ROOT_DIR needs to be updatedFlorian Fainelli2013-10-041-0/+1
| | | | | | | | | When the patchwork installation resides in the non-default location (/srv/patchwork) make sure that local_settings.py also gets updated with a proper ROOT_DIR value otherwise various problems will happen. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* sql: remove non-existing auth_message tableFlorian Fainelli2013-10-041-1/+0
| | | | | | | | During a recent installation the grant-all MySQL script was erroring out because the "auth_message" table does not exist, remove it. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* docs: fix INSTALL instructions regarding DjangoFlorian Fainelli2013-10-041-2/+2
| | | | | | | | | | Django is no longer accessible using the old Subversion URL, update that to the Github repository. Besides, the command-line used to perform the "syncdb" operation does not work because we are off by one directory in the filesystem, fix that. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* sql: update grant-all.mysql.sqlFlorian Fainelli2013-10-041-1/+1
| | | | | | | | The MySQL grant all script has a typo on the table "patchwork_bundle_patches" vs "patchwork_bundlepatch" update that. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* docs: update MySQL documentation bitsFlorian Fainelli2013-10-041-1/+13
| | | | | | | | | | | | The MySQL documentation bits where missing a few important details for installation setup to succeed like: - having proper python-mysqldb support - overriding the DATABASE_ENGINE to "mysql" for django to succeed in the "syncdb" operation Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* notifications: add project name to patch update notificationWolfram Sang2013-06-163-2/+6
| | | | | | | | | | Based on a feature request & patch from Wolfram Sang <wsa@the-dreams.de>. Notifications may span multiple projects, so include a summary in the subject line, and detail in the header. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Don't use total_seconds for python < 2.7Konstantin Ryabitsev2013-06-161-2/+2
| | | | | | | | | | The total_seconds function was added to datetime in python-2.7. For compatibility with previous versions of python, use its suggested equivalent (except drop microseconds, since we don't care about them in this context). Signed-off-by: Konstantin Ryabitsev <mricon@kernel.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* js: Add jquery and jquery tablednd pluginsJeremy Kerr2013-06-168-15/+331
| | | | | | | | | | | | Based on a change from Andreas Bießmann <andreas@biessmann.de>. Rather than requiring a download of the jquery library + tablednd plugin, commit these to the repository. In doing so, we upgrade to version 1.10.1 of jqeury, and the current stable tablednd. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/mboxviews: Add test for header-supplied datesJeremy Kerr2013-06-101-0/+15
| | | | | | | Check that a Date: header in the original message is equivalent to the header generated in the mbox output. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views/mbox: Use Date: header from original messageJeremy Kerr2013-06-102-2/+12
| | | | | | | | | | | Since we use UTC for internal date storage, we lose the timestamp info from the original patch submissions. This means that the mbox views (which are typically passed through to SCM commit logs) lose the timezone information. This change uses the Date header from the original message, if possible. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views: Move mbox handling from models to viewsJeremy Kerr2013-06-105-88/+92
| | | | | | | | Mbox generation is related to views, not the models themselves. This change creates a patch_to_mbox function in the views/ directory, which the actual view handlers use instead of Patch.mbox(). Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* models: Fix invalid dates in patch mboxJeremy Kerr2013-06-102-2/+28
| | | | | | | | | | | | | Currently, the Date header in mbox views is incorrect; datetime.datetime.utctimetuple assumes that the date is in the local timezone, but we keep all dates as UTC. This change replaces utctimetuple with a manual calculation of the seconds-since-epoch timestamp, which email.utils.formatdate requires. We add a testcase for this too. Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* models: fix From header in mbox viewAndreas Bießmann2013-05-141-1/+5
| | | | | | | | | | | | The From header in mbox view was corrupt for patch submitters with non-ASCII characters in their names. RFC 2822 requires to retain the mail as ASCII in braces '<' and '>' while the name should be coded. Before we coded the whole string which led to some MUA misinterpret the From header (while git could manage it). Fix this by coding just the name and let the email untouched. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests/mboxviews: add test for correct From headerAndreas Bießmann2013-05-141-0/+25
| | | | | | | | Currently we produce corrupted 'From' header in mbox output when senders name contains non ASCII characters. Provide a test to show this issue. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* bundles: Don't display 'Change order' button on public bundle viewJeremy Kerr2013-04-212-1/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* bundles: Don't allow slashes in bundle namesJeremy Kerr2013-04-203-1/+13
| | | | | | | | Because bundle names are used in URLs, we don't want slashes in them. Include a SQL migration script. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* bundles: Remove separate public bundle viewsJeremy Kerr2013-04-2010-103/+205
| | | | | | | | | | | | Having two views for bundles (public and non-public) can cause confusion when bundle owners want to share a URL; it's not obvious that the private URL isn't shareable. This change removes the private URLs, and puts all bundles under the /bundle/<username>/<bundlename>/ URL space. For non-public bundles, this will just 404 for non-owners. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* forms: Only pass post data to multiplepatchform if that was what was submittedJeremy Kerr2012-12-301-1/+8
| | | | | | | | | | | | | When updating bundles, we get a spurious error message in the MultiplePatchForm; it's performing validation on the blank form data. This change only passes the post data to the MuliplePatchForm if we detect (through data['form']) that it was the MultiplePatchForm that was submitted. This fixes the current testsuite failure. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests/bundle: Check for form errors during bundle updatesJeremy Kerr2012-12-301-0/+23
| | | | | | | | | | Add a check for patchform errors during bundle update operations, both when logged in as a maintainer and a regular user. This exposes a problem with the maintainer patchform: we see an unexpected form error with the state input. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests/bundle: Add bundle update tests, fix missing action behaviourJeremy Kerr2012-12-302-0/+55
| | | | | | | Add a couple of tests for the bundle update views. This exposes a problem with no action is specified, so fix this too. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* templates/bundle: Unify public bundle meta informationJeremy Kerr2012-12-301-2/+8
| | | | | | | | Currently, the public bundle meta information (the download link before the list of patches) differs from that of the private bundle view. This change unifies this information with the private view. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests/bundle: Add tests for public bundle viewsJeremy Kerr2012-12-301-0/+27
| | | | | | | Ensure that public bundles are accessible, and that private ones are not. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* views/bundle: Allow downloading public bundle as mboxSimo Sorce2012-12-303-5/+17
| | | | | | | | | | | Downloading single patches anonymously is allowed, we may as well allow downloading public bundles as mboxes. This patch also changes the file name to be bundle-<id>-<name>.mbox so that the file name is unique even if bundle names are reused. Signed-off-by: Simo Sorce <idra@samba.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pwclient: Add a little more space in 'pwclient list'Doug Anderson2012-12-301-3/+3
| | | | | | | | New patch IDs are now 7 digits long on patchwork.kernel.org. Give a little more space. Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* xmlrpc: Avoid trying to marshall None for people with no nameDoug Anderson2012-12-301-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a person sent patches with no real name, they may have None for their name. In this case just use their email address as their name. The previous pwclient error that would show up looks like: $ pwclient list -w anonymous@example.com Traceback (most recent call last): File ".../pwclient", line 631, in <module> main() File ".../pwclient", line 570, in main action_list(rpc, filt, submitter_str, delegate_str, series_str) File ".../pwclient", line 316, in action_list ids = person_ids_by_name(rpc, submitter_str) File ".../pwclient", line 241, in person_ids_by_name people = rpc.person_list(name, 0) File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__ return self.__send(self.__name, args) File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request verbose=self.__verbose File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request return self.single_request(host, handler, request_body, verbose) File "/usr/lib/python2.7/xmlrpclib.py", line 1297, in single_request return self.parse_response(response) File "/usr/lib/python2.7/xmlrpclib.py", line 1473, in parse_response return u.close() File "/usr/lib/python2.7/xmlrpclib.py", line 793, in close raise Fault(**self._stack[0]) xmlrpclib.Fault: <Fault 1: "<type 'exceptions.TypeError'>:cannot marshal None unless allow_none is enabled"> Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pwclient: Add command for printing patch infoDoug Anderson2012-12-301-2/+14
| | | | | | | | This command prints raw information that patchwork has about a patch. This can be useful for debugging problems with patchwork. Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* templates: patchwork project URL fixesJeremy Kerr2012-11-292-2/+2
| | | | | | We need a trailing slash, and to update the URL in the about page too. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* templates: Update patchwork project URLJeremy Kerr2012-11-151-1/+1
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* templates: Add link to the projects website in the projects viewSimo Sorce2012-11-151-2/+7
| | | | | | | | Allows the casual visitor to check out what all these projects actually are. Signed-off-by: Simo Sorce <idra@samba.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add URL and SCM data to projectsSimo Sorce2012-11-153-0/+26
| | | | | | | | | | | | | | | This allows us to display friendly links to the project website, web SCM UI and SCM URL. For example for the patchwork project these could be set to: web_url: http://jk.ozlabs.org/projects/patchwork/ scm_url: git://ozlabs.org/home/jk/git/patchwork webscm_url: http://git.ozlabs.org/?p=patchwork;a=tree Requires a DB schema upgrade Signed-off-by: Simo Sorce <idra@samba.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Add shortcut to admin panelSimo Sorce2012-11-051-0/+3
| | | | | | | | This patch adds a shortcut to the admin panel but only for users that are members of staff. Signed-off-by: Simo Sorce <idra@samba.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pwclient: lookup patch_id given Message-IdBen Myers2012-11-051-2/+9
| | | | | | | | Add a pwclient search option '-m' to look up a patch id given a Message-id. This is useful for automation and mailer hooks. Signed-off-by: Ben Myers <bpm@sgi.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Fix grant scriptSimo Sorce2012-10-251-2/+1
| | | | | | | | patchwork_patchchangenotification_id_seq does not exist, so running this script simply fails with a rollback Signed-off-by: Simo Sorce <idra@samba.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* bundles: Add check for duplicate bundlesJeremy Kerr2012-10-222-0/+36
| | | | | | ... rather than failing with an IntegrityError. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* requestcontext: Initialise 'messages' context varJeremy Kerr2012-10-081-1/+4
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>