Page MenuHomeSoftware Heritage

gitea.lister: Fix uid to be unique across instance
ClosedPublic

Authored by ardumont on Sep 10 2020, 11:08 AM.

Details

Summary

The gitea lister can be run on multiple instances which could use the same id.
So listing another gitea instance, the current code would fail to insert data
for such case.

This commit fixes that behavior by prefixing the uid with the instance name.

Related to T2577

Test Plan

tox

Diff Detail

Repository
rDLS Listers
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 D3903 (id=13755)

Rebasing onto e3c856b5ee...

Current branch diff-target is up to date.
Changes applied before test
commit b71d4660be8afaf5f82cbf58adcb2b21e3aef8ce
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Sep 10 11:05:31 2020 +0200

    gitea.lister: Fix uid to be unique across instance
    
    The gitea lister can be run on multiple instances which could use the same id.
    So listing another gitea instance, the current code would fail to insert data
    for such case.
    
    This commit fixes that behavior by prefixing the uid with the instance name.
    
    Related to T2577

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

swh/lister/gitea/lister.py
38

repo["uid"] not id

38

repo["id"] even!

Build is green

Patch application report for D3903 (id=13756)

Rebasing onto e3c856b5ee...

Current branch diff-target is up to date.
Changes applied before test
commit 31efda62e7a213163294a14ea6f65e43c6e8155c
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Thu Sep 10 11:05:31 2020 +0200

    gitea.lister: Fix uid to be unique across instance
    
    The gitea lister can be run on multiple instances which could use the same id.
    So listing another gitea instance, the current code would fail to insert data
    for such case.
    
    This commit fixes that behavior by prefixing the uid with the instance name.
    
    Related to T2577

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

This revision is now accepted and ready to land.Sep 10 2020, 11:29 AM