aboutsummaryrefslogtreecommitdiff
Commit message (Expand)AuthorAge
* htdocs: Add bootstrap•••Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Damien Lespiau2015-11-05
* settings: Also define SERVER_EMAIL for email logs•••Django can send emails to admins on 500 HTTP errors when DEBUG is false. That looks handy. That mechanism uses SERVER_EMAIL for the From: address, which defaults to root@localhost and can cause problems in the email delivery. Use the same address than DEFAULT_FROM_EMAIL by default. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Acked-by: Stephen Finucane <stephen.finucane@intel.com> Damien Lespiau2015-11-05
* settings: Move DEFAULT_FROM_EMAIL to the core settings section•••DEFAULT_FROM_EMAIL is actually a django setting, not a patchwork one. v2: Capitalize the 'E' of 'Email' (Stephen Finucane) Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Acked-by: Stephen Finucane <stephen.finucane@intel.com> Damien Lespiau2015-11-05
* views: patch-list: show the 'Properties' update box for all users•••Any authenticated user should be able to change the properties of their own patches from the list view. They can already do so from the patch view and from pwclient. Now, authenticated users can perform 'Change state', 'Delegate to', and 'Archive' operations on multiple patches at a time (e.g., after 'select-all' on a bundle, or after selecting a few patches individually). We'll print an error message to the page for any patches which can't be updated (e.g., due to ownership). This fixes a usability issue that has been reported a few times. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Stephen Finucane <stephen.finucane@intel.com> Brian Norris2015-11-04
* parsemail: Don't catch exceptions when saving patches and comments•••We'd like to know when those operations fail in production so we can at least inspect what happened through the email send to settings.ADMINS in main(). Catching those exceptions early prevents that. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Acked-by: Stephen Finucane <stephen.finucane@intel.com> Damien Lespiau2015-10-27
* tests: Fix a typo in the MboxPassThroughHeaderTest description•••Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Acked-by: Stephen Finucane <stephen.finucane@intel.com> Damien Lespiau2015-10-27
* gitignore: Explicitly ignore dirs in lib/packages•••This file ignores everything at the moment. This doesn't look like a good idea, there are also jquery files there. We ignore django/ because installing django there is what currently is documented to do. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Acked-by: Stephen Finucane <stephen.finucane@intel.com> Damien Lespiau2015-10-27
* gitignore: Only ignore quilt files at the root of the repository•••So, say, a 'series' directory in the project (added in a later patch) doesn't get ignored. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Acked-by: Stephen Finucane <stephen.finucane@intel.com> Damien Lespiau2015-10-27
* wsgi.conf: Fix the path in the Directory directive•••The path in <Directory> didn't match the one defined in Alias. While at it, remove the unnecessary quotes. Reported-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Acked-by: Stephen Finucane <stephen.finucane@intel.com> Damien Lespiau2015-10-26
* docs: Add basic API guide•••Because it is now possible to access the auto-generated XML-RPC documentation, only provide a brief "HOWTO" on using the 'xmlrpclib' library and a note on how to find this autogenerated documentation. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Stephen Finucane2015-10-26
* views/xmlrpc: Remove unneeded '""' parameters•••These don't make semantic sense: if a user didn't provide a parameter then we should check for None. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Stephen Finucane2015-10-26
* views/xmlrpc: Add serialization documentation•••Add some documentation for the XML-RPC serializers, including examples. This will help developers understand exactly what the API *should* be returning for each given method. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Stephen Finucane2015-10-26
* views/xmlrpc: Add documentation for API methods•••This will be useful for populating the XML-RPC API documentation. Note that this uses the Google-style docstring format. This format is easier to read than the information-dense, "classic" Sphinx docstring format making it more suitable for use with pydoc (which does not do any post-processing and it used by the 'DocXMLRPCServer' module). If generating documentation using Sphinx, this will require the usage of the 'sphinx.ext.napoleon' extension. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Stephen Finucane2015-10-26
* views/xmlrpc: Add xmlrpc automatic documentation•••The DocXMLRPCServer module (standard library) provides documentation for XML-RPC dispatchers via pydoc. Use this module rather than reinventing the wheel. Also update a test that no longer makes sense (the GET method now retrieves documentation - it shouldn't redirect. Use PATCH instead). Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Stephen Finucane2015-10-26
* trivial: Clean up 'views/xmlrpc.py'•••Resolve some issues with the aforementioned file. These are mostly stylistic changes. Signed-off-by: Stephen Finucane <stephenfinucane@hotmail.com> Stephen Finucane2015-10-26
* parsemail: Mail error information to ADMINS when parsing fails•••We can use the built-in mechanism from django to send error emails when failing to parse a mail. The error mails will have contain the full guitly mail and the corresponding backtrace for debugging purposes. v2: Add 2 PEP8 blank lines (Stephen Finucane) v3: Remove one blank line (Stephen Finucane) Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Acked-by: Stephen Finucane <stephen.finucane@intel.com> Damien Lespiau2015-10-26
* flake: Restrict flake to the patchwork directory•••Right now flake will inspect everything in the root directory. We can avoid a bit of work, telling it to only look at the patchwork/ directory. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Acked-by: Stephen Finucane <stephen.finucane@intel.com> Damien Lespiau2015-10-26
* tox: Omit tests and manage.py when running coverage tests•••Having the tests in the coverage reports artifically improve the coverage percentage, because every line in tests is being run. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Reviewed-by: Stephen Finucane <stephen.finucane@intel.com> Damien Lespiau2015-10-26
* docs: Update Git URLs to GitHub•••Per move to GitHub: https://lists.ozlabs.org/pipermail/patchwork/2015-October/001873.html Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Stephen Finucane2015-10-26
* doc: Add CHANGELOG and UPGRADING docs•••The CHANGELOG document should describe the high level changes of the project. This will provide a human-readable way for people to evaluate the changes in each release. This file is based on the templates and general changelog "ethos" provided by 'Keep a CHANGELOG': http://keepachangelog.com/ The UPGRADING document provide instruction for system admininstrators managing patchwork deployments. At the moment, this document is a rename and minor reformatting of the existing 'docs/NEWS' document, but going forward documentation will be added for each new release. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Stephen Finucane2015-10-26
* pwclient: use argparse's error() function for bad input•••This reduces the boilerplate we need and provides a more consistent help output. e.g.: $ pwclient update -s FOO -c 1337 314159 1234567 usage: pwclient update [--help] [-h HASH] [-p PROJECT] [-c COMMIT-REF] [-s STATE] [-a {yes,no}] [ID [ID ...]] pwclient update: error: Declining update with COMMIT-REF on multiple IDs Signed-off-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Stephen Finucane <stephen.finucane@intel.com> Brian Norris2015-10-20
* pwclient: rework multi-command help text•••Our --help handling is convoluted and confusing, since we're hacking around using some of argparse's built-in features (like generating --help arguments for us). It seems like we were hacking around the conflict between -h used for hashes and -h used for automatic help flags. Fortunately, Python's argparse provides us with a 'conflict_handler' which will resolve these conflicts for us. Altogether, this patch means that 'pwclient --help' will not generate a full recursive print of all subcommand helps (arguably a good thing), but it provides better automatic formatting of all the supported subcommands and eliminates some awkward code. Sample runs: $ pwclient usage: pwclient [-h] {apply,git-am,get,info,projects,states,view,update,list,search} ... optional arguments: -h, --help show this help message and exit Commands: {apply,git-am,get,info,projects,states,view,update,list,search} apply Apply a patch (in the current dir, using -p1) git-am Apply a patch to current git branch using "git am". get Download a patch and save it locally info Display patchwork info about a given patch ID projects List all projects states Show list of potential patch states view View a patch update Update patch list List patches, using the optional filters specified below and an optional substring to search for patches by name search Alias for "list" Use 'pwclient <command> --help' for more info $ pwclient info --help usage: pwclient info [--help] [-h HASH] [-p PROJECT] [ID [ID ...]] positional arguments: ID Patch ID optional arguments: --help show this help message and exit -h HASH Lookup by patch hash -p PROJECT Lookup patch in project Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Stephen Finucane <stephen.finucane@intel.com> Brian Norris2015-10-20
* pwclient: require one or more of pwclient -{a,s}•••Previously, we required the -s flag for 'pwclient update'. But since we allow updating up to 2 different fields ('archived' and 'state'), drop the required flag, and just enforce that the user must provide -a, -s, or both. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Stephen Finucane <stephen.finucane@intel.com> Brian Norris2015-10-20
* pwclient: dict.iteritems() is deprecated in Python 3•••Just use dict.items(), since there are few fields and we don't really care about the extra copying. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Stephen Finucane <stephen.finucane@intel.com> Brian Norris2015-10-20
* pwclient: basic python3 support•••This fixes a few random issues to make the script work at least somewhat under python 3: - set the default encoding to utf-8 - handle xmlrpclib/xmlrpc.client module renames - handle ConfigParser/configparser module renames - add a unicode() stub for python 3 - fix old style class definition w/Filter - use list comprehension instead of map() - drop the unused version= keyword w/argparse The code still runs under python 2 the same as before, and now works for the most part under python 3 -- the handling of encoded content still needs some work, but that'll require more surgery, and is best left to another commit after this. Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Stephen Finucane <stephen.finucane@hotmail.com> Mike Frysinger2015-10-16
* pwclient: use print_function for better py3 compatibility•••The script already tries to use print like a function in many places but is really passing a parenthesized string. Import the print_function from the future module so that it actually works as intended. We also need to fix up a few latent print statements to make it work. Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Stephen Finucane <stephen.finucane@hotmail.com> Mike Frysinger2015-10-16
* pwclient: handle missing ~/.pwclientrc better•••The upgrade path will crash if ~/.pwclientrc doesn't exist, so add an explicit check for the file before we try to "upgrade" it. The default error messages don't mention the config file, so it can be a bit confusing what pwclient is complaining about when running. Signed-off-by: Mike Frysinger <vapier@chromium.org> Acked-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Stephen Finucane <stephen.finucane@hotmail.com> Mike Frysinger2015-10-16
* Highlight patches with Acked/Reviewed/Tested tags•••A little while ago, accounting of the number of Acked-by, Reviewed-by and Tested-by tags was added to patchwork. The count of such tags per patch is shown in the "A / R / T" column. However, since the values are shown for all patches regardless of whether they are zero or not, it makes it not very easy to spot the patches that have at least one Acked-by, Tested-by or Reviewed-by tag. Therefore, this patch proposes to replace a count of "0" by a "-". So patches with no tags will have "- - -" in their A/R/T column, and patches with some tags may get "1 - 1" for example. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: Stephen Finucane <stephen.finucane@intel.com> Thomas Petazzoni2015-10-16
* models: Resolve issues with Patch.state•••The initial migration introduced in '30bb271' was incomplete: running 'makemigrations' on the current codebase will produce a migration which could not be applied cleanly. The reason for this was the non-loading of initial data for the 'State' model. Fix this issue by only referencing the contents of the 'State' model when we have to (on save of a 'Patch' object), thus allowing the user suitable time to apply this initial data. Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Acked-by: Damien Lespiau <damien.lespiau@intel.com> Stephen Finucane2015-10-16
* login: Focus the username field on load•••Wolfram wanted a small usability improvement that's easy to add: placing the cursor automatically in the user name field when loading the login page. Suggested-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Acked-by: Stephen Finucane <stephen.finucane@intel.com> Damien Lespiau2015-09-18
* templates: Pull jquery into base.html•••Bootstrap needs jquery for its own JS facilities, so include it on every page. Acked-by: Stephen Finucane <stephen.finucane@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Damien Lespiau2015-09-18
* tests: Move 'reverse' calls inside 'setUp'•••Django creates test databases after it loads tests. However, any operations that exist at class level will be executed before this database is created. Fix the instances of this issue (mostly 'reverse' calls or similar) by moving the calls into the relevant 'setUp' functions for each test. Acked-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Stephen Finucane2015-09-18
* settings: Move 'TEST_RUNNER' to correct location•••Try to keep the order/structure of this file intact for as long as possible. Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Stephen Finucane2015-09-17
* settings: Fix deprecated 'TEST_CHARSET' warning•••Resolve a 'RemovedInDjango19Warning' with the 'TEST_CHARSET' option. Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Stephen Finucane2015-09-17
* trivial: Add missing licenses to 'management'•••Acked-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Stephen Finucane2015-09-17
* trivial: Resolve PEP8 issues with 'management'•••(Added by Damien) This also moves from sys.stdout/sys.stderr to self.stdout/self.stderr as adviced by the Django documentation. Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Stephen Finucane2015-09-17
* management: Resolve a bug with 'retag' command•••Calling 'retag' without a list of patch IDs will cause an Exception. This is due to an invalid attempt to filter patches using this empty argument. Resolve this by only filtering when we have arguments to filter with. Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Stephen Finucane2015-09-17
* management: Resolve bugs with 'cron' command•••Resolve two bugs with the script: - There's no 'main' function to call - A variable is misnamed Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Stephen Finucane2015-09-17
* trivial: Remove dead imports from 'tests'•••Remove some unused imports. This keeps PEP8 happy. Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Stephen Finucane2015-09-17
* tests/test_user: Add "profile POST" tests•••POSTing to the 'profile' view will allow configuration of some user profiles, but this was not being tested. Resolve this. Acked-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Stephen Finucane2015-09-17
* tests/test_user: Add "profile unlink" tests•••The 'link' view was not being tested. Resolve this with tests for all paths. Acked-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Stephen Finucane2015-09-17
* trivial: Remove Python < 2.5 code•••None of the supported versions of Django (currently 1.6 -> 1.8) support Python < 2.6. There is no need to keep code for older versions of Python around. Acked-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Stephen Finucane2015-09-17
* trivial: Resolve some PEP8 issues•••Acked-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Stephen Finucane2015-09-17
* trivial: Remove dead files/code•••Remove some swathes of code that are no longer used, some of which contains issues that renders them useless. This unused code was initially discovered by using 'coverage.py' followed by manual inspection. Acked-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Stephen Finucane2015-09-17
* docs: Rewrite documentation•••The INSTALL and HACKING documents are an important guide for new patchwork users and developers and should be as informative as possible. A number of changes were needed to these documents owing to the out-of-date or incomplete information they contained. These changes include: * Removing references to the dead mod_python/flup projects * Adding references to Gunicorn+nginx, which a credible modern alternative to Apache+mod_wsgi * Providing explanatory links to concepts/tools like ident-based authentication and tox * Referencing the newer tools available to developers, like tox and the 'requirements.txt' files * Integration with mkdocs, with eye on eventual publishing of documentation to ReadTheDocs or equivalent. These changes result in a significant rewrite which should hopefully lower the barrier to entry for people wishing to use or develop patchwork. Acked-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Stephen Finucane2015-09-17
* tox: Update versions of Django to be tested•••Since patchwork now supports Django 1.8 and no longer support 1.5, it is necessary to update the tox targets to validate this new subset of supported Django versions. In addition, the paths to the requirements.txt files were not updated as part of a rebase. Correct this oversight. Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Stephen Finucane2015-09-17
* Add missing explicit state fixture load•••The 'patchwork: Explicitly load states fixtures' change introduced explicit state loading into many of the tests, but missed one. Correct this oversight. Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Stephen Finucane <stephen.finucane@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Stephen Finucane2015-09-17
* patchwork/templates: Suppress cycle template tag warning•••Running on django 1.7 gives a warning: RemovedInDjango18Warning: 'The `cycle` template tag is changing to escape its arguments; the non-autoescaping version is deprecated. Load it from the `future` tag library to start using the new behavior. Although this change doesn't affect this template, suppress the warning by loading from the future library. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Jeremy Kerr2015-06-05
* patchwork/views: request.REQUEST is deprecated in django 1.8•••.. so do explicit accesses to request.GET or request.POST. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Jeremy Kerr2015-06-05
* patchwork/parser: Adapt for new unsaved-foreign-key behaviour in django 1.8•••Django 1.8 no longer supports assignment of unsaved models to ForeignKey fields: File "/home/jk/devel/patchwork/patchwork/tests/test_patchparser.py", line 75, in setUp (self.patch, self.comment) = find_content(self.project, email) File "/home/jk/devel/patchwork/patchwork/bin/parsemail.py", line 231, in find_content headers = mail_headers(mail)) File "/home/jk/devel/patchwork/lib/python/django/db/models/base.py", line 468, in __init__ setattr(self, field.name, rel_obj) File "/home/jk/devel/patchwork/lib/python/django/db/models/fields/related.py", line 668, in __set__ (value, self.field.rel.to._meta.object_name) ValueError: Cannot assign "<Patch: Test Subject>": "Patch" instance isn't saved in the database. Even though we'd be guaranteed to save the patch before the comment, we need to avoid this error. This change defers the assigment of Comment.patch until we know we have a saved Patch instance. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Jeremy Kerr2015-06-05