Page MenuHomeSoftware Heritage

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

Authored by ardumont on Thu, Sep 10, 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

ardumont created this revision.Thu, Sep 10, 11:08 AM

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.

ardumont added inline comments.Thu, Sep 10, 11:14 AM
swh/lister/gitea/lister.py
38

repo["uid"] not id

38

repo["id"] even!

ardumont updated this revision to Diff 13756.Thu, Sep 10, 11:21 AM

Fix repo["id"]

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.

vsellier accepted this revision.Thu, Sep 10, 11:29 AM
vsellier added a subscriber: vsellier.

LGTM

This revision is now accepted and ready to land.Thu, Sep 10, 11:29 AM
This revision was automatically updated to reflect the committed changes.