Page MenuHomeSoftware Heritage

postgresql: Fix get_snapshot_branches return value for empty search
ClosedPublic

Authored by anlambert on Sep 16 2021, 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
Branch
postgresql-get-snapshot-branches-fix
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 23682
Build 36968: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 36967: arc lint + arc unit

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.Sep 16 2021, 2:59 PM