Page MenuHomeSoftware Heritage

postgresql: Fix get_snapshot_branches return value for empty search
ClosedPublic

Authored by anlambert on Thu, Sep 16, 2:15 PM.

Details

Summary

When searching for branches in an existing snapshot, a PartialBranches
object must be returned regardless the number of found branches.

None should only be returned when a snapshot does not exist.

This fixes an inconsistency between the postgresql and cassandra
backends.

This will also fix that webapp reported issue.

Related to T3413

Diff Detail

Repository
rDSTO Storage manager
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 D6283 (id=22750)

Rebasing onto a9fde72c48...

Current branch diff-target is up to date.
Changes applied before test
commit 9465054ef0030f33014d170bdcfaf8f4023eb47e
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Thu Sep 16 14:08:33 2021 +0200

    postgresql: Fix get_snapshot_branches return value for empty search
    
    When searching for branches in an existing snapshot, a PartialBranches
    object must be returned regardless the number of found branches.
    
    None should only be returned when a snapshot does not exist.
    
    This fixes an inconsistency between the postgresql and cassandra
    backends.
    
    Related to T3413

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

This revision is now accepted and ready to land.Thu, Sep 16, 2:59 PM