Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gracefully handle lack of CLA for Gerrit user #22

Open
ModeSevenIndustrialSolutions opened this issue Oct 21, 2024 · 3 comments
Open

Gracefully handle lack of CLA for Gerrit user #22

ModeSevenIndustrialSolutions opened this issue Oct 21, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@ModeSevenIndustrialSolutions
Copy link
Contributor

ModeSevenIndustrialSolutions commented Oct 21, 2024

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://onap.gh2gerrit@gerrit.onap.org:29418/portal-ng/bff
2024-10-21 15:33:29.901009 Running: git push --dry-run ssh://onap.gh2gerrit@gerrit.onap.org:29418/portal-ng/bff --all
ssh://onap.gh2gerrit@gerrit.onap.org:29418/portal-ng/bff did not work. Description: fatal: No Contributor Agreement on file for user ONAP github2gerrit <releng+onap.gh2gerrit@linuxfoundation.org> (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

@ModeSevenIndustrialSolutions
Copy link
Contributor Author

May not be necessary with the correct group settings... checking...

@ModeSevenIndustrialSolutions
Copy link
Contributor Author

This could potentially be handled/linked with #25

@tykeal tykeal added the enhancement New feature or request label Nov 7, 2024
@tykeal
Copy link
Member

tykeal commented Nov 7, 2024

Hmmmm, this is perhaps expected with our Gerrit setup:

Yes, this is expected if the account hasn't been added to one of the CLA groups.

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://onap.gh2gerrit@gerrit.onap.org:29418/portal-ng/bff
2024-10-21 15:33:29.901009 Running: git push --dry-run ssh://onap.gh2gerrit@gerrit.onap.org:29418/portal-ng/bff --all
ssh://onap.gh2gerrit@gerrit.onap.org:29418/portal-ng/bff did not work. Description: fatal: No Contributor Agreement on file for user ONAP github2gerrit <releng+onap.gh2gerrit@linuxfoundation.org> (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

Definitely should handle this gracefully and add a proper annotation to the job run instead of requiring folks to troll though job log.

The annotation should basically be $G2G_gerrit_account is not a member of an appropriate CLA group on $GERRIT. Please correct this error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants