Page MenuHomeSoftware Heritage

Add a warning and a command to help user to login
ClosedPublic

Authored by marmoute on Sep 27 2022, 5:39 PM.

Details

Summary

scanner: issue a warning when no auth token exists

This should make the problem more obvious to new users.

scanner: add a swh scanner login command

The command will help people to setup their authentication token.

There are more manual step than we would like, but this pave the way to
even more automated method.

login: automatically fetch a token through the API

Test Plan

Tox is happy, and the command work as intended.

Diff Detail

Repository
rDTSCN Code scanner
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build has FAILED

Patch application report for D8555 (id=30867)

Rebasing onto 90534ecae4...

Current branch diff-target is up to date.
Changes applied before test
commit 534224eb5342c1353ac86f684592c7efd79df1bf
Author: Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Date:   Tue Sep 27 17:22:35 2022 +0200

    login: automatically fetch a token through the API

commit 807f40da73b9ad9d2df5088a4fc87e530d10cb19
Author: Raphaël Gomès <rgomes@octobus.net>
Date:   Tue Sep 27 09:55:00 2022 +0200

    scanner: add a `swh scanner login` command
    
    The command will help people to setup their authentication token.
    
    There are more manual step than we would like, but this pave the way to
    even more automated method.

commit aa89238fb2b0d2b66f76fa52ad65026e29daaa36
Author: Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Date:   Tue Sep 27 16:55:15 2022 +0200

    scanner: issue a warning when no auth token exists
    
    This should make the problem more obvious to new users.

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

Harbormaster returned this revision to the author for changes because remote builds failed.Sep 27 2022, 5:39 PM
Harbormaster failed remote builds in B31840: Diff 30867!

Fixed some minor formating issues.

Build has FAILED

Patch application report for D8555 (id=30868)

Rebasing onto 90534ecae4...

Current branch diff-target is up to date.
Changes applied before test
commit 1dff3b7d8c4aad95a6ae7f80b027f46c3f07fd78
Author: Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Date:   Tue Sep 27 17:22:35 2022 +0200

    login: automatically fetch a token through the API

commit 7659b489d6ecff86371b092faa35b5b4ca3dd648
Author: Raphaël Gomès <rgomes@octobus.net>
Date:   Tue Sep 27 09:55:00 2022 +0200

    scanner: add a `swh scanner login` command
    
    The command will help people to setup their authentication token.
    
    There are more manual step than we would like, but this pave the way to
    even more automated method.

commit e43486a30b9ebd8586356a97cb46f897c96c7c4a
Author: Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Date:   Tue Sep 27 16:55:15 2022 +0200

    scanner: issue a warning when no auth token exists
    
    This should make the problem more obvious to new users.

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

Harbormaster returned this revision to the author for changes because remote builds failed.Sep 27 2022, 5:42 PM
Harbormaster failed remote builds in B31841: Diff 30868!

lgtm.

nitpicks below:

swh/scanner/cli.py
75–76

feels more natural imo

142–143
163
175

Applied suggestion from vlorentz

Build has FAILED

Patch application report for D8555 (id=30897)

Rebasing onto 90534ecae4...

Current branch diff-target is up to date.
Changes applied before test
commit 0fe2d3b766bfc241995ebef2c574c7851a910e8b
Author: Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Date:   Tue Sep 27 17:22:35 2022 +0200

    login: automatically fetch a token through the API

commit bb7456251e7f62c5836abbc40e20b1d8311e6e94
Author: Raphaël Gomès <rgomes@octobus.net>
Date:   Tue Sep 27 09:55:00 2022 +0200

    scanner: add a `swh scanner login` command
    
    The command will help people to setup their authentication token.
    
    There are more manual step than we would like, but this pave the way to
    even more automated method.

commit 04e5e575fa200169467d2bbd3cc5c41697b76d33
Author: Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Date:   Tue Sep 27 16:55:15 2022 +0200

    scanner: issue a warning when no auth token exists
    
    This should make the problem more obvious to new users.

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

Harbormaster returned this revision to the author for changes because remote builds failed.Sep 28 2022, 4:16 PM
Harbormaster failed remote builds in B31870: Diff 30897!

I am not sure how to approach the mypy failure.

Build is green

Patch application report for D8555 (id=30898)

Rebasing onto 90534ecae4...

Current branch diff-target is up to date.
Changes applied before test
commit a73f423856cceeb7ff99b44bcf7402ed845fb577
Author: Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Date:   Tue Sep 27 17:22:35 2022 +0200

    login: automatically fetch a token through the API

commit bb7456251e7f62c5836abbc40e20b1d8311e6e94
Author: Raphaël Gomès <rgomes@octobus.net>
Date:   Tue Sep 27 09:55:00 2022 +0200

    scanner: add a `swh scanner login` command
    
    The command will help people to setup their authentication token.
    
    There are more manual step than we would like, but this pave the way to
    even more automated method.

commit 04e5e575fa200169467d2bbd3cc5c41697b76d33
Author: Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Date:   Tue Sep 27 16:55:15 2022 +0200

    scanner: issue a warning when no auth token exists
    
    This should make the problem more obvious to new users.

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

Build is green

Patch application report for D8555 (id=30900)

Rebasing onto 90534ecae4...

Current branch diff-target is up to date.
Changes applied before test
commit da5b410c31c945bedd8deb4afb3195175a4fd220
Author: Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Date:   Tue Sep 27 17:22:35 2022 +0200

    login: automatically fetch a token through the API

commit bb7456251e7f62c5836abbc40e20b1d8311e6e94
Author: Raphaël Gomès <rgomes@octobus.net>
Date:   Tue Sep 27 09:55:00 2022 +0200

    scanner: add a `swh scanner login` command
    
    The command will help people to setup their authentication token.
    
    There are more manual step than we would like, but this pave the way to
    even more automated method.

commit 04e5e575fa200169467d2bbd3cc5c41697b76d33
Author: Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Date:   Tue Sep 27 16:55:15 2022 +0200

    scanner: issue a warning when no auth token exists
    
    This should make the problem more obvious to new users.

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

  • login: automatically fetch a token through the API

Build is green

Patch application report for D8555 (id=30904)

Rebasing onto 90534ecae4...

Current branch diff-target is up to date.
Changes applied before test
commit 34cb27b5817c939109dc445426148a46f6ae78be
Author: Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Date:   Tue Sep 27 17:22:35 2022 +0200

    login: automatically fetch a token through the API

commit bb7456251e7f62c5836abbc40e20b1d8311e6e94
Author: Raphaël Gomès <rgomes@octobus.net>
Date:   Tue Sep 27 09:55:00 2022 +0200

    scanner: add a `swh scanner login` command
    
    The command will help people to setup their authentication token.
    
    There are more manual step than we would like, but this pave the way to
    even more automated method.

commit 04e5e575fa200169467d2bbd3cc5c41697b76d33
Author: Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Date:   Tue Sep 27 16:55:15 2022 +0200

    scanner: issue a warning when no auth token exists
    
    This should make the problem more obvious to new users.

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

Build is green

Patch application report for D8555 (id=30910)

Rebasing onto f4f0917769...

Current branch diff-target is up to date.
Changes applied before test
commit 29f374fb9381e6f0b4c9a85d8deb4e50370a63a1
Author: Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Date:   Tue Sep 27 17:22:35 2022 +0200

    login: automatically fetch a token through the API

commit 15722e9c98df80fba9d8fe700cf6a31951689d3e
Author: Raphaël Gomès <rgomes@octobus.net>
Date:   Tue Sep 27 09:55:00 2022 +0200

    scanner: add a `swh scanner login` command
    
    The command will help people to setup their authentication token.
    
    There are more manual step than we would like, but this pave the way to
    even more automated method.

commit 2739555f3ba70674b369b5a4635218304cece25d
Author: Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Date:   Tue Sep 27 16:55:15 2022 +0200

    scanner: issue a warning when no auth token exists
    
    This should make the problem more obvious to new users.

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

This revision is now accepted and ready to land.Sep 29 2022, 5:28 PM

Build is green

Patch application report for D8555 (id=30971)

Rebasing onto 5f3140ab75...

Current branch diff-target is up to date.
Changes applied before test
commit 9a8258a7719a9a33e95070854a8728f36da3f6c9
Author: Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Date:   Tue Sep 27 17:22:35 2022 +0200

    login: automatically fetch a token through the API

commit 4aad6c17e8b38ab124c6b42acf73c2a61b227a5a
Author: Raphaël Gomès <rgomes@octobus.net>
Date:   Tue Sep 27 09:55:00 2022 +0200

    scanner: add a `swh scanner login` command
    
    The command will help people to setup their authentication token.
    
    There are more manual step than we would like, but this pave the way to
    even more automated method.

commit ee788b24bcd0597e923e981b8e598dd74185e2f7
Author: Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Date:   Tue Sep 27 16:55:15 2022 +0200

    scanner: issue a warning when no auth token exists
    
    This should make the problem more obvious to new users.

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