Codium-ai / pr-agent

🚀CodiumAI PR-Agent: An AI-Powered 🤖 Tool for Automated Pull Request Analysis, Feedback, Suggestions and More! 💻🔍
Apache License 2.0
6.02k stars 586 forks source link

gitlab_provider asign personal_access_token to oauth_token may not work? #875

Closed wayn closed 3 months ago

wayn commented 6 months ago

gitlab_provider asign personal_access_token to oauth_token may not work?

self.gl = gitlab.Gitlab( url=gitlab_url, oauth_token=gitlab_access_token )

may change to self.gl = gitlab.Gitlab( url=gitlab_url, private_token=gitlab_access_token )

mrT23 commented 6 months ago

what?

Give more details, examples, and reproducible code demonstrating the problem, if it exists

wayn commented 6 months ago

ok, the code in the gitlab_provider.py in line 32 oauth_token is used for oauth token authentication private_token is used for personal access token

okotek commented 6 months ago

Hi @wayn What's the use case to use personal access token with GitLab? Usually you won't want to reply to webhooks with a personal access token.

wayn commented 6 months ago

Hi @okotek I see the code in project config settings use "PERSONAL_ACCESS_TOKEN". And if use oauth token may need to get access token dynamic but not define in the config file. I'm test set the "PERSONAL_ACCESS_TOKEN" in .secrets.toml config, and change the code oauth_token in gitlab_provider.py line 32 to private_token works well

okotek commented 6 months ago

I mean, in hat scenario would you deploy pragent with a personal access token? Do you want to suggest a PR?