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

Error while calling code review #1157

Closed
lez-doit opened this issue Aug 19, 2024 · 2 comments
Closed

Error while calling code review #1157

lez-doit opened this issue Aug 19, 2024 · 2 comments

Comments

@lez-doit
Copy link

Hi, I'm currently trying to set up local run for PR-Agent, but unfortunately after I installed pr_agent library and copied example from here, every time i try to run the script, I get the following error stack:

Traceback (most recent call last):
  File "/app/pr_agent/cli.py", line 83, in <module>
    run()
  File "/app/pr_agent/cli.py", line 77, in run
    result = asyncio.run(PRAgent().handle_request(args.pr_url, [command] + args.rest))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/app/pr_agent/agent/pr_agent.py", line 96, in handle_request
    await command2class[action](pr_url, ai_handler=self.ai_handler, args=args).run()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/pr_agent/tools/pr_reviewer.py", line 44, in __init__
    self.git_provider.get_languages(), self.git_provider.get_files()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/pr_agent/git_providers/github_provider.py", line 538, in get_languages
    languages = self._get_repo().get_languages()
                ^^^^^^^^^^^^^^^^
  File "/app/pr_agent/git_providers/github_provider.py", line 690, in _get_repo
    self.repo_obj = self.github_client.get_repo(self.repo)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/github/MainClass.py", line 356, in get_repo
    assert isinstance(full_name_or_id, (str, int)), full_name_or_id
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: None

I tried re-creating GitHub token several times with different permissions (including full access to repositories), but it didn't help. Also when I tried running PR-Agent from docker image locally, acorrdingly to the same guide, I got exactly same stack trace.
Any help appreciated, thanks.

@mrT23
Copy link
Collaborator

mrT23 commented Aug 21, 2024

my guess is that the pr_url you are giving is wrong

You need to share significantly more details.
try first on a public pr. if it fails, share the entire command you ran

pr_url should be in the form of:
#1145

@lez-doit
Copy link
Author

my guess is that the pr_url you are giving is wrong

You need to share significantly more details. try first on a public pr. if it fails, share the entire command you ran

pr_url should be in the form of: #1145

you was right, there was an issue in PR link, ty

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

No branches or pull requests

2 participants