summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* docs: Covert usage guideStephen Finucane2017-04-18
| | | | Signed-off-by: Stephen Finucane <stephen@that.guru>
* docs: Convert README, indexStephen Finucane2017-04-18
| | | | | | | We can remove the Markdown README but must keep the index page until all docs are migrated. Signed-off-by: Stephen Finucane <stephen@that.guru>
* docs: Add skeleton for Sphinx docsStephen Finucane2017-04-18
| | | | | | | | This is mostly the output of 'sphinx-quickstart' with all non-HTML build cruft removed and Sphinx minimum version set to 1.5. A tox target is included and the output of the docs build ignored. Signed-off-by: Stephen Finucane <stephen@that.guru>
* Display count of patchesDaniel Axtens2017-04-15
| | | | | | | | | Minor UI tweak - show the number of patches left in the current view. Suggested-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Stephen Finucane <stephen@that.guru>
* 'mpe mode': click to copy patch IDsDaniel Axtens2017-04-15
| | | | | | | | | | | | | If 'Show Patch IDs' is turned on in settings, add an extra column to the patch list, with buttons showing the patch IDs. The buttons copy the patch IDs to the clipboard. JavaScript inspired by https://github.com/Triforcey/clip-j and many many StackOverflow answers. Suggested-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Stephen Finucane <stephen@that.guru>
* Put download buttons at the top as wellDaniel Axtens2017-04-15
| | | | | | | Suggested by a few people. Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Stephen Finucane <stephen@that.guru>
* parser: Don't extract diffs from repliesStephen Finucane2017-04-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In '2a915efd', a check was added to ensure mails prefixed with 'RE:' or similar would not be parsed as patches. By time this check actually happens, any patches had already been extracted from the mail thus these patches were re-added to the mail content before saving the comment. Unfortunately, this didn't take into account cases where a patch or diff was not the last part of a mail but rather located somewhere in the middle of the content: Introduction content Diff or patch content *** Additional content This would result in mangling of the mail as the patch would _always_ be appended to the end: Introduction content Additional content Diff or patch content *** Handle this by only breaking a mail into a comment and a diff if there is any possibility that we might want to use that diff. Signed-off-by: Stephen Finucane <stephen@that.guru> Fixes: 2a915efd ("parser: fix wrong parsing of diff comments") Closes-bug: #95
* parsearchive: Support maildirsStephen Finucane2017-04-15
| | | | | | | | | At present, the 'parsearchive' command only supports parsing of mboxes. Expand this to support maildirs. This allows us to rewrite the 'parsemail-bulk' script to deliver much improved performance. Signed-off-by: Stephen Finucane <stephen@that.guru> Suggested-by: Daniel Axtens <dja@axtens.net>
* sql: Update permissions on grant-all scriptsStephen Finucane2017-04-15
| | | | | | | Allow access to Submission, CoverLetter, Series, SeriesReference and SeriesPatch. Signed-off-by: Stephen Finucane <stephen@that.guru>
* Capture stderr for 'git describe'Stephen Finucane2017-04-15
| | | | | | | Capture the error messages thrown if git is not installed. Signed-off-by: Stephen Finucane <stephen@that.guru> Fixes: 7b07b71e ("templates: Add Patchwork version")
* Don't limit selenium to the any MINOR versionpyup-bot2017-04-14
|
* Update djangorestframework from 3.5 to 3.6pyup-bot2017-04-14
|
* parser: cut off patch names after 255 charactersDaniel Axtens2017-04-09
| | | | | | | | | | Our model limits the length of patch names to 255 characters. Enforce this cutoff in the parser, otherwise we throw an exception and fail to store patches with stupidly long titles. Reported-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Stephen Finucane <stephen@that.guru>
* views: Link to project from bundle-listStephen Finucane2017-04-05
| | | | | | Simple usability improvement. Signed-off-by: Stephen Finucane <stephen@that.guru>
* views: Use bundle-detail for public URLsStephen Finucane2017-04-05
| | | | | | | | | | | | | | | | | | | | In 'd1c605f', we reworked the 'bundle-list' view to use the new 'Bundle.get_mbox_url' function instead of the 'Bundle.public_url'. However, these are not the same thing. The latter referred to the 'bundle-detail' view, while the former referred to the 'bundle-mbox' view. The easiest fix would be to simply revert that patch. However, it turns out that 'public_url' isn't actually needed. Commit '5d0140ef' removed a divide between public and non-public URLs for bundles, meaning we can actually use an existing function - 'get_absolute_url' - instead. This also presents the opportunity to clean up the 'bundle-list' page, favouring a simple public/is-not-public marker and only a single URL. Signed-off-by: Stephen Finucane <stephen@that.guru> Fixes: d1c605f9 ("views: Stop using Bundle.public_url") Closes-bug: #92
* xmlrpc: Remove 'bundle_to_dict'Stephen Finucane2017-04-05
| | | | | | | | Turns out this function is not called anywhere nor has it been called since being introduced in '83964878'. Given that we're now focused on the REST API, we can simply remove this. Signed-off-by: Stephen Finucane <stephen@that.guru>
* views: Support wildcarded 'series' parameterStephen Finucane2017-04-04
| | | | | | | | | There are many times that we would want to just test against the latest series. Make this possible by wildcarding, like so: GET /patch/{patchID}/mbox/?series=* Signed-off-by: Stephen Finucane <stephen@that.guru>
* templates: Add "download series" linksStephen Finucane2017-04-04
| | | | | | | | This will allow users to download entire series including the current patch. Since a patch can belong to many series a dropdown is used. Signed-off-by: Stephen Finucane <stephen@that.guru> Reviewed-by: Daniel Axtens <dja@axtens.net>
* templates: Use buttons for patch download linksStephen Finucane2017-04-04
| | | | | | | | | | | We'll make use of this to enable downloading of patches with mboxes. In addition, the 'hide' link for patches and cover letters is removed. There's no way to enable this by default and the use cases are dubious at best. Signed-off-by: Stephen Finucane <stephen@that.guru> Reviewed-by: Daniel Axtens <dja@axtens.net>
* views: Expose Series mboxStephen Finucane2017-04-04
| | | | | | | | | | | | | | | | | | | | | | | | | | It is possible to download a patch mbox with all dependencies. Now make it possible to download the entire series. This takes the form of the following URL when using the default routes: /series/{seriesID}/mbox/ Like the equivalent patch and bundle links, this will return a 404 if '{seriesID}' does not match an existing series' ID. However, a 404 will also be returned in the series is not complete, as indicated by Series.total > Series.received_total. You can override this behavior by providing the 'force' parameter: /series/{seriesID}/mbox/?force=1 Note that there are no current plans to provide a series-specific view, a.k.a. /series/{seriesID}/ As a result, this particular URL will continue to return a 404. Signed-off-by: Stephen Finucane <stephen@that.guru> Reviewed-by: Daniel Axtens <dja@axtens.net>
* views: Add 'series' parameter to '/mbox' endpointStephen Finucane2017-04-04
| | | | | | | | This allows a user to download dependencies for a patch without having to do it manually. This is primarily aimed at users testing patches. Signed-off-by: Stephen Finucane <stephen@that.guru> Reviewed-by: Daniel Axtens <dja@axtens.net>
* utils: Add 'bundle_to_mbox' helperStephen Finucane2017-04-04
| | | | | | | | This includes unit tests to validate correct behavior and prevent regressions. Signed-off-by: Stephen Finucane <stephen@that.guru> Reviewed-by: Daniel Axtens <dja@axtens.net>
* trivial: Cleanup imports in viewsStephen Finucane2017-04-04
| | | | | | | | Break each import onto its own line and remove 'absolute_import' imports, which aren't necessary for Python >= 2.7. Signed-off-by: Stephen Finucane <stephen@that.guru> Reviewed-by: Daniel Axtens <dja@axtens.net>
* utils: Move patch_to_mbox to utils moduleStephen Finucane2017-04-04
| | | | | | | There's no reason to have this in '__init__.py'. Signed-off-by: Stephen Finucane <stephen@that.guru> Reviewed-by: Daniel Axtens <dja@axtens.net>
* views: Make 'patch_to_mbox' return a stringStephen Finucane2017-04-04
| | | | | | | | | | | The 'patch_to_mbox' function returns an object which is coverted to a string in all places where this call occurs. The string conversion differs between Python 2 and 3 and while it has been updated in one place, it was missed in two others. Resolve these issues and ensure they don't happen again by returning strings from 'patch_to_mbox' instead. Signed-off-by: Stephen Finucane <stephen@that.guru> Reviewed-by: Daniel Axtens <dja@axtens.net>
* views: Use consistent 'list'/'detail' namesStephen Finucane2017-04-04
| | | | | | | | The 'setbundles' view is also removed as it's not called by anything/anyone. Signed-off-by: Stephen Finucane <stephen@that.guru> Reviewed-by: Daniel Axtens <dja@axtens.net>
* trivial: Resolve PEP8 issueStephen Finucane2017-04-04
| | | | | | | There's an unused variable. Signed-off-by: Stephen Finucane <stephen@that.guru> Fixes: 9b81f1ae ("REST: Add '/bundle' endpoint")
* parsemail.sh: Fix usage via stdin.Ralf Baechle2017-03-21
| | | | | | | | | | | Commit e56391f66cb8 ("trivial: Standardize variable naming in scripts") sneaked in a checked for missing command line arguments in parsemail.sh which broke typical argument-less usage for mail delivery. Revert that again. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Reviewed-by: Stephen Finucane <stephen@that.guru> Fixes: e56391f6 ("trivial: Standardize variable naming in scripts")
* REST: Add '/bundle' endpointStephen Finucane2017-03-20
| | | | | | | | | | | | | | | | | | | I had initially resisted adding a '/bundle' endpoint to the API as I wanted to kill this feature in favour of series. However, series are not a like-for-like replacement for bundles. Among other things, series do not provide the composability of bundles: bundles can be manually created, meaning you can use bundles to group not only multiple patches but also multiple series (or at least the patches in those series). Seeing as we're not getting rid of this feature, we should expose it via the API. Bundles are little unusual, in that they can be public or private, thus, we should only show bundles that are public or belonging to the currently authenticated user, if any. For now, this is a read-only endpoint. We may well allow creation of bundles via the API once we figure out how to do this cleanly. Signed-off-by: Stephen Finucane <stephen@that.guru> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* views: Allow use of basic auth for bundle mboxesStephen Finucane2017-03-20
| | | | | | | | | API clients are going to talk using basic auth. We also need to do this for bundles. The alternative is to provide another endpoint for bundles in the API but that seems unnecessary. Signed-off-by: Stephen Finucane <stephen@that.guru> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* views: Stop using Bundle.public_urlStephen Finucane2017-03-20
| | | | | | | | We now have 'get_mbox_url' which is consistent with patches. Let's drop the older one. Signed-off-by: Stephen Finucane <stephen@that.guru> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* models: Add 'mbox_url' permalink for bundlesStephen Finucane2017-03-20
| | | | | | | We're going to use this for downloading mboxes via the REST API. Signed-off-by: Stephen Finucane <stephen@that.guru> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* REST: Prefetch Series.projectStephen Finucane2017-03-20
| | | | | | | | I missed this when testing due to only having a single project. There will be performance issues on instances using multiple projects. Signed-off-by: Stephen Finucane <stephen@that.guru> Reviewed-by: Andy Doan <andy.doan@linaro.org>
* Update psycopg2 from 2.7 to 2.7.xpyup-bot2017-03-13
|
* Pin selenium to latest version 3.3.xpyup-bot2017-03-13
|
* Update django-debug-toolbar from 1.6 to 1.7pyup-bot2017-03-05
|
* Update sqlparse from 0.2.2 to 0.2.3pyup-bot2017-03-04
|
* Catch Subprocess exceptionsStephen Finucane2017-03-02
| | | | | | | | | Apparently different environments raise different return codes. Handle the invalid return codes thrown by subprocess, presumably related to how Travis checks out things from git. Signed-off-by: Stephen Finucane <stephen@that.guru> Fixes: d3e9aee ("Don't catch non-Python 2.7 exceptions")
* Don't catch non-Python 2.7 exceptionsStephen Finucane2017-03-01
| | | | | | | The 'FileNotFoundError' exception is only available in Python 3.3+. Signed-off-by: Stephen Finucane <stephen@that.guru> Fixes: 7b07b71e ("templates: Add Patchwork version")
* REST: Expose '/event' fields in 'payload' fieldStephen Finucane2017-03-01
| | | | | | | | | Instead of exposing differing fields depending on the event category, expose a consistent set of 'id', 'category', 'date' and 'payload'. This ensures we can loop through events in a somewhat standardized fashion. Signed-off-by: Stephen Finucane <stephen@that.guru> Tested-by: Daniel Axtens <dja@axtens.net>
* REST: Expose eventsStephen Finucane2017-03-01
| | | | | | | | | This is a list only endpoint as it's expected that we would kill events after a certain duration and would have no reason to allow indexing of past events. Signed-off-by: Stephen Finucane <stephen@that.guru> Tested-by: Daniel Axtens <dja@axtens.net>
* docs: Add events to usage guideStephen Finucane2017-03-01
| | | | | Signed-off-by: Stephen Finucane <stephen@that.guru> Tested-by: Daniel Axtens <dja@axtens.net>
* docs: Resolve some issues with the 'usage' guideStephen Finucane2017-03-01
| | | | | | | | The headings in this file were all over the place. Resolve this. Signed-off-by: Stephen Finucane <stephen@that.guru> Fixes: 86100924 ("docs: Provide overview document") Tested-by: Daniel Axtens <dja@axtens.net>
* signals: Add callbacks for eventsStephen Finucane2017-03-01
| | | | | | | | When models are modified, fire signal handlers to create the relevant events. Signed-off-by: Stephen Finucane <stephen@that.guru> Tested-by: Daniel Axtens <dja@axtens.net>
* models: Add 'Event' modelStephen Finucane2017-03-01
| | | | | | | | Events record Patch-related things like initial creation, state transitions, delegation assigning etc. Signed-off-by: Stephen Finucane <stephen@that.guru> Tested-by: Daniel Axtens <dja@axtens.net>
* models: Modify behavior of Series.received_allStephen Finucane2017-03-01
| | | | | | | | | | | | | | | | At the moment, Series.received_all is only true is the number of patches received exactly matches the expected number of patches. However, there are cases where there may in fact be more patches in the final series than expected. For example, one could send patches with a subject of 'PATCH 5/4' in-reply-to an original four patch series. The parser handles this correctly, so the 'received_all' property should too. We still need to support patterns like '5/n', which are in use and do not appear to be supported since 'c21b305'. This can be done at a later stage. Signed-off-by: Stephen Finucane <stephen@that.guru> Tested-by: Daniel Axtens <dja@axtens.net>
* models: Move signal to 'signals'Stephen Finucane2017-03-01
| | | | | | | | Additional signals are going to be added shortly and they shouldn't pollute 'models.py'. Signed-off-by: Stephen Finucane <stephen@that.guru> Tested-by: Daniel Axtens <dja@axtens.net>
* REST: allow fetching of subject prefixesDaniel Axtens2017-03-01
| | | | | | | | | | | | | | | Some mailing lists accept patches for multiple projects, and use a subject prefix to differentiate the projects. Therefore, for snowpatch, it's useful to be able to fetch the subject prefixes. Export subject prefixes in the REST API. Signed-off-by: Daniel Axtens <dja@axtens.net> Tested-by: Russell Currey <ruscur@russell.cc> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Reviewed-by: Stephen Finucane <stephen@that.guru>
* templates: Add Patchwork versionStephen Finucane2017-03-01
| | | | | | | | | | | | This is managed using a combination of hardcoded string, for installations from tarball, and 'git describe', for installations from a Git repo. This includes installing Git in the Docker environment, to enable this in the development environment. Signed-off-by: Stephen Finucane <stephen@that.guru> Acked-by: Daniel Axtens <dja@axtens.net>
* templates: Add API status to about pageStephen Finucane2017-03-01
| | | | | | | | | | | This is useful given that these APIs can be disabled, and likely will be for deployments where django-rest-framework is not available. The version is currently hardcoded, but this will be resolved in a future change. Signed-off-by: Stephen Finucane <stephen@that.guru> Reviewed-by: Daniel Axtens <dja@axtens.net>