This is an attempt to fix #117 and simplify the handling of
properties and configuration.
The idea is to split properties in three parts:
- configuration, which is for projects only and is the only part that
remains writable via the legacy API. However, the API call overwrites
the configuration entirely, which simplifies the JavaScript code a bit
(however, that part is untested)
- flags, which are only for messages and are used for searches (again,
mostly untested). I am using a not-particularly-efficient but simple
text representation for them, hoping that indices save the day.
- properties, which cover what's left and are basically the scribbling
area for plugins.
So now we have three concepts instead of one, but I think things do become
simpler because we lose complicated cross-table manipulations in favor of
just having some JSON stored in a field. In fact, if you do not consider
migrations, the code loses a hundred lines or so.
The old concept of properties also remains in the legacy API that is used by
the importer. This however is limited to git.head and git.push_to; in order
to drop that, we will have to switch to the REST API.
The patch is on top of origin/next.
Paolo
Paolo Bonzini (10):
api, patchew-cli: remove commands to directly access properties
git: do not return properties from applier-get
api: do not blindly return all properties from get-projects
models: introduce flags into Messages
mods: rename project_property_schema to project_config_schema
mods: refactor extraction of configuration into a dictionary
models: store plugin configuration in a single, separate JSONField
models: add property fields to Message
models: switch from property tables to field
models: remove property tables
api/admin.py | 14 +-
api/migrations/0046_message_flags.py | 20 +++
.../0047_message_flags_postgres_fts.py | 22 +++
api/migrations/0048_populate_message_flags.py | 42 +++++
api/migrations/0049_project_config.py | 22 +++
.../0050_populate_project_config.py | 56 +++++++
api/migrations/0051_auto_20190418_1346.py | 33 ++++
.../0052_populate_property_fields.py | 67 ++++++++
api/migrations/0053_auto_20190418_1357.py | 37 +++++
api/models.py | 153 +++++++++---------
api/search.py | 15 +-
api/views.py | 71 +++-----
mod.py | 112 +++++--------
mods/email.py | 16 +-
mods/git.py | 62 +++----
mods/tags.py | 5 +-
mods/testing.py | 65 +++-----
patchew-cli | 65 +-------
tests/patchewtest.py | 12 +-
tests/test_git.py | 11 +-
tests/test_testing.py | 44 +++--
21 files changed, 553 insertions(+), 391 deletions(-)
create mode 100644 api/migrations/0046_message_flags.py
create mode 100644 api/migrations/0047_message_flags_postgres_fts.py
create mode 100644 api/migrations/0048_populate_message_flags.py
create mode 100644 api/migrations/0049_project_config.py
create mode 100644 api/migrations/0050_populate_project_config.py
create mode 100644 api/migrations/0051_auto_20190418_1346.py
create mode 100644 api/migrations/0052_populate_property_fields.py
create mode 100644 api/migrations/0053_auto_20190418_1357.py
--
2.21.0
_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel