Page MenuHomeSoftware Heritage

Move GitHubSession from github/lister.py to github/utils.py
ClosedPublic

Authored by vlorentz on Apr 25 2022, 3:45 PM.

Details

Summary

So it can be reused by other packages without importing lister.py itself

Addresses D7630#199321

Diff Detail

Repository
rDLS Listers
Branch
refacto
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 28723
Build 44884: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 44883: arc lint + arc unit

Unit TestsFailed

TimeTest
252 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.lister.github.tests.test_lister::test_anonymous_ratelimit
swh_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7f99006606d8> caplog = <_pytest.logging.LogCaptureFixture object at 0x7f99006700f0> requests_ratelimited = <requests_mock.mocker.Mocker object at 0x7f98ffcefa58>
2,134 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.lister.github.tests.test_lister::test_ratelimit_once_recovery[1]
swh_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7f98ff1921d0> caplog = <_pytest.logging.LogCaptureFixture object at 0x7f98ff192630> requests_ratelimited = <requests_mock.mocker.Mocker object at 0x7f98ff192940>
2,394 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.lister.github.tests.test_lister::test_ratelimit_reset_sleep[5-6-123456]
swh_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7f98ffa3e2b0> caplog = <_pytest.logging.LogCaptureFixture object at 0x7f98ffa3e198> requests_ratelimited = <requests_mock.mocker.Mocker object at 0x7f98ffa3e9e8>
64 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.lister.bitbucket.tests.test_lister::test_bitbucket_full_lister
1,595 msJenkins > .tox.py3.lib.python3.7.site-packages.swh.lister.bitbucket.tests.test_lister::test_bitbucket_incremental_lister
View Full Test Results (3 Failed · 204 Passed)

Event Timeline

Build has FAILED

Patch application report for D7645 (id=27666)

Could not rebase; Attempt merge onto 2fa9f0abd2...

Updating 2fa9f0a..3937b6c
Fast-forward
 swh/lister/github/lister.py            | 168 ++------------------------------
 swh/lister/github/tests/test_lister.py |   9 +-
 swh/lister/github/utils.py             | 170 +++++++++++++++++++++++++++++++++
 3 files changed, 183 insertions(+), 164 deletions(-)
 create mode 100644 swh/lister/github/utils.py
Changes applied before test
commit 3937b6cab5bfd62d2795c79ca09f014928070c65
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Mon Apr 25 15:44:39 2022 +0200

    Move GitHubSession from github/lister.py to github/utils.py
    
    So it can be reused by other packages without importing lister.py itself

commit f91caedbb2ed5eca2572b7b5ebe1413692496f60
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Thu Apr 21 20:34:50 2022 +0200

    github: Refactor rate-limiting out of the GitHubLister class
    
    This will allow the GitHub Metadata Fetcher to reuse the logic
    by importing the GitHubSession class.

commit d0924f39d04e7b7128c55a116280e2c6b6ec5a00
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Thu Apr 21 20:32:45 2022 +0200

    github: Remove dead code
    
    Authentication is handled directly in the session

Link to build: https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/495/
See console output for more information: https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/495/console

Harbormaster returned this revision to the author for changes because remote builds failed.Apr 25 2022, 3:49 PM
Harbormaster failed remote builds in B28723: Diff 27666!

Build has FAILED

Patch application report for D7645 (id=27667)

Rebasing onto 2fa9f0abd2...

Current branch diff-target is up to date.
Changes applied before test
commit 82a3717ec79e3890f5793ac2dafb740dda7989b1
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Mon Apr 25 15:44:39 2022 +0200

    Move GitHubSession from github/lister.py to github/utils.py
    
    So it can be reused by other packages without importing lister.py itself

commit f91caedbb2ed5eca2572b7b5ebe1413692496f60
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Thu Apr 21 20:34:50 2022 +0200

    github: Refactor rate-limiting out of the GitHubLister class
    
    This will allow the GitHub Metadata Fetcher to reuse the logic
    by importing the GitHubSession class.

commit d0924f39d04e7b7128c55a116280e2c6b6ec5a00
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Thu Apr 21 20:32:45 2022 +0200

    github: Remove dead code
    
    Authentication is handled directly in the session

Link to build: https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/496/
See console output for more information: https://jenkins.softwareheritage.org/job/DLS/job/tests-on-diff/496/console

Harbormaster returned this revision to the author for changes because remote builds failed.Apr 25 2022, 3:53 PM
Harbormaster failed remote builds in B28724: Diff 27667!

Build is green

Patch application report for D7645 (id=27668)

Could not rebase; Attempt merge onto 2fa9f0abd2...

Updating 2fa9f0a..2a99323
Fast-forward
 swh/lister/github/lister.py            | 168 ++------------------------------
 swh/lister/github/tests/test_lister.py |  15 +--
 swh/lister/github/utils.py             | 170 +++++++++++++++++++++++++++++++++
 3 files changed, 186 insertions(+), 167 deletions(-)
 create mode 100644 swh/lister/github/utils.py
Changes applied before test
commit 2a993230e6547ad19ce90f11e09c1a187c6c60a3
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Mon Apr 25 15:44:39 2022 +0200

    Move GitHubSession from github/lister.py to github/utils.py
    
    So it can be reused by other packages without importing lister.py itself

commit f91caedbb2ed5eca2572b7b5ebe1413692496f60
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Thu Apr 21 20:34:50 2022 +0200

    github: Refactor rate-limiting out of the GitHubLister class
    
    This will allow the GitHub Metadata Fetcher to reuse the logic
    by importing the GitHubSession class.

commit d0924f39d04e7b7128c55a116280e2c6b6ec5a00
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Thu Apr 21 20:32:45 2022 +0200

    github: Remove dead code
    
    Authentication is handled directly in the session

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

olasd added a subscriber: olasd.

Thanks!

This revision is now accepted and ready to land.Apr 25 2022, 5:00 PM

Build is green

Patch application report for D7645 (id=27699)

Could not rebase; Attempt merge onto 334c54091e...

Updating 334c540..2d04244
Fast-forward
 swh/lister/github/lister.py            | 160 ++-----------------------------
 swh/lister/github/tests/test_lister.py |  15 +--
 swh/lister/github/utils.py             | 170 +++++++++++++++++++++++++++++++++
 3 files changed, 186 insertions(+), 159 deletions(-)
 create mode 100644 swh/lister/github/utils.py
Changes applied before test
commit 2d04244cc950bfad254b7337449d2fe20e36f610
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Mon Apr 25 15:44:39 2022 +0200

    Move GitHubSession from github/lister.py to github/utils.py
    
    So it can be reused by other packages without importing lister.py itself

commit 9ee4a99f152d9d6cbe5a6a09895ce9384660be46
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Thu Apr 21 20:34:50 2022 +0200

    github: Refactor rate-limiting out of the GitHubLister class
    
    This will allow the GitHub Metadata Fetcher to reuse the logic
    by importing the GitHubSession class.

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