| Commit message (Collapse) | Author | Age |
|
|
|
|
| |
This should make changes to the registration form easier. I'm
particularly thinking about adding in the Django simple math captcha.
|
|
|
|
|
|
|
|
| |
Django 3.1 deprecates the ifequal and ifnotequal tags, for removal in 4.0.
Replace all occurrences of ifequal and ifnotequal with if.
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduces the ability to add relations between patches. Relations are
displayed in the details page of a patch under 'Related'. Related
patches located in another projects can be viewed as well.
Changes to relations are tracked in events. Currently the display of
this is very bare in the API but that will be fixed in a subsequent patch:
this is the minimum required to avoid throwing errors when you view the
events feed.
Signed-off-by: Mete Polat <metepolat2000@gmail.com>
[dja: address some review comments from Stephen, add an admin view,
move to using Events, misc tidy-ups.]
Signed-off-by: Daniel Axtens <dja@axtens.net>
|
|
|
|
|
|
|
|
|
| |
Move the series patch list from row 'Related' to 'Series'. This allows
us to use the 'Related' row for actually showing submission relations
instead.
Signed-off-by: Mete Polat <metepolat2000@gmail.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
|
|
|
|
|
|
|
| |
In HTML5, the type attribute of a script tag is optional if it's
JavaScript.
Remove all occurrences. The only real gain is slightly smaller page output,
but it also shuts up validators that like to be noisy about this.
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: Daniel Axtens <dja@axtens.net>
|
|
|
|
|
|
|
|
| |
It's not valid to put a <div> inside an <h1>. Move the download buttons in
the submission template outside the <h1> tag.
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: Daniel Axtens <dja@axtens.net>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new field to Project, commit_url_format, which specifies a
format string that can be used to generate a link to a particular
commit for a project.
This is used in the display of a patch, to render the patch's commit
as a clickable link back to the commit on the SCM website.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Daniel Axtens <dja@axtens.net>
|
|
|
|
|
|
|
|
| |
Add a link to the mailing list archive link to the patch detail page.
Suggested-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: Daniel Axtens <dja@axtens.net>
|
|
|
|
|
|
|
|
|
|
| |
Add a field to link to a project's mailing list archive, and display it on
the project info page.
Add the new field to the patchwork project in the supplied example fixture.
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: Daniel Axtens <dja@axtens.net>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Late in the development of the series feature, it was decided that there
were advantages to allowing an N:M relationship between series and
patches. This would allow us to do things like create complete series
where a sole vN patch was sent to a list rather than the full series.
After some time using series in the wild, it's apparent that such
features are very difficult to implement correctly and will likely never
be implemented. As such, it's time to start cleaning up the mess, paving
the way for things like an improved tagging feature.
There are some significant changes to the model required:
- models.py, migrations/0027, migrations/0028, migrations/0029
The migrations make the following changes:
1. - Add 'Patch.series_alt' and 'Patch.number' fields.
2. - Populate the 'Patch.series_alt' and 'Patch.number' fields from
their 'SeriesPatch' equivalents.
3. - Remove the 'SeriesPatch' model.
- Rename 'Patch.series_alt' to 'Patch.series'.
- Change 'Series.cover_letter' to a 'OneToOneField' since a cover
letter can no longer be assigned to multiple series.
Note that the migrations have to be split into multiple parts as the
combined migration raises an OperationalError as below.
(1072, "Key column 'series_alt_id' doesn't exist in table")
This is due to Django's penchant for creating indexes for newly
created fields, as noted here: https://stackoverflow.com/q/35158530/
Aside from the model changes, there are numerous other changes required:
- admin.py
Reflect model changes for the 'PatchInline' inline used by
'SeriesAdmin'
- api/cover.py, api/patch.py
Update the 'series' field for the cover letter and patch resources to
reflect the model changes. A 'to_representation' function is added in
both cases to post-process this field and make it look like a list
again. This is necessary to avoid breaking clients.
- parser.py
Update to reflect the replacement of 'SeriesPatch' with 'Patch'.
- signals.py
Update to filter on changes to 'Patch' instead of 'SeriesPatch'. This
requires some reworking due to how we set these fields now, as we can
no longer receive on 'post_save' signals for 'SeriesPatch' and must
instead watch for 'pre_save' on 'Patch', which is what we do for
delegate and state changes on same.
- templates/patchwork/*.html
Remove logic that handled multiple series in favour of the (simpler)
single series logic.
- tests/*
Modify the 'create_series_patch' helper to reflect the removal of the
'SeriesPatch' model. This entire helper will be removed in a future
change. Improve some tests to cover edge cases that were highlighted
during development
Unfortunately, all of the above changes must go in at the same time,
otherwise we end up with either (a) broken views, API etc. or (b) split
brain because we need to keep the new single-series fields alongside the
older multi-series fields and models while we rework the views. It's
unfortunate but there's not much to be done here.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Tested-by: Daniel Axtens <dja@axtens.net>
|
|
|
|
|
|
| |
No point in showing a filter that you can't change.
Signed-off-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
|
|
|
|
|
|
|
| |
This appears to have got lost in the transition to 'selectize.js'. In
brief, this will ensure that a previously selected delegate or submitter
is still enabled post-filtering. For more information, see [1].
[1] https://stackoverflow.com/a/45124779
Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes: #78
|
|
|
|
|
|
|
| |
This makes it a little easier to figure out what filters are active and
will be used in a future patch.
Signed-off-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We had registered an event handler on a checkbox in table header which
would call a function, 'checkboxes', on all checkboxes within that
table. This function, in turn, causes does its work and then triggers
event handlers for all modified checkboxes which include the original
table header checkbox. This resulted in the original event calling
itself recursively.
Resolve this by only modifying the checkboxes in the table body.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: 44fe7bae ("js: Allow shift-select of checkboxes")
|
|
|
|
|
|
|
| |
These got added accidentally during merge.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: 45fa5c5c ("templates: Move additional email subjects to templates")
|
|
|
|
|
|
| |
Further normalization to ensure all related code paths use similar code.
Signed-off-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
|
|
| |
Use a uniform pattern for this stuff.
Signed-off-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
|
|
|
| |
Again, this should make this a little more understandable as it ensures
a rough mapping exists between views and template names.
Signed-off-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
|
|
| |
Make ALL the things consistent.
Signed-off-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
|
|
|
|
| |
This makes things a little easier to parse. A couple of templates are
renamed and the 'register.mail' template, which appears to be unused
since commit f1e089f7, is removed.
Signed-off-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
|
|
|
|
| |
This is only used in a single view (where it probably shouldn't be used)
and some tests. It's an anti-pattern that makes it too easy to shoot
yourself in the foot. Remove it.
Signed-off-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to this patch, a typical /patch// query for linuxppc-dev
(which has about half a dozen checks per patch) took around 20 queries
and 16.5ms in the database. About half of those queries were fetching
the checks and who did the check.
We can just do one query to get all that needed information, so we do
that. This brings a page load down to 10 queries in 12ms.
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
e.g. a 10 comment patch goes from 26 queries in 17-20ms down to 20
queries in 12ms.
A 67 comment cover letter goes from 14 queries in 16ms down to 8 queries
in 8ms.
So, effectively, a near 2x perf improvement.
Previously, at several points we were asking for the latest series and
then asking for all the series. Since there just usually aren't *that*
many series, fetch them all and take the first one if we need to.
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
[stephenfin: Fix typos in the template and ensure patches from all
series are shown]
Signed-off-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using the example of id:20180720035941.6844-1-khandual@linux.vnet.ibm.com
with my test dataset of a chunk of a variety of mailing lists, has
this cover letter have 67 comments from a variety of people. Thus,
it's on the larger side of things.
Originally, displaying the /patch/550/ for this (redirected to /cover)
would take 81 SQL queries in ~60ms on my laptop.
After this optimisation, it's down to 14 queries in 14ms.
When the cache is cold, it's down to 32ms from 83ms.
The effect of this patch is to execute a join in the database to
get the submitter information for each comment at the same time as
getting all the comments rather than doing a one-by-one lookup after
the fact.
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 90d9ee14e73e8ec9248e89c788d64867c4a4bb74.
The root cause of this performance issue was not the use of the
JSONRenderer but rather the population of filter forms. The latter is
now disabled, meaning we can start using the original renderer.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Cc: Daniel Axtens <dja@axtens.net>
Acked-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Daniel Axtens <dja@axtens.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Something is very, very slow in the d-r-f browsable API events renderer.
In my MySQL test (~33k patches), the CPU time to render the events list
is ~11s, and the time taken by SQL queries is only ~3s. If the JSON
renderer is used, that drops to 0.2s for the entire page (because less
CPU is used, and - for some as yet unknown reason - a *very* expensive
db query is dropped.)
In my PostgreSQL test (~100k patches), the results are even more stark:
30s of CPU time and 0.2s of DB time goes to 0.25s for the entire page.
Something is seriously, seriously wrong with whatever d-r-f is doing.
So, simply render the event list as unlinked JSON for now.
There are a few followups we should do, but this is an important start -
no-one should be able to DoS a patchwork server by just enumerating the
events!
In particular, we should find out:
- why postgres and mysql behaviour is so different.
- what on earth d-r-f is doing that makes rendering the pretty-printed
version so incredibly slow.
Signed-off-by: Daniel Axtens <dja@axtens.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patchwork saves patches, comments etc with UTC timezone and reports
this time when opening the patch details. However, internally generated
processes such as events are reported with the instance's local time.
There's nothing wrong with that and making PW timezone-aware would add
useless complexity, but in a world-wide collaboration a lot of confusion
may arise as the timezone is not reported at all. Instance's local time
might be very different from the local time of CI integrating with PW,
which is different from the local time of person dealing with it etc.
Use UTC everywhere by default instead of UTC for sumbissions and local
timezone for internally generated events (which is not reported).
Signed-off-by: Veronika Kabatova <vkabatov@redhat.com>
[dja:
- squash 2 patches: https://patchwork.ozlabs.org/patch/876744/
https://patchwork.ozlabs.org/patch/877815/
- minor changes to both patches - rejig order of migrations and
adjust wording: "happened sooner" -> "happened earlier"]
Tested-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Daniel Axtens <dja@axtens.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
These versions are massively outdated and the only reason for keeping
them was to allow installation on RHEL 7 using the version provided via
EPEL. No one's actually using this so just kill it.
This also allows us to remove support for django-filter 0.11, which was
only retained for use with these older versions of Django.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Reviewed-by: Daniel Axtens <dja@axtens.net>
|
|
|
|
|
|
|
|
|
| |
Similar to what we already do on the patch list page, display the patch ID
on the patch detail page and make it a click-to-copy button.
Closes: #115 ("Show copy-able patch ID ("mpe mode") on patch detail page")
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In profile.html, if settings.ENABLE_REST_API == False, trying to render a
link to the generate_token page will raise a NoReverseMatch exception, so
we shouldn't render that. In any case, if the REST API is disabled, we
really shouldn't render the API token section of the page at all.
Only render the API token and generation link if settings.ENABLE_REST_API
is True.
Reported-by: Tomas Novotny <tomas@novotny.cz>
Closes: #138 ("NoReverseMatch exception on user login with disabled REST API")
Fixes: 85c8f369204a ("views: Provide a way to view, (re)generate tokens")
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
|
|
|
| |
Integrate token support into the web UI.
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
|
|
|
|
|
|
| |
We provide our own, much smaller implementation of this currently.
However, we want to be able to implement slightly different variants of
this elsewhere and using an existing library helps avoid reinventing the
wheel and lets us use already battle-tested code.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
|
|
|
|
| |
Fixes: d1c605f ("views: Stop using Bundle.public_url")
|
|
|
|
|
|
|
| |
This means using the correct link for the cover mbox and not displaying
one for the non-existent diff.
Signed-off-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
|
|
|
| |
We missed this previously and now it's breaking Django 1.6.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Fixes: 8ae7705 ("templates: Resolve cycle issues with Django 1.10")
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Suggested by a few people.
Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
|
|
| |
Simple usability improvement.
Signed-off-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|