aboutsummaryrefslogtreecommitdiff
path: root/apps
Commit message (Collapse)AuthorAge
* notifications: add project name to patch update notificationWolfram Sang2013-06-16
| | | | | | | | | | 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-16
| | | | | | | | | | 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>
* test/mboxviews: Add test for header-supplied datesJeremy Kerr2013-06-10
| | | | | | | 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-10
| | | | | | | | | | | 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-10
| | | | | | | | 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-10
| | | | | | | | | | | | | 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-14
| | | | | | | | | | | | 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-14
| | | | | | | | 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-21
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* bundles: Don't allow slashes in bundle namesJeremy Kerr2013-04-20
| | | | | | | | 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-20
| | | | | | | | | | | | 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-30
| | | | | | | | | | | | | 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-30
| | | | | | | | | | 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-30
| | | | | | | 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>
* tests/bundle: Add tests for public bundle viewsJeremy Kerr2012-12-30
| | | | | | | 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-30
| | | | | | | | | | | 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-30
| | | | | | | | 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-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-30
| | | | | | | | 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>
* Add URL and SCM data to projectsSimo Sorce2012-11-15
| | | | | | | | | | | | | | | 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>
* pwclient: lookup patch_id given Message-IdBen Myers2012-11-05
| | | | | | | | 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>
* bundles: Add check for duplicate bundlesJeremy Kerr2012-10-22
| | | | | | ... rather than failing with an IntegrityError. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* requestcontext: Initialise 'messages' context varJeremy Kerr2012-10-08
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* settings: Use new class for auth context processorJeremy Kerr2012-10-08
| | | | | | Since django 1.2 auth module is in contrib, not core. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* settings: Use class-based template loading APIJeremy Kerr2012-10-08
| | | | | | | The TEMPLATE_LOADERS setting changed in django-1.2. Template loaders are now based on calsses rather than callables. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* settings: Add message middlewareJeremy Kerr2012-09-06
| | | | | | This seems to be required for admin updates. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* pwclient: Pass input to git-am as a UTF-8 stringJeremy Kerr2012-09-04
| | | | | | .. to prevent ascii codec exceptions. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* templates: Don't rely on bool(Page)Jeremy Kerr2012-06-17
| | | | | | | | | The behaviour of bool(Page) changed in django 1.4 - it no longer evaluates to False when page has no objects. When checking for an empty patch list, use page.paginator.count. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* models: Add connection parameter for HashField.db_type.Jeremy Kerr2012-05-04
| | | | | | This is required by django-1.4. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests: Find test data relative to file locationDirk Wallenstein2012-05-04
| | | | | | | Make test execution independent of the current directory. Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests/notifications: Add test for escaped patch namesJeremy Kerr2012-05-01
| | | | | | .. to test for the fix introduced in 18986b7e. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests: Check the right optin emailDirk Wallenstein2012-05-01
| | | | | Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests/patchparser: abstract delegate and state testingJeremy Kerr2012-04-30
| | | | | | No need to repeat the same query logic. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests/patchparser: don't assume PK valuesJeremy Kerr2012-04-30
| | | | | | | PK values may not start at 1 for each test, so remove filters that assume this. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests: Add tests for explicit delegate and state requestsDirk Wallenstein2012-04-30
| | | | | Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Use an explicit initial default patch stateDirk Wallenstein2012-04-30
| | | | | | | | | | | This will make editing states through the admin UI less error-prone, and will facilitate parsing patches when relying on a default state, as well as testing. Use the explicit default state when parsing mails. Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* parser: allow words starting with "diff" at beginning of lineStefan Hajnoczi2012-01-14
| | | | | | | | | | | | | | | The patch parser splits emails incorrectly when the comment contains a line whose first word starts with "diff" (like "difficult" or "different"). For a real-life example of an email that triggers this bug, see http://patchwork.ozlabs.org/patch/135291/. Fix the issue by checking for a space after "diff". Add DiffWordInCommentTest to the test suite. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests/patchparser: Add CVS format patch testJeremy Kerr2011-12-08
| | | | | | | Test that CVS-formatted patches are parsed correctly, and that we capture the correct 'Index: ' metadata. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* tests: add abstract mbox parsing testJeremy Kerr2011-12-08
| | | | | | | Add a new class to handle mbox-parsing code, abstracting what is done by the current git-pull tests. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* filters: handle utf-8 characters when building filter querystringJeremy Kerr2011-12-08
| | | | | | | | | | | | | Currently, we build the filter querystring by passing the raw string to urllib.quote, which expects an encoded string. When the raw string (in this case, a unicode object) contains a unicode character, quote() raises a KeyError. This fixes the problem by encoding the parameter name and values to UTF-8 first. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* patchwork: new pwclient git-am actiondavid decotigny2011-11-25
| | | | | | | | | This commit adds a new "pwclient git-am" action which applies given patch ID on the current git branch using "git am". It's convenient to keep track and authorship of patches applied locally from a patchwork server. Signed-off-by: David Decotigny <david.decotigny@google.com>
* parser: allow other protocol types in pull-request handlingJeremy Kerr2011-11-25
| | | | | | Change the parser's regex to allow other protocol types, not just git:// Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* models: Update Person & UserProfile object whenever User is savedJeremy Kerr2011-09-19
| | | | | | | | | | | | Currently, UserProfiles are only saved on creation of the User object, before the first_name and last_name attributes are set. This means that we fallback to using the User.username value as the new Person.name. This change modifies User's post-save signal to always update the Person object, both on creation and updates. This means we get the proper name appearing on Person instances. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Merge branch 'notifications'Jeremy Kerr2011-09-19
|\
| * notifications: implement opt-outJeremy Kerr2011-04-14
| | | | | | | | | | | | Check for opt-out status before sending notification mail. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * notifications: Add NOTIFICATION_FROM_EMAIL settingJeremy Kerr2011-04-14
| | | | | | | | | | | | Allow a separate From: address for notificaton emails. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * notifications: Add code to send notificationsJeremy Kerr2011-04-14
| | | | | | | | | | | | | | | | | | Add a function (patchwork.utils.send_notifications) to process the PatchChangeNotification queue. We try to group mail to the same sender, by waiting settings.NOTIFICATION_DELAY_MINUTES to allow other notifications to arrive. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * models: Add PatchChangeNotification and record patch state changesJeremy Kerr2011-04-14
| | | | | | | | | | | | | | | | | | Add a PatchChangeNotification model to keep track of changes to a patch's state. Hook this up to Patch's pre_save signal. Requires a DB schema upgrade. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * Add email opt-out systemJeremy Kerr2011-04-14
| | | | | | | | | | | | | | | | | | | | | | We're going to start generating emails on patchwork updates, so firstly allow people to opt-out of all patchwork communications. We do this with a 'mail settings' interface, allowing non-registered users to set preferences on their email address. Logged-in users can do this through the user profile view. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
| * registration: use EmailConfimation rather than separate registration appJeremy Kerr2011-04-14
| | | | | | | | | | | | | | | | | | | | Since we have infrastructure for email confirmations, we no longer need the separate registration app. Requires a migration script, which will delete all inactive users, including those newly added and pending confirmation. Use carefully. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>