Page MenuHomeSoftware Heritage

Support new repositories with old branches
ClosedPublic

Authored by Alphare on Feb 21 2022, 3:56 PM.

Details

Reviewers
ardumont
Group Reviewers
Reviewers
Maniphest Tasks
Restricted Maniphest Task
Commits
rDLDBZRd77083d7735e: Support new repositories with old branches
Summary

You can have a branch that does not support tags located in a repository
that has the newest format. This fixes T3963.

I've duplicated the check that the upgrade is actually done
in test_needs_upgrade, since the test would pass fine with an already
upgraded repo, albeit with a lower coverage.

Diff Detail

Repository
rDLDBZR BZR loader
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 27001
Build 42216: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 42215: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D7208 (id=26130)

Rebasing onto 77fd211f4d...

Current branch diff-target is up to date.
Changes applied before test
commit 51d989d25bccfc18173547ebcc4210f92f312875
Author: Raphaël Gomès <rgomes@octobus.net>
Date:   Mon Feb 21 15:52:05 2022 +0100

    Support new repositories with old branches
    
    You can have a branch that does not support tags located in a repository
    that has the newest format. This fixes T3963.
    
    I've duplicated the check that the upgrade is actually done
    in `test_needs_upgrade`, since the test would pass fine with an already
    upgraded repo, albeit with a lower coverage.

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

I've duplicated the check that the upgrade is actually done

The check that the upgrade is doing is actually duplicated...
(sounds better)

swh/loader/bzr/loader.py
267–271

gimme some lovin' type (please ;)

(i'm most probably wrong on the branch type)

Add typing and change commit description

swh/loader/bzr/loader.py
273–274

or something?

swh/loader/bzr/tests/test_loader.py
43

?

152

I've dropped the part about the bzr repository being in an old format as this sounds like a detail of this particular test.
(but i may be wrong).

lgtm

couple of remarks inline ;)

This revision is now accepted and ready to land.Feb 21 2022, 4:12 PM

Build is green

Patch application report for D7208 (id=26133)

Rebasing onto 77fd211f4d...

Current branch diff-target is up to date.
Changes applied before test
commit 2fafe91d3cc564ea02463467ba570586927a0667
Author: Raphaël Gomès <rgomes@octobus.net>
Date:   Mon Feb 21 15:52:05 2022 +0100

    Support new repositories with old branches
    
    You can have a branch that does not support tags located in a repository
    that has the newest format. This fixes T3963.
    
    The check that the upgrade is actually done is duplicated
    in `test_needs_upgrade`, since the test would pass fine with an already
    upgraded repo, albeit with a lower coverage.

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

Thanks, how about those?

swh/loader/bzr/loader.py
273–274

"Upgrade both repository and branch to the most recent supported version to be compatible with the loader."

swh/loader/bzr/tests/test_loader.py
43

What about "Repo is recent but branch does not support tags, needs upgraded"?

152

Aah, I forgot about the docstring.

It's a bit more precise, how about: "Repository format is correct, but the branch itself does not support tags and should be upgraded to the latest format"?

Thanks, how about those?

sure thing, go ahead ;)

swh/loader/bzr/tests/test_loader.py
152

sure ;)

Incorporate agreed upon changes

Build is green

Patch application report for D7208 (id=26134)

Rebasing onto 77fd211f4d...

Current branch diff-target is up to date.
Changes applied before test
commit d77083d7735ed5698643e6c46c117d5597789671
Author: Raphaël Gomès <rgomes@octobus.net>
Date:   Mon Feb 21 15:52:05 2022 +0100

    Support new repositories with old branches
    
    You can have a branch that does not support tags located in a repository
    that has the newest format. This fixes T3963.
    
    The check that the upgrade is actually done is duplicated
    in `test_needs_upgrade`, since the test would pass fine with an already
    upgraded repo, albeit with a lower coverage.

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