Skip to content

Gracefully handle lack of CLA for Gerrit user #22

@ModeSevenIndustrialSolutions

Description

Hmmmm, this is perhaps expected with our Gerrit setup:

2024-10-21 15:33:29.899501 Running: git config --get gitreview.username
2024-10-21 15:33:29.900999 ... gitreview.username = onap.gh2gerrit
No remote set, testing ssh://[email protected]:29418/portal-ng/bff
2024-10-21 15:33:29.901009 Running: git push --dry-run ssh://[email protected]:29418/portal-ng/bff --all
ssh://[email protected]:29418/portal-ng/bff did not work. Description: fatal: No Contributor Agreement on file for user ONAP github2gerrit <[email protected]> (id=8473)https://gerrit.onap.org/r/settings#Agreements
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Could not connect to gerrit.
Enter your gerrit username: We don't know where your gerrit is. Please manually create a remote
named 'gerrit' and try again.
    _main()
  File "/opt/hostedtoolcache/Python/3.11.10/x[64](https://github.com/onap/portal-ng-bff/actions/runs/11443571090/job/31836520780#step:13:65)/lib/python3.11/site-packages/git_review/cmd.py", line 1722, in _main
    check_remote(branch, remote, config['scheme'],
  File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/git_review/cmd.py", line 891, in check_remote
    add_remote(scheme, hostname, port, project, remote, usepushurl)
  File "/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/git_review/cmd.py", line 472, in add_remote
    username = input("Enter your gerrit username: ")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
EOFError: EOF when reading a line

However, it doesn't look like we're handling the error gracefully.
We should probably put a fix in place.

This was captured from the workflow run here

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions