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

[new feature] GitLab integration #341

Closed
olegklimov opened this issue Oct 2, 2024 · 12 comments
Closed

[new feature] GitLab integration #341

olegklimov opened this issue Oct 2, 2024 · 12 comments

Comments

@olegklimov
Copy link
Contributor

olegklimov commented Oct 2, 2024

Gitlab is a service analogous to Github. We don't have to always support Microsoft that owns github, do we?

Let's make a Gitlab integration and make Refact work with issues, merge requests, maybe CI, etc. For functionality you can look at what Github integration provides: creating issues, commenting, searching.

It's not clear at this point if they have a command line utility or REST API in Gitlab. Both can be integrated quite easily, a change to only 2 files required (1 file for the new integration, and tools_description.rs)

CONTRIBUTING

@eleensmathew
Copy link

Can I work on this?

@oxyplay oxyplay assigned oxyplay and eleensmathew and unassigned oxyplay Oct 3, 2024
@katrinmaikova
Copy link

@eleensmathew, sure, this issue has been assigned to you! ;)

@eleensmathew
Copy link

Hey can you unassign me from this issue? I am not familiar with rust.

@Commit2Cosmos
Copy link
Contributor

Hi, I would like to give it a go, please. I'm planning to integrate with GLab CLI for now. Should I also add tests for it in tests/test12_tools_authorize_calls.py?

@oxyplay oxyplay assigned oxyplay and Commit2Cosmos and unassigned oxyplay Oct 4, 2024
@olegklimov
Copy link
Contributor Author

test12_tools_authorize_calls.py is about asking confirmation from the user for certain commands, you can set up patterns in integrations.yaml. It's not specific to an integration, it's a common mechanism for all the commands.

Not sure if tests are even possible for this kind of thing, create a dummy repository on GitLab, give agent the key, and ask to create an issue, and then delete it?

@Commit2Cosmos
Copy link
Contributor

I see, thank you for clarifying this, will give it a try!

@Commit2Cosmos
Copy link
Contributor

Hi @olegklimov , I've completed the first iteration of the integration, but struggling to figure out how to test it (or use the agentic tools in general). What api do I use to access them? I understand I need to --experimental flag with refact-lsp, but now sure what to do next. Could you please direct me to an example of using any of the agentic tools that I can follow (e.g. for the github integration)?

@olegklimov
Copy link
Contributor Author

Sure, take a look at my screenshot here #340 and try to reproduce it, should be more clear how it's supposed to work

@Commit2Cosmos
Copy link
Contributor

Commit2Cosmos commented Oct 18, 2024

I'm trying to reproduce your example for the agent to add a comment to this repo, but it doesn't want to use the github tool, and instead uses the web one. Guessing it's something to do with enabling experimental tools?
Screenshot 2024-10-18 at 16 30 05

@olegklimov
Copy link
Contributor Author

enabling experimental tools?

It's the --experimental flag :D

target/debug/refact-lsp --address-url Refact --api-key XXXX --http-port 8001 --experimental --workspace-folder ~/code/project_with_git --logs-stderr

and "npm run dev" in refact-chat-js that will connect to 8001, the easiest way to try it. (ah yeah right, you already have that running on your screenshot)

@Commit2Cosmos
Copy link
Contributor

This is a test comment by github tool

@Commit2Cosmos
Copy link
Contributor

Commit2Cosmos commented Oct 23, 2024

target/debug/refact-lsp --address-url Refact --api-key XXXX --http-port 8001 --experimental --workspace-folder ~/code/project_with_git --logs-stderr

Just what I was looking for, thanks!

The code is very similar to the github integration, but it seems to work! Please lmk if you spot any issues or would like me to change something
Screenshot 2024-10-23 at 11 52 14
Screenshot 2024-10-23 at 11 52 40

Just checked and creating comments works too (although it prompted me to add the remote repo to my local git repo). What an amazing tool!

PR: #386

@avie66 avie66 closed this as completed Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants