Page MenuHomeSoftware Heritage

add_forge_now: Add last_{moderator, modified_date} fields to Request
ClosedPublic

Authored by anlambert on Aug 12 2022, 6:18 PM.

Details

Summary

Previously, the last moderator and modification date for an Add Forge Now
request were retrieved by the model serializer.

While it is enough for display, it prevents to sort the requests by last
modification date when using datatables.

So prefer to add the last_moderator and last_modified_date to the Request
model instead and update their values when a new RequestHistory model
is created.

When running migrations, existing requests stored in production database
will have the values of these new fields set according to their history.

Fixes SWH-WEBAPP-3VJ

Diff Detail

Repository
rDWAPPS Web applications
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 D8244 (id=29727)

Rebasing onto efa99f8e2a...

Current branch diff-target is up to date.
Changes applied before test
commit 27e448ca12f538807c353484fe30b9edee8567bf
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Fri Aug 12 18:11:07 2022 +0200

    add_forge_now: Add last_{moderator, modified_date} fields to Request
    
    Previously, the last moderator and modification date for an Add Forge Now
    request were retrieved by the model serializer.
    
    While it is enough for display, it prevents to sort the requests by last
    modification date when using datatables.
    
    So prefer to add the last_moderator and last_modified_date to the Request
    model instead and update their values when a new RequestHistory model
    is created.
    
    When running migrations, existing requests stored in production database
    will have the values of these new fields set according to their history.

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

This revision is now accepted and ready to land.Aug 12 2022, 10:02 PM