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

fix posting of comment in PR with --upload-test-report #3272

Merged
merged 1 commit into from
Apr 8, 2020

Conversation

boegel
Copy link
Member

@boegel boegel commented Apr 8, 2020

fix for bug that was introduced in recently merged PR #3189 that occurs when --upload-test-report:

Traceback (most recent call last):
  File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/lib/python2.7/site-packages/easybuild_framework-4.2.0.dev0-py2.7.egg/easybuild/main.py", line 518, in <module>
    main()
  File "/lib/python2.7/site-packages/easybuild_framework-4.2.0.dev0-py2.7.egg/easybuild/main.py", line 497, in main
    test_report_msg = overall_test_report(ecs_with_res, len(paths), overall_success, success_msg, init_session_state)
  File "/lib/python2.7/site-packages/easybuild_framework-4.2.0.dev0-py2.7.egg/easybuild/tools/testing.py", line 313, in overall_test_report
    txt = post_easyconfigs_pr_test_report(pr_nr, test_report, msg, init_session_state, success)
  File "/lib/python2.7/site-packages/easybuild_framework-4.2.0.dev0-py2.7.egg/easybuild/tools/testing.py", line 289, in post_easyconfigs_pr_test_report
    post_comment_in_issue(pr_nr, comment, account=pr_target_account, repo=pr_target_repo, github_user=github_user)
  File "/lib/python2.7/site-packages/easybuild_framework-4.2.0.dev0-py2.7.egg/easybuild/tools/github.py", line 554, in post_comment_in_issue
    status, data = pr_url.comments.post(body={'body': txt})
  File "/lib/python2.7/site-packages/easybuild_framework-4.2.0.dev0-py2.7.egg/easybuild/base/rest.py", line 137, in post
    return self.request(self.POST, url, json.dumps(body), headers, content_type='application/json')
  File "lib/python2.7/site-packages/easybuild_framework-4.2.0.dev0-py2.7.egg/easybuild/base/rest.py", line 174, in request
    conn = self.get_connection(method, url, body, headers)
  File "/lib/python2.7/site-packages/easybuild_framework-4.2.0.dev0-py2.7.egg/easybuild/base/rest.py", line 215, in get_connection
    connection = self.opener.open(request)
  File "/usr/lib64/python3.6/urllib/request.py", line 532, in open
    response = meth(req, response)
  File "/usr/lib64/python3.6/urllib/request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python3.6/urllib/request.py", line 570, in error
    return self._call_chain(*args)
  File "/usr/lib64/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib64/python3.6/urllib/request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

The underlying cause was the use of None in the URL composed to post the comment by the post_comment_in_issue function (called by post_easyconfigs_pr_test_report), for example:

== 2020-04-08 19:56:13,905 rest.py:214 DEBUG opening request:  https://api.github.com/repos/easybuilders/None/issues/10354/comments

This occurs because the default value for --pr-target-repo was changed to None in #3189...

@boegel boegel added the bug fix label Apr 8, 2020
@boegel boegel added this to the next release (4.2.0) milestone Apr 8, 2020
Copy link
Contributor

@zao zao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-u works again with this PR for me.

@zao
Copy link
Contributor

zao commented Apr 8, 2020

Going in, thanks @boegel!

@zao zao merged commit a90713a into easybuilders:develop Apr 8, 2020
@boegel boegel deleted the fix_post_comment branch April 8, 2020 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants