[PATCH 00/51] Series aware patchwork

Damien Lespiau damien.lespiau at intel.com
Sat Sep 12 01:54:33 AEST 2015


Here a few initial patches to make patchwork understand series instead of just
patches. This is not the end of the story, but a minimal-ish start to build
upon. What the series does:

  - Parse mails and creates Series objects (what you would expect all mails
    part of the same git send-email are part of the same series)
  - Display the list of series
  - Display details about the series (eg. cover latter + list of patches)
  - As first feature on top, add a way to assign a reviewer to that series

Screenshots!

  http://entropy.lespiau.name/patchwork/series-list.png
  http://entropy.lespiau.name/patchwork/series-details.png

The two main objects are Series and SeriesRevision. When a series is sent again
after review (v2), or when a single patch is sent as reply of one of the series
patches, patchwork should create a second SeriesRevision of the same Series.
ie. The series objects contains all subsequent revisions, after one or more
patches have been reworked.

One of the big design desisions was to introduce a REST API to expose series.
That's because I'm using Ajaxy things to access data from the page itself. My
plan is to grow that REST API to eventually replace the XML-RPC one and make a
lot of more things in the UI modern-ish, interfacing with the server through
the REST API.

The last two patches (Selenium integration, http://www.seleniumhq.org/) don't
really have to be there but I think using Selenium would be a great step
towards testing the interface itself, especially as I added quite a bit of
Javascript.

Next steps, some of them are well underway already:

  - This work doesn't have a series state. So we can't quite display the
    list of series with "action needed" by default. The state of the series
    depends on the state of the underlying patches and is not a simple function
    that can be expressed easily in SQL (except in stored procedures).

    So, what I do is compute the state of the series once one of its patches
    change state and store the resulting state in the series itself. It's
    making the SQL schema denormalized, but I think for the better.

  - There no filtering on Series implemented yet

  - Handling v2 of patches / series. I've quite a bit of code around this
    already. The goal is to understand when new versions of a series is sent
    (by matching the cover-letter title) and create a new revision of the
    original series object, deprecated the previous patches on way.

    The same can be done with a single patch, when it's sent as a reply of
    of the series patches.

  - RSS feed with series events. One of the things I'd like very soon is to
    have some interface exposing the new series so testing tools can pick them
    up and do their thing. I thought that a RSS feed is simple enough to do
    that and will work will a lot of established tools (jenkins can monitor XML
    content) and languages (2 lines to parse a RSS feed in python).

  - Have a git-pw git plugin using the REST API. I'd love a single

    $ git-pw apply-series 4321

    that would apply the series, augmented with the tags given to the patches,
    on the current branch. A nice way to kick start a command line client
    using the REST API.

  - There's plenty of work/refinements left of the UI itself, no doubt about
    it.

As always, thoughts and comments are most definitely welcomed.

-- 
Damien

Damien Lespiau (51):
  gitignore: Only ignore quilt files at the root of the repository
  tests: Fix a typo in the MboxPassThroughHeaderTest description
  parsemail: Return the list of prefixes when cleaning up the subject
  parsemail: Make find_content() return a MailContent object
  parsemail: Add a function to parse series markers eg. "1/12"
  parsemail: Extract building the list of mail references
  parsemail: Strip mail signatures from comments
  tests: Make sure all emails have a valid msgid
  person: Don't return the email along with the name in __unicode__
  series: Add a Series model
  series: Provide the migration step to add series
  series: Create Series objects when parsing mails
  series: Add unit tests for Series parsing
  model: Split a user_name() helper out of UserProfile
  models: Monkey patch User to have a name() method
  settings: Add Django REST framework to the project
  style: Move the background color of the table headers to a class
  api: Expose projects
  Move files where they belong
  api: Expose Series
  api: Expose Revisions
  js: Add jquery.dynatable.js
  dynatable: Allow the user to have a pre-defined per-page element
  dynatable: Use our theming for the table headers
  dynatable: Style the pagination widget to look list the patches one
  dynatable: Allow the user to have pre-defined pagination links
  gitignore: Explicitely ignore sub-directories in lib/packages
  series: Add a first attempt at a Series list view
  series: Add a detailed view a Series
  js: Extract a function that changes the current context
  users: Expose a way to get a list of users for autocompletion
  series: Make the reviewer field editable
  dynatable: Tweak dynatable to work with DRF ordering
  series: Enable sorting in the series list
  api: Make the series only editable by maintainers
  series: Only show the edit icon when the series is editable
  api: Expose a self object
  api: Extract a SeriesList mixin
  api: Add a way to retrieve the list of pending reviews
  series: Move the series table into its own template file
  js: Make the series API URL a parameter
  series: Add series to the TODO list
  series: Default to displaying series ordered by submission date
  toolbar: Provide a way to switch between Series and Patches views
  urls: Create another entry point for the list of patches
  series: Always return a displayable name in submitter__name
  models: Split the notication logic into its own function
  models: Provide a string representation of Series
  models: Provide a string representation of SeriesRevision
  tests: Add a couple of Selenium tests
  tests: Add a way for the user to skip selenium tests

 .gitignore                                         |    4 +-
 docs/requirements-base.txt                         |    2 +
 docs/requirements-dev.txt                          |    1 +
 htdocs/css/jquery.dynatable.css                    |    1 +
 htdocs/css/style.css                               |   16 +-
 htdocs/js/jquery.dynatable.js                      |    1 +
 htdocs/js/patchwork.js                             |  278 +++
 lib/packages/.gitignore                            |    2 +-
 lib/packages/jquery/README                         |    5 +
 lib/packages/jquery/jquery.dynatable.css           |   63 +
 lib/packages/jquery/jquery.dynatable.js            | 1778 ++++++++++++++++++++
 patchwork/bin/parsemail.py                         |  171 +-
 patchwork/migrations/0004_series.py                |   73 +
 patchwork/models.py                                |  106 +-
 patchwork/serializers.py                           |   67 +
 patchwork/settings/base.py                         |   12 +
 patchwork/templates/patchwork/list.html            |    4 +
 patchwork/templates/patchwork/patch-list.html      |    2 +-
 patchwork/templates/patchwork/profile.html         |    6 +-
 patchwork/templates/patchwork/series-list.html     |   25 +
 patchwork/templates/patchwork/series.html          |  119 ++
 patchwork/templates/patchwork/todo-list.html       |   18 +-
 patchwork/templates/patchwork/todo-lists.html      |    2 +-
 patchwork/tests/browser.py                         |  159 ++
 patchwork/tests/mail/series/0001-single-mail.mbox  |   75 +
 .../series/0010-multiple-mails-cover-letter.mbox   |   57 +
 .../series/0011-multiple-mails-cover-letter.mbox   |   64 +
 .../series/0012-multiple-mails-cover-letter.mbox   |  348 ++++
 .../series/0013-multiple-mails-cover-letter.mbox   |   63 +
 .../series/0014-multiple-mails-cover-letter.mbox   |  232 +++
 patchwork/tests/test_mboxviews.py                  |    2 +-
 patchwork/tests/test_patchparser.py                |  121 +-
 patchwork/tests/test_series.py                     |  157 ++
 patchwork/tests/test_user_browser.py               |   38 +
 patchwork/tests/utils.py                           |    5 +
 patchwork/urls.py                                  |   43 +
 patchwork/views/api.py                             |  117 ++
 patchwork/views/base.py                            |   32 +-
 patchwork/views/series.py                          |   43 +
 patchwork/views/user.py                            |    7 +-
 templates/base.html                                |   15 +-
 templates/patchwork/series-list-table.html         |   36 +
 42 files changed, 4274 insertions(+), 96 deletions(-)
 create mode 120000 htdocs/css/jquery.dynatable.css
 create mode 120000 htdocs/js/jquery.dynatable.js
 create mode 100644 htdocs/js/patchwork.js
 create mode 100644 lib/packages/jquery/jquery.dynatable.css
 create mode 100644 lib/packages/jquery/jquery.dynatable.js
 create mode 100644 patchwork/migrations/0004_series.py
 create mode 100644 patchwork/serializers.py
 create mode 100644 patchwork/templates/patchwork/series-list.html
 create mode 100644 patchwork/templates/patchwork/series.html
 create mode 100644 patchwork/tests/browser.py
 create mode 100644 patchwork/tests/mail/series/0001-single-mail.mbox
 create mode 100644 patchwork/tests/mail/series/0010-multiple-mails-cover-letter.mbox
 create mode 100644 patchwork/tests/mail/series/0011-multiple-mails-cover-letter.mbox
 create mode 100644 patchwork/tests/mail/series/0012-multiple-mails-cover-letter.mbox
 create mode 100644 patchwork/tests/mail/series/0013-multiple-mails-cover-letter.mbox
 create mode 100644 patchwork/tests/mail/series/0014-multiple-mails-cover-letter.mbox
 create mode 100644 patchwork/tests/test_series.py
 create mode 100644 patchwork/tests/test_user_browser.py
 create mode 100644 patchwork/views/api.py
 create mode 100644 patchwork/views/series.py
 create mode 100644 templates/patchwork/series-list-table.html

-- 
2.1.0



More information about the Patchwork mailing list