Page MenuHomeSoftware Heritage

server: rewrite using class-based views
ClosedPublic

Authored by seirl on Jul 23 2020, 3:11 PM.

Details

Test Plan

pytest

Diff Detail

Repository
rDGRPH Compressed graph representation
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D3604 (id=12690)

Could not rebase; Attempt merge onto 3943007422...

Updating 3943007..025663c
Fast-forward
 docs/api.rst                                       |  32 +-
 .../java/org/softwareheritage/graph/Entry.java     |  12 +
 .../graph/algo/EdgeIdConsumer.java                 |   9 +
 .../org/softwareheritage/graph/algo/Traversal.java |  14 +-
 swh/graph/backend.py                               |  11 +
 swh/graph/client.py                                |   8 +
 swh/graph/graph.py                                 |   6 +
 swh/graph/pid.py                                   |   6 +-
 swh/graph/server/app.py                            | 405 ++++++++++++---------
 swh/graph/tests/test_api_client.py                 |  28 ++
 swh/graph/tests/test_graph.py                      |  28 ++
 11 files changed, 378 insertions(+), 181 deletions(-)
 create mode 100644 java/src/main/java/org/softwareheritage/graph/algo/EdgeIdConsumer.java
Changes applied before test
commit 025663c52325a6c8946446887726899daed80e48
Author: Antoine Pietri <antoine.pietri1@gmail.com>
Date:   Thu Jul 23 15:10:38 2020 +0200

    server: rewrite using class-based views

commit d987735e40d74adfc13e6f88956f0d6be26720cb
Author: Antoine Pietri <antoine.pietri1@gmail.com>
Date:   Thu Jul 23 13:15:08 2020 +0200

    doc: add visit/edges endpoint documentation

commit 1e9b322ea34dbb67dbd205283c0891790bb56e89
Author: Antoine Pietri <antoine.pietri1@gmail.com>
Date:   Thu Jul 23 13:05:06 2020 +0200

    pid: use SWHID functions instead of deprecated PID ones

commit dd9ecf6e6fc70489c882d9518b301a774188fc0f
Author: Antoine Pietri <antoine.pietri1@gmail.com>
Date:   Thu Jul 23 11:26:15 2020 +0200

    Add visit_edges endpoint

See https://jenkins.softwareheritage.org/job/DGRPH/job/tests-on-diff/12/ for more details.

So it turns out that using multiprocessing to spawn a web app that we want to test isn't exactly great coverage... I'll check what I can do about that.

Probably in a separate diff though, as this problem was already present before.

could you explain why you do this in your commit message? I have no opinion on whether one version is objectively better than the other, but you may have a reason for doing it :-)

besides a missing why paragraph in the commit message, lgtm

This revision is now accepted and ready to land.Jul 27 2020, 5:23 PM

Rebase + add commit message

This revision was landed with ongoing or failed builds.Aug 3 2020, 10:40 PM
This revision was automatically updated to reflect the committed changes.

Build is green

Patch application report for D3604 (id=13005)

Rebasing onto c5802bbe59...

Current branch diff-target is up to date.
Changes applied before test
commit 606a9a481f41567ec17f12c21a47553623f8dca4
Author: Antoine Pietri <antoine.pietri1@gmail.com>
Date:   Thu Jul 23 15:10:38 2020 +0200

    server: rewrite using class-based views
    
    This allows for a more in-depth refactor of the logic in each view. We
    can create views that simply override a specific behavior of some
    generic views, instead of having to write ugly spaghetti code in the
    form of nested functions that return other parametrized functions.

See https://jenkins.softwareheritage.org/job/DGRPH/job/tests-on-diff/15/ for more details.