Please help fill in this template with all the details to help others help you more efficiently. Use formatting blocks for code, config, logs and ensure to remove sensitive data.
Problem to solve
we have self hosted gitlab and trying to add codium pr agent yml pipeline , the problem is in runner/config.toml file , the admin not ready to change the previlege to true , so , i have to find alternative to create pipeline , u have created it , but im getting the error
*stages:
pr_review
pr_agent_job:
stage: pr_review
image: codiumai/pr-agent:latest # Use the specific Docker image designed for the PR Agent
script:
- python cli.py --openai-api-key $OPENAI_KEY --pr-url=“${CI_PROJECT_URL}/-/merge_requests/${CI_MERGE_REQUEST_IID}” review
only:
- merge_requests
variables:
GITLAB_TOKEN: $GITLAB_PR_AGENT_PAT # Personal Access Token for the GitLab API
GITLAB_URL: “self hosted gitlab link” # Your self-hosted GitLab URL
*
Which troubleshooting steps have you already taken? Can you link to any docs or other resources so we know where you have been?
Configuration
Add the CI/CD configuration from .gitlab-ci.yml and other configuration if relevant (e.g. docker-compose.yml). Alternatively, create a public GitLab.com example project that provides all necessary files to reproduce the question.
Versions
Please select whether options apply, and add the version information.
Thanks for responding for my issue.
I just currently setup environment variable to gitlab
and creating following yml
I have tried this one though , getting the following issue , I have attached in screen shot.
current modification
stages:
- build
- pr_review
pr_agent_job:
stage: pr_review
image:
name: codiumai/pr-agent:latest
entrypoint: [""]
script:
- python /app/pr_agent/cli.py --openai-api-key "$OPENAI_KEY" --pr-url="${CI_PROJECT_URL}/-/merge_requests/${CI_MERGE_REQUEST_IID}" review
only:
- merge_requests
variables:
OPENAI_KEY: $OPENAI_KEY
CI_PROJECT_URL: $CI_PROJECT_URL
CI_MERGE_REQUEST_IID: $CI_MERGE_REQUEST_IID
Okay. So now the issue is obviously just the invocation of the command itself. The --openai-api-key "$OPENAI_KEY" must come after the review, as it’s stated by the help hint. So perhaps try the following:
Yeah, I even tried your suggestion, but it didn’t work. For the self-hosted GitLab, I created a pipeline for the PR agent, but the documentation lacks sufficient detail and there is no proper direction.