Skip to content

Commit 972837f

Browse files
authored
[Feat]: Gitlab resolver (#8770)
1 parent de196d6 commit 972837f

8 files changed

+56
-2
lines changed

openhands/integrations/templates/resolver/github/issue_comment_conversation_instructions.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A comment on the issue has been addressed to you.
1212
When you're done, make sure to
1313

1414
1. Re-read the issue title, body, and comments and make sure that you have successfully implemented all requirements.
15-
2. Use the `GITHUB_TOKEN` environment variable and GitHub API to open a new PR
15+
2. Use the `create_pr` tool to open a new PR
1616
3. Name the branch using `openhands/` as a prefix (e.g `openhands/update-readme`)
1717
4. The PR description should mention that it "fixes" or "closes" the issue number
1818
5. Make sure to leave the following sentence at the end of the PR description: `@{{ username }} can click here to [continue refining the PR]({{ conversation_url }})`

openhands/integrations/templates/resolver/github/issue_labeled_conversation_instructions.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ Your tasking is to fix an issue in your repository. Do the following
77

88
When you're done, make sure to
99

10-
1. Use the `GITHUB_TOKEN` environment variable and GitHub API to open a new PR
10+
1. Use the `create_pr` tool to open a new PR
1111
2. The PR description should mention that it "fixes" or "closes" the issue number
1212
3. Make sure to leave the following sentence at the end of the PR description: `@{{ username }} can click here to [continue refining the PR]({{ conversation_url }})`
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
You are requested to fix issue number #{{ issue_number }} in a repository.
2+
3+
A comment on the issue has been addressed to you.
4+
5+
# Steps to Handle the Comment
6+
7+
1. Address the comment. Use the GitLab API to read issue title, body, and comments if you need more context
8+
2. For all changes to actual application code (e.g. in Python or Javascript), add an appropriate test to the testing directory to make sure that the issue has been fixed
9+
3. Run the tests, and if they pass you are done!
10+
4. You do NOT need to write new tests if there are only changes to documentation or configuration files.
11+
12+
When you're done, make sure to
13+
14+
1. Re-read the issue title, body, and comments and make sure that you have successfully implemented all requirements.
15+
2. Use the `create_mr` tool to open a new MR
16+
3. Name the branch using `openhands/` as a prefix (e.g `openhands/update-readme`)
17+
4. The MR description should mention that it "fixes" or "closes" the issue number
18+
5. Make sure to leave the following sentence at the end of the MR description: `@{{ username }} can click here to [continue refining the MR]({{ conversation_url }})`
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ issue_comment }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Your tasking is to fix an issue in your repository. Do the following
2+
3+
1. Read the issue body and comments using the GitLab API
4+
2. For all changes to actual application code (e.g. in Python or Javascript), add an appropriate test to the testing directory to make sure that the issue has been fixed
5+
3. Run the tests, and if they pass you are done!
6+
4. You do NOT need to write new tests if there are only changes to documentation or configuration files.
7+
8+
When you're done, make sure to
9+
10+
1. Use the `create_mr` tool to open a new MR
11+
2. The MR description should mention that it "fixes" or "closes" the issue number
12+
3. Make sure to leave the following sentence at the end of the MR description: `@{{ username }} can click here to [continue refining the MR]({{ conversation_url }})`
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Please fix issue number #{{ issue_number }} in your repository.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
You are checked out to branch {{ branch_name }}, which has an open MR #{{ mr_number }}.
2+
A comment on the MR has been addressed to you. Do NOT respond to this comment via the GitLab API.
3+
4+
{% if file_location %} The comment is in the file `{{ file_location }}` on line #{{ line_number }}{% endif %}.
5+
6+
# Steps to Handle the Comment
7+
8+
## Understand the MR Context
9+
Use the GitLab API to:
10+
1. Retrieve the diff against main to understand the changes
11+
2. Fetch the MR body and the linked issue for context
12+
13+
## Process the Comment
14+
If it's a question:
15+
1. Answer the question asked
16+
2. DO NOT leave any comments on the MR
17+
18+
If it requests a code update:
19+
1. Modify the code accordingly in the current branch
20+
2. Push the changes to update the MR
21+
3. DO NOT leave any comments on the MR
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ mr_comment }}

0 commit comments

Comments
 (0)