-
Notifications
You must be signed in to change notification settings - Fork 6.6k
docs: update GitLab integration to use GitLab Duo provider #8294
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
Conversation
Replace Anthropic provider with native GitLab Duo integration: - Configure GitLab Duo provider with CI_JOB_TOKEN authentication - Add @gitlab/opencode-gitlab-plugin for GitLab API tools - Remove all custom CI/CD variables (ANTHROPIC_API_KEY, GITLAB_HOST, GITLAB_TOKEN_OPENCODE) - Use GitLab predefined variables (CI_JOB_TOKEN, CI_SERVER_HOST, CI_PROJECT_PATH) - Remove glab CLI dependency - plugin provides direct API access - Add 'Using GitLab Tools' section with practical examples - Update documentation link to opencode-gitlab-plugin - Simplify setup - zero custom configuration required The configuration now uses only GitLab's built-in CI/CD variables and provides native integration with GitLab Duo for AI-powered assistance.
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
|
lgtm but if yall have ur own process ill wait for Viktor to approve as well |
|
@rekram1-node I would double check with @nagyv before the merge, since it was his contribution. :) |
|
@vglafirov While I understand that GitLab would like to push its GitLab Duo models and I think #7333 is a great addition to OpenCode, I consider this documentation change a step back to everyone who is not a GitLab Duo subscriber. My recommendation: write the documentation so that both GitLab Duo users and non-users can use it. Thus the instructions should work not be exclusionary. More specifics in separate comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I'm super happy that #7333 got merged, and I see no reason why we need both setups any more.
One of them uses a GitLab CI component, the other uses 100 lines of GitLab CI code to set up the same functionality. My recommendation is to merge the two sections, keeping the component approach at the core.
Let me know what you think about this @vglafirov
PS: I'm super happy to collaborate with you again :)
| OpenCode integrates with your GitLab workflow through your GitLab CI/CD pipeline or with GitLab Duo. | ||
|
|
||
| In both cases, OpenCode will run on your GitLab runners. | ||
| OpenCode integrates with your GitLab workflow through CI/CD pipelines. OpenCode runs on your GitLab runners and uses GitLab Duo for AI-powered assistance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| OpenCode integrates with your GitLab workflow through CI/CD pipelines. OpenCode runs on your GitLab runners and uses GitLab Duo for AI-powered assistance. | |
| OpenCode integrates with your GitLab workflow through CI/CD pipelines either with or without a GitLab Duo subscription. OpenCode runs on your GitLab runners and when available uses GitLab Duo for AI-powered assistance. |
| cat > ~/.local/share/opencode/auth.json << EOF | ||
| { | ||
| "anthropic": { | ||
| "gitlab": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the primary GitLab Duo specific part of the whole setup. If this is stored in an environment variable (with $ expansioin enabled), the much simpler setup presented above works out of the box.
I recommend merging this whole section into the previous one. I'm ok with presenting GitLab Duo auth config, and only mentioning to figure out the proper config for other providers.
| } | ||
| EOF | ||
| - | | ||
| cat > opencode.json << EOF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of creating the whole opencode setup in CI, the CI component takes a config_dir input. Adding this config file there again simplifies the setup.
|
Btw, is my understanding correct that with #7333 merged, once a GITLAB_TOKEN (possible
Thus except for the model selection the value of #7333 works without a GitLab Duo subscription too. Is this correct? |
Replace Anthropic provider with native GitLab Duo integration:
The configuration now uses only GitLab's built-in CI/CD variables and provides native integration with GitLab Duo for AI-powered assistance.