aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* docs: Rework configuration documentStephen Finucane2019-07-06
| | | | | | | | | - Remove some newlines between terms and definitions that were causing the latter to be rendered as blockquotes instead - Order list of settings alphabetically - Update URLs to use latest version of Django we support Signed-off-by: Stephen Finucane <stephen@that.guru>
* about: Display admin contact detailsAndrew Donnellan2019-07-05
| | | | | | | | | Display the list of admins on the about page. Add an ADMINS_HIDE option if you don't want the details displayed publicly. Closes: #282 ("Display contact details for patchwork instance admins") Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com> Signed-off-by: Stephen Finucane <stephen@that.guru>
* docs: Add a release note for CVE-2019-13122Daniel Axtens2019-07-05
| | | | Signed-off-by: Daniel Axtens <dja@axtens.net>
* filters: Escape State names when generating selector HTMLAndrew Donnellan2019-07-05
| | | | | | | States with names containing special characters are not correctly escaped when generating the select list. Use escape() to fix this. Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
* tests: Add test for unescaped values in patch detail pageAndrew Donnellan2019-07-05
| | | | | | | | | | | Add a test to check whether we are escaping values from the Patch model on the patch detail page. This test shouldn't be relied upon as proof that we've escaped everything correctly, but may help catch regressions. Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com> Signed-off-by: Daniel Axtens <dja@axtens.net>
* templatetags: Do not mark output of msgid tag as safeAndrew Donnellan2019-07-05
| | | | | | | | | | | | | | | | | | The msgid template tag exists to remove angle brackets from either side of the Message-ID header. It also marks its output as safe, meaning it does not get autoescaped by Django templating. Its output is not safe. A maliciously crafted email can include HTML tags inside the Message-ID header, and as long as the angle brackets are not at the start and end of the header, we will quite happily render them. Rather than using mark_safe(), use escape() to explicitly escape the Message-ID. Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com> Signed-off-by: Daniel Axtens <dja@axtens.net>
* Update django from 1.11.20 to 1.11.21Stephen Finucane2019-06-17
|
* Remove pwclientStephen Finucane2019-06-17
| | | | | | | | | Let's start managing this via a separate project, which will allow the client to evolve separately from the server. No redirect is added for the old '/pwclient' URL as it seems wiser to return a HTTP 404 error code. Signed-off-by: Stephen Finucane <stephen@that.guru>
* templates: Fix pwclientrc sampleStephen Finucane2019-06-17
| | | | | | | | INI files should use 'key = value' values, not 'key: value'. Correct this and fix some other whitespace issues. Signed-off-by: Stephen Finucane <stephen@that.guru> Closes: #277
* filters: re-add the possibility of filtering undelegated patchesMauro Carvalho Chehab2019-06-05
| | | | | | | | | | | | | | | The filters.py redesign that happened for patchwork 1.1 removed a functionality that we use a lot: to filter patches that weren't delegated to anyone. Also, it is a way harder to find someone to delegate with a free text input. Use, instead a combo-box just like before. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Stephen Finucane <stephen@that.guru> Fixes: f439f541 ("Add delegate filter autocomplete support") Closes: #60 [stephenfin: Rework release note and fix some style issues]
* Fix typo in release noteStephen Finucane2019-06-05
| | | | Signed-off-by: Stephen Finucane <stephen@that.guru>
* Add support for Django 2.2Stephen Finucane2019-06-05
| | | | Signed-off-by: Stephen Finucane <stephen@that.guru>
* parser: Remove duplicityPetr Vorel2019-06-04
| | | | | | | | commit fc1d750 copied lines added in 753e457. Make sense to define it on single place (DRY). Signed-off-by: Petr Vorel <petr.vorel@gmail.com> Reviewed-by: Stephen Finucane <stephen@that.guru>
* parser: Include extended header lines in diffStephen Finucane2019-06-04
| | | | | | | | | | Commit 753e4572d updated the parser to consider additional header lines when deciding where a patch message ends and the diff begins. However, these additional lines were not captured meaning these patches didn't have a diff associated with them and they therefore weren't patches in the Patchwork sense of the term. Correct this and add a test. Signed-off-by: Stephen Finucane <stephen@that.guru>
* parser: Add missing extended header linesPetr Vorel2019-06-04
| | | | | | | | | | | | | Patchwork didn't recognise some patches due missing some extended header lines (e.g. "old mode" and "new mode" for renaming file mode, see [1]). Thus adding all modes from git doc [2]. [1] https://lists.ozlabs.org/pipermail/patchwork/2019-April/005741.html [2] https://git-scm.com/docs/git-diff#_generating_patches_with_p Suggested-by: Veronika Kabatova <vkabatov@redhat.com> Signed-off-by: Petr Vorel <petr.vorel@gmail.com> Closes: #267
* docs: Document backport criteriaStephen Finucane2019-05-24
| | | | | | | | | | | | Explain why we don't want to be in the business of backport certain patches, in the long run. It took me a while to put this into words but I was helped by a similar discussion ongoing in the OpenStack community at the moment [1]. [1] http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006220.html Signed-off-by: Stephen Finucane <stephen@that.guru> Acked-by: Daniel Axtens <dja@axtens.net>
* Revert "parser: Ensure whitespace is stripped for long headers"Daniel Axtens2019-05-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 841f966b8d54b2f51ab1c498eed6e5391f2546a9. In July 2018, we received a report of OzLabs patchwork mangling emails that have subjects containing words with internal commas, like "Insert DT binding for foo,bar" (#197). Stephen took a look and came up with the comment this reverts. Quoting the commit message: RFC2822 states that long headers can be wrapped using CRLF followed by WSP [1]. For example: Subject: Foo bar, baz Should be parsed as: Foo bar,baz As it turns out, this is not the case. Journey with me to section 2.2.3 of RFC 2822: 2.2.3. Long Header Fields Each header field is logically a single line of characters comprising the field name, the colon, and the field body. For convenience however, and to deal with the 998/78 character limitations per line, the field body portion of a header field can be split into a multiple line representation; this is called "folding". The general rule is that wherever this standard allows for folding white space (not simply WSP characters), a CRLF may be inserted before any WSP. For example, the header field: Subject: This is a test can be represented as: Subject: This is a test So the issue with the example in the reverted commit is that there is no folding white space in "bar,baz", so it's not valid to split it. These are valid: Subject: Foo bar,baz Subject: Foo bar,baz but splitting "bar,baz" into "bar,\n baz" is not valid. What then is correct unfolding behaviour? Quoting the RFC again: The process of moving from this folded multiple-line representation of a header field to its single line representation is called "unfolding". Unfolding is accomplished by simply removing any CRLF that is immediately followed by WSP. Each header field should be treated in its unfolded form for further syntactic and semantic evaluation. In other words, the unfolding rule requires you to strip the CRLF, but it does not permit you to strip the WSP. Indeed, if "bar,\n baz" is received, the correct unfolding is "bar, baz". If you do strip the WSP, you end up mashing words together, such as in https://patchwork.ozlabs.org/patch/1097852/ So revert the commit, restoring original behaviour, but keep a corrected version of the test. This presents a big question though: how did Rob's email up with a mangled subject line? To answer this question, you end up having to learn about OzLabs Patchwork and how it differs from Patchwork the project. OzLabs Patchwork (patchwork.ozlabs.org) is an installation of Patchwork. Part of what makes it so useful for so many projects is a little intervening layer that can massage some mail to make it end up in the right project. Email that lands in the device tree project is an example of email that goes through this process. I only learned about this today and I haven't looked in any detail at precisely what is done to the mail. The script is not part of the Patchwork project. This intervening filter is a Python script that runs - and this is an important detail - in Python 2.7. Ignoring all the details, the filter basically operates in a pipe between the mail program and patchwork's parsemail, like (mail from system) | filter.py | parsemail At it's very simplest, filter.py acts as follows: import email import sys mail = email.parse_from_file(sys.stdin) sys.stdout.write(mail.as_string()) Fascinatingly, if you take Rob's email from #197 and put it through this process, you can see that it is getting mangled: Before: Subject: [PATCH v2 3/4] dt-bindings: sound: wm8994: document wlf,csnaddr-pd property After: Subject: [PATCH v2 3/4] dt-bindings: sound: wm8994: document wlf, csnaddr-pd property You can see that python27 has incorrectly wrapped the header, breaking where there is not a foldable space. Python3 does not have this issue. To summarise: - part of the magic of OzLabs PW is a filter to make sure mail gets to the right place. This isn't part of the Patchwork project and so is usually invisible to patchwork developers. - the filter is written in python27. The email module in py27 has a bug that incorrectly breaks subjects around commas within words. - patchwork correctly unfolds those broken subjects with a space after the comma. - the extra space was interpreted as a bug in patchwork, leading to a misinterpretation of the spec to strip out the whitespace that was believed to be in error. - that broke other wrapped subjects. To solve this, revert the commit and I'll work with jk to get the filter script into py3 compatibility. (Given that py27 sunsets in ~7mo, trying to fix it is not worth it.) Closes: #273 Signed-off-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Stephen Finucane <stephen@that.guru> [stephenfin: Use a new release note instead of editing the original one]
* docs: Mention Postgres for Docker development installRussell Currey2019-05-03
| | | | | | | | | | Might as well since it's there, and it gives some clue to anyone trying to use Docker on non-x86. I figured it was best to leave this out of the README since it's incredibly niche. Signed-off-by: Russell Currey <ruscur@russell.cc> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Daniel Axtens <dja@axtens.net>
* docker: Use Ubuntu ports repositories on non-x86 architecturesRussell Currey2019-05-03
| | | | | | | | | | | | | | | | | This should allow Patchwork to run "out of the box" in Docker on any architecture with a) an Ubuntu port and b) support in the Postgres multiarch Docker image, which includes at least arm64 and ppc64le. It's a little gross hacking the Dockerfile like this, but I'm not sure there's a more elegant way to do it. Unfortunately it doesn't seem like there's any way to do conditional COPY, and anything in RUN is plain /bin/sh, so that's why it looks like it does. Tested on ppc64le and on x86_64. Signed-off-by: Russell Currey <ruscur@russell.cc> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Daniel Axtens <dja@axtens.net>
* docker: Install libpq-dev to fix psycopg2-binary buildRussell Currey2019-05-03
| | | | | | | | | | | | | | | | | | psycopg2-binary fails if pg_config isn't installed, which is provided by libpq-dev. This seems strange to me since psycopg2-binary suggests that you use psycopg2-binary instead (of itself) if you don't want to build psycopg2 so you wouldn't need pg_config, which is very confusing. It's possible that psycopg2-binary only needs to compile itself on non-x86 platforms, since I hit this on ppc64le. Anyway, it works when this is added. Signed-off-by: Russell Currey <ruscur@russell.cc> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Daniel Axtens <dja@axtens.net>
* README: add .env file to installation instructionsRussell Currey2019-05-03
| | | | | | | | | | | Creating the .env file is mentioned in the installation documentation but not in the README, so following only the steps mentioned there will fail. Add this and add a `cd patchwork` in there for good measure so you could straight up copy paste the steps. Signed-off-by: Russell Currey <ruscur@russell.cc> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Daniel Axtens <dja@axtens.net>
* REST: A check must specify a stateDaniel Axtens2019-04-30
| | | | | | | | | | The Ozlabs crew noticed that a check without a state caused a KeyError in data['state']. Mark state as mandatory, check for it, and add a test. Reported-by: Russell Currey <ruscur@russell.cc> Reported-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Daniel Axtens <dja@axtens.net>
* REST: Handle regular form data requests for checksDaniel Axtens2019-04-30
| | | | | | | | | | | | | | | | | 08d1459a4a40 ("Add REST API validation using OpenAPI schema") moved all API requests to JSON blobs rather than form data. dc48fbce99ef ("REST: Handle JSON requests") attempted to change the check serialiser to handle this. However, because both a JSON dict and a QueryDict satisfy isinstance(data, dict), everything was handled as JSON and the old style requests were broken. Found in the process of debugging issues from the OzLabs PW & Snowpatch crew - I'm not sure if they actually hit this one, but kudos to them anyway as we wouldn't have found it without them. Fixes: dc48fbce99ef ("REST: Handle JSON requests") Signed-off-by: Daniel Axtens <dja@axtens.net>
* notifications: fix notification expiry when no user is associatedJeremy Kerr2019-04-30
| | | | | | | | | | | | | | | | | | | It's possible that an EmailConfirmation object will have no associated user (eg, for email opt-out, which does not require a user object). In this case, we will see a NULL value for EmailConfirmation.user_id. However, having a NULL value appear in a SQL 'IN' clause will match every value. This means that once one of these null-user EmailConfirmations is present, we will never expire any non-active user accounts. This change adds a filter for a valid user_id when we query for active EmailConfirmation objects. This means we'll have a valid values set to use in the pending_confs set. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> [dja: fix pep8 issue] Signed-off-by: Daniel Axtens <dja@axtens.net>
* Update psycopg2-binary from 2.8.1 to 2.8.2pyup-bot2019-04-17
|
* Update psycopg2-binary from 2.8.1 to 2.8.2pyup-bot2019-04-17
|
* Update psycopg2-binary from 2.7.7 to 2.8.1pyup-bot2019-04-07
|
* Update psycopg2-binary from 2.7.7 to 2.8.1pyup-bot2019-04-07
|
* Update jinja2 from 2.10 to 2.10.1pyup-bot2019-04-07
|
* Fix YAML loader warningDaniel Axtens2019-03-21
| | | | | | | | | | | | | In my tests I'm seeing: /home/patchwork/patchwork/patchwork/tests/api/validator.py:229: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. Fix this by using the safe loader in the tests. Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Stephen Finucane <stephen@that.guru>
* Update sphinx_rtd_theme from 0.4.2 to 0.4.3pyup-bot2019-03-12
|
* Update sqlparse from 0.2.4 to 0.3.0pyup-bot2019-03-12
|
* Update sqlparse from 0.2.4 to 0.3.0pyup-bot2019-03-12
|
* Update django from 1.11.18 to 1.11.20Stephen Finucane2019-03-07
|
* ui: Space in filter radio buttonsThomas Monjalon2019-03-05
| | | | | | | | There was no space between radio button and associated text in the filters form. Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> Reviewed-by: Stephen Finucane <stephen@that.guru>
* ui: Shrink vertical space of patch listThomas Monjalon2019-03-05
| | | | | | | | | | | The margin above the filter box is removed because there is already a margin below the navigation bar. The vertical padding between rows is reduced while the horizontal padding between columns is increased. Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: Stephen Finucane <stephen@that.guru>
* Update djangorestframework from 3.9.1 to 3.9.2pyup-bot2019-03-03
|
* Update djangorestframework from 3.9.1 to 3.9.2pyup-bot2019-03-03
|
* parser: recognise git commit consisting only of empty new fileDaniel Axtens2019-03-02
| | | | | | | | | | | | | | | | | Commits with only an empty new file are liable to be missed. The parser state machine doesn't recognise the headers "new file mode" and "index": teach it about them. Add a test to demonstrate. It's a little bit academic as you don't usually send patches like that but sometimes you do, especially if you're a snowpatch dev :) Closes: #256 Reported-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Reviewed-by: Stephen Finucane <stephen@that.guru>
* Update openapi-core from 0.7.1 to 0.8.0pyup-bot2019-02-28
|
* Beautify check counts in the patch list viewAli Alnubani2019-02-25
| | | | | | | | | | | | | | | | | This patch [1] adds colors to the checks in the patch list view. The colors are set based on the check's priority, with FAILURE having the highest priority, followed by WARNING, and then SUCCESS. Only the check with the highest priority and non-zero count will be colored. This is to make failures and warnings more visible. The patch also [2] replaces zero counts with a '-' for FAILUREs and WARNINGs. The SUCCESS count will only be replaced by a '-' when all other checks have zero counts too. Suggested-by: Thomas Monjalon <thomas@monjalon.net> Signed-off-by: Ali Alnubani <alialnu@mellanox.com> Signed-off-by: Stephen Finucane <stephen@that.guru>
* Fix return code when getting patch information failsAli Alnubani2019-02-25
| | | | | | | | | | The `info` command always exits with success, even if the patch didn't exist. Modified to exit with a non-zero exit status and print an error message in that case. Signed-off-by: Ali Alnubani <alialnu@mellanox.com> Reviewed-by: Stephen Finucane <stephen@that.guru>
* docs: Fix user's profile urlAli Alnubani2019-02-25
| | | | | Signed-off-by: Ali Alnubani <alialnu@mellanox.com> Reviewed-by: Stephen Finucane <stephen@that.guru>
* Update django from 2.1.5 to 2.1.7pyup-bot2019-02-12
|
* Update django from 2.1.5 to 2.1.7pyup-bot2019-02-12
|
* Update python-dateutil from 2.7.5 to 2.8.0pyup-bot2019-02-06
|
* docs: Integrate API schema into docsStephen Finucane2019-01-29
| | | | | | | | This takes advantage of the sphinxcontrib-openapi Sphinx extension, which allows us to embed the REST API documentation into our docs quite nicely. Signed-off-by: Stephen Finucane <stephen@that.guru>
* docs: Move REST API guide to subfolderStephen Finucane2019-01-29
| | | | | | | | | | We're going to dramatically expand these docs, so let's set up room to do so. This shouldn't break any links as we're using 'htmldir' output on ReadTheDocs. Signed-off-by: Stephen Finucane <stephen@that.guru>
* tox: Use 'dirhtml' builder for docsStephen Finucane2019-01-29
| | | | | | This is what we use for 'patchwork.readthedocs.io'. Signed-off-by: Stephen Finucane <stephen@that.guru>
* docs: Remove crud from conf.pyStephen Finucane2019-01-29
| | | | | | | | Most of this was removed in a previous release but there is yet more to go. These values are all (a) defaults or (b) never triggered. Remove them. Signed-off-by: Stephen Finucane <stephen@that.guru>