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

feat(resolver): implement gitlab resolver #6458

Merged
merged 59 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
a5380e0
[Refactor]: Resolver: way to support more than github
josx Nov 28, 2024
f515893
branch_exists and get_branch_name functions refactored
Orianamartina Dec 27, 2024
f6ade51
refactor(resolver) add pull url and authorize url functions
cuococarlos Dec 27, 2024
a9470d4
Linted code
Orianamartina Dec 27, 2024
338a60e
removed unnecesary parameter from functions
Orianamartina Dec 27, 2024
7ca2c8d
add parameters type
cuococarlos Dec 27, 2024
3090347
Merge pull request #3 from Cambalab/create-authorize-and-pull-urls-fu…
cuococarlos Dec 27, 2024
aca0879
Update: added types to parameters
Orianamartina Dec 27, 2024
c036c5e
Merge branch 'resolver_abs' into resolver_abs_ori
cuococarlos Dec 27, 2024
590d1ad
Merge pull request #1 from Cambalab/resolver_abs_ori
cuococarlos Dec 27, 2024
5f57655
get_branch_url (#2)
juanmanueldaza Dec 27, 2024
2b0463d
[refactor] resolver: create pull request function
Orianamartina Dec 27, 2024
73a4e78
linted code
Orianamartina Dec 27, 2024
41989de
[refactor]: default branch name refactored into IssueHandler
Orianamartina Dec 27, 2024
48a8548
[refactor] remove unnecesary params from handler functions
Orianamartina Dec 27, 2024
330dae3
get_graphql_url() abstrated to github.py
juanmanueldaza Dec 27, 2024
12fa77f
reply_to_comment() abstracted to github.py
juanmanueldaza Dec 27, 2024
76551b0
fix linter issues
cuococarlos Jan 7, 2025
9a16910
Fix the conflit of main
wtiger9218 Feb 8, 2025
a313253
Fix the conflit of resolver_abs
wtiger9218 Jan 13, 2025
ce07281
Implement the issue resovler and create merge request for gitlab
wtiger9218 Jan 14, 2025
0078832
Implement the merge request resolver for gitlab
wtiger9218 Jan 15, 2025
0057f32
Implement webhoook API for gitlab
wtiger9218 Jan 16, 2025
c7ca863
Fix the group issue of gitlab
wtiger9218 Jan 17, 2025
aefd0c8
Fix the issue that didn't find user
wtiger9218 Jan 18, 2025
b8bd48c
Implement the multiple instance for runtime container
wtiger9218 Jan 18, 2025
e229538
Gitlab Updates
symbaventures Jan 19, 2025
e9b35a7
Edit apply.py
symbaventures Jan 20, 2025
8ebff20
Fix the permission issue
wtiger9218 Jan 20, 2025
5fe20e8
Update the git action for gitlab
wtiger9218 Jan 20, 2025
5c6fb76
Update the comment
wtiger9218 Jan 20, 2025
2c55534
Update the unit tests for github
wtiger9218 Jan 20, 2025
ff92f64
Update the unit testing path for github
wtiger9218 Jan 20, 2025
bf8ed9c
Implement unit testings for gitlab
wtiger9218 Jan 22, 2025
5a03803
Fix the unit testing issues
wtiger9218 Jan 25, 2025
2a97377
Update GIT_TOKEN to GITHUB_TOKEN and GITLAB_TOKEN
wtiger9218 Jan 31, 2025
1a77a22
Remove hooks APIs
wtiger9218 Jan 31, 2025
2159292
Update the funtion names in gitlab route
wtiger9218 Jan 31, 2025
7d4421a
Update the document
wtiger9218 Jan 31, 2025
0e5c275
Comment openhand route for gitlab
wtiger9218 Feb 5, 2025
83893f3
Fix the rebase issue
wtiger9218 Feb 8, 2025
29c33c0
Remove gitlab routes
wtiger9218 Feb 10, 2025
9834863
Remove sudo in locally for gitlab
wtiger9218 Feb 10, 2025
efd2807
Remove gitlab.md of microagents
wtiger9218 Feb 10, 2025
2c69056
Update microagents/tasks/address_pr_comments.md
malhotra5 Feb 10, 2025
c95d2e7
added a comment (no code change)
enyst Feb 10, 2025
6c4ebf5
Update github workflow
wtiger9218 Feb 11, 2025
20fe792
Apply suggestions from code review
malhotra5 Feb 11, 2025
31ac799
Update openhands/resolver/resolve_issue.py
malhotra5 Feb 11, 2025
dc1f1b4
Update some comments and log messages
wtiger9218 Feb 11, 2025
2b4bf27
Update the local_runtime_url & user_id for gitlab
wtiger9218 Feb 11, 2025
d989f73
Add README for gitlab
wtiger9218 Feb 11, 2025
d750c18
Update readme files
wtiger9218 Feb 11, 2025
3dd2c19
Update some suggestions
wtiger9218 Feb 11, 2025
3459f80
Create the subfolder for the interface definition, github and gitlab …
wtiger9218 Feb 12, 2025
795f74b
Implement ServiceContext class
wtiger9218 Feb 12, 2025
1335fe2
Update the send_pull_request.py
wtiger9218 Feb 13, 2025
9cac804
Update openhands/resolver/interfaces/issue_definitions.py
malhotra5 Feb 13, 2025
448178b
Fix python lint issue
wtiger9218 Feb 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/openhands-resolver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ jobs:
- name: Attempt to resolve issue
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN || github.token }}
GITHUB_USERNAME: ${{ secrets.PAT_USERNAME || 'openhands-agent' }}
GIT_USERNAME: ${{ secrets.PAT_USERNAME || 'openhands-agent' }}
LLM_MODEL: ${{ secrets.LLM_MODEL || inputs.LLM_MODEL }}
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }}
Expand Down Expand Up @@ -267,7 +267,7 @@ jobs:
if: always() # Create PR or branch even if the previous steps fail
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN || github.token }}
GITHUB_USERNAME: ${{ secrets.PAT_USERNAME || 'openhands-agent' }}
GIT_USERNAME: ${{ secrets.PAT_USERNAME || 'openhands-agent' }}
LLM_MODEL: ${{ secrets.LLM_MODEL || inputs.LLM_MODEL }}
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
LLM_BASE_URL: ${{ secrets.LLM_BASE_URL }}
Expand Down
3 changes: 3 additions & 0 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export default defineConfig(({ mode }) => {
// rewriteWsOrigin: true,
},
},
watch: {
ignored: ['**/node_modules/**', '**/.git/**'],
},
},
ssr: {
noExternal: ["react-syntax-highlighter"],
Expand Down
41 changes: 28 additions & 13 deletions openhands/resolver/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OpenHands Github Issue Resolver 🙌
# OpenHands Github & Gitlab Issue Resolver 🙌

Need help resolving a GitHub issue but don't have the time to do it yourself? Let an AI agent help you out!

Expand Down Expand Up @@ -74,14 +74,24 @@ If you prefer to run the resolver programmatically instead of using GitHub Actio
pip install openhands-ai
```

2. Create a GitHub access token:
- Visit [GitHub's token settings](https://github.com/settings/personal-access-tokens/new)
- Create a fine-grained token with these scopes:
- "Content"
- "Pull requests"
- "Issues"
- "Workflows"
- If you don't have push access to the target repo, you can fork it first
2. Create a GitHub or GitLab access token:
- Create a GitHub acces token
- Visit [GitHub's token settings](https://github.com/settings/personal-access-tokens/new)
- Create a fine-grained token with these scopes:
- "Content"
- "Pull requests"
- "Issues"
- "Workflows"
- If you don't have push access to the target repo, you can fork it first

- Create a GitLab acces token
- Visit [GitLab's token settings](https://gitlab.com/-/user_settings/personal_access_tokens)
- Create a fine-grained token with these scopes:
- 'api'
- 'read_api'
- 'read_user'
- 'read_repository'
- 'write_repository'

3. Set up environment variables:

Expand All @@ -90,7 +100,12 @@ pip install openhands-ai
# GitHub credentials

export GITHUB_TOKEN="your-github-token"
export GITHUB_USERNAME="your-github-username" # Optional, defaults to token owner
export GIT_USERNAME="your-github-username" # Optional, defaults to token owner

# GitLab credentials if you're using GitLab repo

export GITLAB_TOKEN="your-gitlab-token"
export GIT_USERNAME="your-gitlab-username" # Optional, defaults to token owner

# LLM configuration

Expand Down Expand Up @@ -169,13 +184,13 @@ There are three ways you can upload:
3. `ready` - create a non-draft PR that's ready for review

```bash
python -m openhands.resolver.send_pull_request --issue-number ISSUE_NUMBER --github-username YOUR_GITHUB_USERNAME --pr-type draft
python -m openhands.resolver.send_pull_request --issue-number ISSUE_NUMBER --username YOUR_GITHUB_OR_GITLAB_USERNAME --pr-type draft
```

If you want to upload to a fork, you can do so by specifying the `fork-owner`:

```bash
python -m openhands.resolver.send_pull_request --issue-number ISSUE_NUMBER --github-username YOUR_GITHUB_USERNAME --pr-type draft --fork-owner YOUR_GITHUB_USERNAME
python -m openhands.resolver.send_pull_request --issue-number ISSUE_NUMBER --username YOUR_GITHUB_OR_GITLAB_USERNAME --pr-type draft --fork-owner YOUR_GITHUB_OR_GITLAB_USERNAME
```

## Providing Custom Instructions
Expand All @@ -184,5 +199,5 @@ You can customize how the AI agent approaches issue resolution by adding a `.ope

## Troubleshooting

If you have any issues, please open an issue on this github repo, we're happy to help!
If you have any issues, please open an issue on this github or gitlab repo, we're happy to help!
Alternatively, you can [email us](mailto:[email protected]) or join the OpenHands Slack workspace (see [the README](/README.md) for an invite link).
Loading