aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* docs: Fix link to deployment guideAli Alnubani2019-10-29
| | | | | | | | The old format redirects to a nonexistent page when there are multiple versions of the docs. Signed-off-by: Ali Alnubani <alialnu@mellanox.com> Signed-off-by: Daniel Axtens <dja@axtens.net>
* templates: Fix mismatched close tagsAndrew Donnellan2019-10-29
| | | | | | | There's a </td> rather than </th> in the bundle list. Fix it. Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com> Signed-off-by: Daniel Axtens <dja@axtens.net>
* parser: extend SERIES_DELAY_INTERVALDaniel Axtens2019-10-29
| | | | | | | | | | There was a series on linuxppc today that was spread over ~13 mins, so the last two patches were put into a new series. Extend the time window to 20 mins, and attempt to document it. Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com> Signed-off-by: Daniel Axtens <dja@axtens.net>
* travis, tox: only do coverage testing in py27Daniel Axtens2019-10-29
| | | | | | | | | | | | | | | | | Currently Travis calls `tox -e coverage` unconditionally. However, the environment has py27 basepython, so all the runs only generate py27 coverage! Rather than try to untangle that, just run the coverage when run in a py27 travis environment. This makes things faster for no loss of coverage. It means that codecov has nothing to submit for the py3x environments, but that's no real loss: it would otherwise submit lots of duplicate data. We could try to improve coverage by running coverage for 27 and 3x, but given that 27 is going away, don't stress at this point. Signed-off-by: Daniel Axtens <dja@axtens.net>
* README: remove dead landscape.io badgeDaniel Axtens2019-10-29
| | | | | | | | | | | | landsape.io is down and seems to have been for some time. The issue tracker [1] doesn't seem to have anything since April. Pull out the broken badge. If landscape.io returns we can add it back later. [1] https://github.com/landscapeio/landscape-issues/issues?q=is%3Aopen+is%3Aissue Signed-off-by: Daniel Axtens <dja@axtens.net>
* travis: fix codecovDaniel Axtens2019-10-29
| | | | | | | | | | | | | | | | | | | | | | | | In e017f69376da ("travis: run pep8/flake8 tests"), codecov was removed from the install step, on the basis that tox-travis would pull it in automatically. This, it turns out, isn't entirely true: it is pulled in to the tox environment, but the data is actually sent in an after_success step. That is outside the tox environment, as it should be - if it were part of the tox environment, running `tox -e coverage` on a developer laptop would try to send data to the web. But, as codecov now isn't present outside the tox environment, we see in the logs: $ codecov codecov: command not found We don't get any reporting of success/failure in the after_success step, so we didn't notice. Restore the installation in the travis environment. Fixes: e017f69376da ("travis: run pep8/flake8 tests") Signed-off-by: Daniel Axtens <dja@axtens.net>
* docker: Specify GID for docker-compose-pg.yml tooDaniel Axtens2019-10-29
| | | | | | | | We just need to mirror the changes in the MySQL/default docker-compose.yml file. Fixes: b4f4c8554c11 ("docker: Require GID also") Signed-off-by: Daniel Axtens <dja@axtens.net>
* travis: Test Python 3.8Daniel Axtens2019-10-29
| | | | | | | An embarassing miss when applying the previous patch. Fixes: 681609f9511c ("Python 3.8 support") Signed-off-by: Daniel Axtens <dja@axtens.net>
* Python 3.8 supportAndrew Donnellan2019-10-24
| | | | | | | Enable Python 3.8 in our tests and list it as a supported version. Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com> Signed-off-by: Daniel Axtens <dja@axtens.net>
* docs: bump the copyright year in the docsDaniel Axtens2019-10-18
| | | | | | | It's 2019. It's almost 2020, in fact! Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Stephen Finucane <stephen@that.guru>
* docs: document snowpatch as an API clientDaniel Axtens2019-10-18
| | | | | | | | Snowpatch is one of the few publically visible API clients. Document it in the clients list. Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Stephen Finucane <stephen@that.guru>
* tests: Rename inaccurately named test_patchwork_from_headerAndrew Donnellan2019-10-18
| | | | | | | | | | | The test_patchwork_from_header test claims to test for the presence of the X-Patchwork-From header, when we actually call it X-Patchwork-Submitter. Fix it. Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com> [dja: fix commit message] Signed-off-by: Daniel Axtens <dja@axtens.net>
* parser: Unmangle From: headers that have been mangled for DMARC purposesAndrew Donnellan2019-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid triggering spam filters due to failed signature validation, many mailing lists mangle the From header to change the From address to be the address of the list, typically where the sender's domain has a strict DMARC policy enabled. In this case, we should try to unmangle the From header. Add support for using the X-Original-From or Reply-To headers, as used by Google Groups and Mailman respectively, to unmangle the From header when necessary and associate the patch with the correct submitter based on the unmangled email address. When downloading mboxes, rewrite the From header using the unmangled address, and preserve the original header as X-Patchwork-Original-From in case someone needs it for some reason. The original From header will still be stored in the database and exposed via the API, as we want to keep messages as close to the original received format as possible. Closes: #64 ("Incorrect submitter when using googlegroups") Reported-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com> Tested-by: Daniel Axtens <dja@axtens.net> # mailman only [dja: add release note] Signed-off-by: Daniel Axtens <dja@axtens.net>
* REST: Allow creating, updating, deleting of bundlesStephen Finucane2019-10-17
| | | | | | | | | | Allow users to create a new bundle, change the name, public flag and patches of an existing bundle, and delete an existing bundle. Some small nits with existing tests are resolved. Signed-off-by: Stephen Finucane <stephen@that.guru> Closes: #316
* REST: Add 'has_version' helperStephen Finucane2019-10-17
| | | | | | We're going to use this functionality elsewhere shortly. Signed-off-by: Stephen Finucane <stephen@that.guru>
* Use secrets and fall back to random.SystemRandom for keysJeremy Cline2019-10-17
| | | | | | | | | | | | | | | | | | The random module uses the Mersenne Twister pseudorandom number generator and is not a cryptographically secure random number generator[0]. The secrets[1] module is intended for generating cryptographically strong random numbers, so recommend using that to generate the secret key. It's new in Python 3, so if it's unavailable fall back to using the ``os.urandom()`` backed implementation of random. NOTE(stephenfin): Modified to include change to 'config.yaml'. Also renamed reno to just stick with hyphens for filenames. [0] https://docs.python.org/3/library/random.html [1] https://docs.python.org/3/library/secrets.html Signed-off-by: Jeremy Cline <jcline@redhat.com> Signed-off-by: Stephen Finucane <stephen@that.guru>
* docker: Require GID alsoStephen Finucane2019-10-17
| | | | | | | If you don't do this, created files end up with a group of 'gcc' or whatever group has an ID of 1000. Signed-off-by: Stephen Finucane <stephen@that.guru>
* docker: Ignore .tox, .backups directoriesStephen Finucane2019-10-17
| | | | | | | These can be _huge_ which can significantly slow down the startup time. We don't need them so ignore them. Signed-off-by: Stephen Finucane <stephen@that.guru>
* docker: Rely on cachingStephen Finucane2019-10-17
| | | | | | | | It seems less likely that tox and tox-pyenv will change than our requirements. Split up the 'RUN' steps so we don't have to reinstall the former every time the latter change. Signed-off-by: Stephen Finucane <stephen@that.guru>
* docs: Rename and make 'generate_schema' executableStephen Finucane2019-10-05
| | | | | | A small Python 3 issue is resolved. Signed-off-by: Stephen Finucane <stephen@that.guru>
* Remove pwclient bashcompleteStephen Finucane2019-09-27
| | | | | | | This was also missed when moving pwclient to a separate repo. Fix it now. Signed-off-by: Stephen Finucane <stephen@that.guru> Fixes: 90e85f9d ("Remove pwclient")
* Remove invalid symlinkStephen Finucane2019-09-27
| | | | | | | This was missed when moving pwclient to a separate repo. Fix it now. Signed-off-by: Stephen Finucane <stephen@that.guru> Fixes: 90e85f9d ("Remove pwclient")
* docs: Add documentation for pre-commitStephen Finucane2019-09-27
| | | | | | Explain what it is and why you should use it. Signed-off-by: Stephen Finucane <stephen@that.guru>
* Integrate 'pre-commit'Stephen Finucane2019-09-27
| | | | | | | | Helps me avoid simple style issues. We explicitly disable newline checks for some files where the "fix" would be harmful (e.g. mboxes and templates). Signed-off-by: Stephen Finucane <stephen@that.guru>
* trivial: Style fixesStephen Finucane2019-09-27
| | | | | | An assortment of fixes identified through the integration of pre-commit. Signed-off-by: Stephen Finucane <stephen@that.guru>
* Move to msgid based URLsDaniel Axtens2019-09-25
| | | | | | | | | | | | | | | | | | | | | | | | Migrate our URL schema as follows: Patches: /project/<linkname>/patch/<msgid>/ Cover Letters: /project/<linkname>/cover/<msgid>/ The usual sub-resources (mbox, raw) hang off those URLs. The old style URLs (/patch/NNN/*, /cover/NNN/*) redirect appropriately. I haven't attempted to do anything meaningful with series, and I have dropped any attempt to provide a generic message-id lookup or search functionality. One step at a time. Our database still stores message ids as with angle brackets; we just work around that rather than trying to migrate. That too can come later if we think the pain is justified. Partially-closes: #106 Reported-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Reported-by-but-I-don't-want-to-spam: Linus Torvalds <torvalds@linux-foundation.org> Reported-by: Stephen Finucane <stephen@that.guru> Signed-off-by: Daniel Axtens <dja@axtens.net>
* Fix issue with delegation of patch via REST APIStephen Finucane2019-09-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | There have been reports of people being unable to delegate patches to themselves, despite being a maintainer or the project to which the patch is associated. The issue is a result of how we do a check for whether the user is a maintainer of the patch's project [1]. This check is checking if a given 'User.id' is in the list of items referenced by 'Project.maintainer_project'. However, 'Project.maintainer_project' is a backref to 'UserProfile.maintainer_projects'. This means we're comparing 'User.id' and 'UserProfile.id'. Boo. This wasn't seen in testing since we've had a post-save callback [2] for some time that ensures we always create a 'UserProfile' object whenever we create a 'User' object. This also means we won't have an issue on deployments initially deployed after that post-save callback was added, a 'User' with id=N will always have a corresponding 'UserProfile' with id=N. However, that's not true for older deployments such as the ozlabs.org one. [1] https://github.com/getpatchwork/patchwork/blob/89c924f9bc/patchwork/api/patch.py#L108-L111 [2] https://github.com/getpatchwork/patchwork/blob/89c924f9bc/patchwork/models.py#L204-L210 Signed-off-by: Stephen Finucane <stephen@that.guru> Closes: #313 Reported-by: Bjorn Helgaas <helgaas@kernel.org>
* parsearchive, mail: use repr() to get a human readable exceptionDaniel Axtens2019-09-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently if we have particular types of error in mail parsing in parsearchive or parsemail, we print exc.message, which doesn't always work: Traceback (most recent call last): File ".../patchwork/management/commands/parsearchive.py", line 90, in handle obj = parse_mail(msg, options['list_id']) File ".../patchwork/parser.py", line 961, in parse_mail raise ValueError("Missing 'Message-Id' header") ValueError: Missing 'Message-Id' header During handling of the above exception, another exception occurred: Traceback (most recent call last): File "manage.py", line 11, in <module> execute_from_command_line(sys.argv) File ".../django/core/management/__init__.py", line 381, in execute_from_command_line utility.execute() File ".../django/core/management/__init__.py", line 375, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File ".../django/core/management/base.py", line 323, in run_from_argv self.execute(*args, **cmd_options) File ".../django/core/management/base.py", line 364, in execute output = self.handle(*args, **options) File ".../patchwork/management/commands/parsearchive.py", line 100, in handle logger.warning('Invalid mail: %s', exc.message) AttributeError: 'ValueError' object has no attribute 'message' repr(exc) will work. Use it. Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Stephen Finucane <stephen@that.guru>
* tests: make test suite pass with XML-RPC disabledDaniel Axtens2019-09-18
| | | | | | | Handy for development purposes. Signed-off-by: Daniel Axtens <dja@axtens.net> Reviewed-by: Stephen Finucane <stephen@that.guru>
* templates: Use 'static' rather than 'statictags' libraryAndrew Donnellan2019-09-14
| | | | | | | | statictags is being renamed to static, use of {% load statictags %} is deprecated and will break in Django 3. Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com> Signed-off-by: Daniel Axtens <dja@axtens.net>
* requirements: Use compatible MINOR releasesStephen Finucane2019-09-10
| | | | | | | | '~= 2.2' will match '2.2.N', '2.3.N', etc. but not '3.0.N'. What we want in most cases is to match '2.2.N' only. Ensure this is the case. Signed-off-by: Stephen Finucane <stephen@that.guru> Fixes: c90473ea ("requirements: Switch to compatible releases")
* requirements: Switch to compatible releasesStephen Finucane2019-09-10
| | | | | | | | | | | | | | | | In commit ab0c443691, we switched from using commit ranges to fixed ranges. This was a good idea in so far as it ensures we're providing an application with dependencies that are guaranteed to work. However, Patchwork as a project isn't active enough to warrant the continued busy work effort necessary to keep bumping these versions and it's probably about time to abandon the experiment. However, rather than switching back to version ranges, use the compatible releases feature introduced in PEP 440 [1]. This gives us most of the benefits of ranges but with a nicer syntax. [1] https://www.python.org/dev/peps/pep-0440/#compatible-release Signed-off-by: Stephen Finucane <stephen@that.guru>
* Update sphinxcontrib-openapi from 0.4.0 to 0.5.0pyup-bot2019-09-09
|
* Add support for django-debug-toolbar 2.0Stephen Finucane2019-09-09
| | | | | | We retain support for 1.11 when running with Python 2.7. Signed-off-by: Stephen Finucane <stephen@that.guru>
* Add support for djangorestframework 3.10Stephen Finucane2019-09-09
| | | | | | | This is necessary for proper Django 2.2 support. We retain support for older versions since 3.10 is Python 3-only. Signed-off-by: Stephen Finucane <stephen@that.guru>
* docs: Use '>=' in OpenAPI schema templateStephen Finucane2019-09-09
| | | | | | | This is consistent with how we're doing checks for v1.2 and reads a little better, IMO. Signed-off-by: Stephen Finucane <stephen@that.guru>
* Update mysqlclient from 1.3.14 to 1.4.4pyup-bot2019-09-09
|
* Update psycopg2-binary from 2.8.2 to 2.8.3pyup-bot2019-09-09
|
* Update psycopg2-binary from 2.8.2 to 2.8.3pyup-bot2019-09-09
|
* docker: Use pyenv for Python versionsStephen Finucane2019-09-08
| | | | | | | | This is slightly slower to initially configure but requires less hacking to get the same environment and should be a lot more maintainable (just a simple modification to change the Python version). Signed-off-by: Stephen Finucane <stephen@that.guru>
* docker: Simplify MySQL resetStephen Finucane2019-09-08
| | | | | | Just use the hardcoded configuration. Signed-off-by: Stephen Finucane <stephen@that.guru>
* Update django-filter from 2.1.0 to 2.2.0pyup-bot2019-09-08
|
* travis: Update postgreSQL 10 stepsStephen Finucane2019-09-08
| | | | | | | | | | | | | | | | | | This is failing since the update to Xenial [1] with the following warning: $ sudo -u postgres psql -c "grant ALL on DATABASE postgres to travis WITH GRANT OPTION;" could not change directory to "/home/travis/build/getpatchwork/patchwork": Permission denied psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5433"? Use the solution from [2] to resolve it. [1] https://travis-ci.org/getpatchwork/patchwork/jobs/582342649 [2] https://github.com/travis-ci/travis-ci/issues/8537#issuecomment-498299645 Signed-off-by: Stephen Finucane <stephen@that.guru>
* tests: Mark 'test_series.test_duplicated' as expected failureStephen Finucane2019-09-08
| | | | | | | | | This has been failing fairly frequently in Travis [1] but I'm not able to reproduce it locally. Skip things for now. [1] https://travis-ci.org/getpatchwork/patchwork/jobs/582342631 Signed-off-by: Stephen Finucane <stephen@that.guru>
* travis: Resolve issues with Python 3.7Stephen Finucane2019-09-08
| | | | | | | | | | | | | | Bump the distro version to xenial, as this is the first version to include Python 3.7 support. Bionic is also available but it doesn't support Python 3.5 [1]. In addition, skip a test that was valid on Python 3.4 - 3.6 but does not appear to be an issue for Python 3.7. [1] https://docs.travis-ci.com/user/reference/bionic/#python-support Signed-off-by: Stephen Finucane <stephen@that.guru> Fixes: 6267a5fa ("Drop support for Python 3.4, add Python 3.7")
* Update django from 1.11.22 to 1.11.24Stephen Finucane2019-09-08
| | | | Signed-off-by: Stephen Finucane <stephen@that.guru>
* Drop support for Python 3.4, add Python 3.7Stephen Finucane2019-09-08
| | | | | | | It's no longer supported upstream and the *second* last Ubuntu LTS release provides something newer. Time to move on. Signed-off-by: Stephen Finucane <stephen@that.guru>
* sql: Fix table listsAli Alnubani2019-09-06
| | | | | | | | | | | | | | The patch adds missing commas in the table lists where missing, and removes where unnecessary. This fixes errors such as the following when feeding the script to psql: psql:lib/sql/grant-all.postgres.sql:37: ERROR: syntax error at or near "patchwork_emailconfirmation" LINE 19: patchwork_emailconfirmation, ... Signed-off-by: Ali Alnubani <alialnu@mellanox.com> Reviewed-by: Stephen Finucane <stephen@that.guru> Fixes: ca0e79d4db34 ("sql: Sort 'grant-all' scripts alphabetically")
* Update django from 2.2.3 to 2.2.5pyup-bot2019-09-03
|
* Update django from 2.2.3 to 2.2.5pyup-bot2019-09-03
|