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

Conversation

wtiger9218
Copy link
Contributor

@wtiger9218 wtiger9218 commented Jan 25, 2025

This change introduces support for GitLab in the Resolver by:

  • Handling GitLab-specific repository URLs for proper resolution
  • Adding authentication support for private GitLab repositories
  • Ensuring compatibility with both GitHub and GitLab repositories in a unified workflow

The implementation includes updates to the Resolver logic to identify and process GitLab repositories and authenticate using personal access tokens where required.

End-user friendly description of the problem this fixes or functionality that this introduces

  • Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

This PR introduces GitLab support in the Resolver, allowing OpenHands users to integrate with GitLab-hosted repositories for seamless resolution and processing.

Give a summary of what the PR does, explaining any non-trivial design decisions

This PR enhances the Resolver by adding GitLab support, enabling users to resolve repositories hosted on GitLab in addition to GitHub. This required adding logic to handle GitLab-specific URL structures and authentication mechanisms while maintaining compatibility with existing GitHub functionality.

@wtiger9218 wtiger9218 changed the title feat(resolver): implement gitlab resolver (#5210) feat(resolver): implement gitlab resolver Jan 25, 2025
@wtiger9218 wtiger9218 force-pushed the resolver_gitlab_openhands branch from 24cd9a5 to ce78f3e Compare January 25, 2025 09:08
@enyst enyst requested review from neubig and malhotra5 January 25, 2025 09:43
@malhotra5
Copy link
Contributor

Hey @wtiger9218 and @symbaventures, thanks a bunch for putting this together

I'm getting started on reviewing this, but the PR is quite large! It will take me some time reading through the changes and adequately testing things.

That being said, it would be much preferred if you could break up this PR into multiple smaller ones.

For example,

  1. Generalize the resolver via abstract interface for Github/Gitlab (see [Resolver] (refactor) Generalize the resolver #6125)
  2. Add Gitlab endpoints for issue resolution
  3. Add Gitlab endpoints for uploading agents work

@wtiger9218
Copy link
Contributor Author

Hey @wtiger9218 and @symbaventures, thanks a bunch for putting this together

I'm getting started on reviewing this, but the PR is quite large! It will take me some time reading through the changes and adequately testing things.

That being said, it would be much preferred if you could break up this PR into multiple smaller ones.

For example,

  1. Generalize the resolver via abstract interface for Github/Gitlab (see [Resolver] (refactor) Generalize the resolver #6125)
  2. Add Gitlab endpoints for issue resolution
  3. Add Gitlab endpoints for uploading agents work

Hi @malhotra5, Thank you for your reply.
The PR already includes the generalize resolver PR #6125 . But I’ve updated it to align with the latest changes from the main branch.
Also it includes only the resolver and does not include any frontend or backend changes.

Copy link
Collaborator

@rbren rbren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this seems reasonable to me, and a good first start at a GitLab integration.

Can we add docs as a sibling to https://docs.all-hands.dev/modules/usage/how-to/github-action?

Are the API routes used at all currently?

Going forward I'd like to see the frontend accept a gitlab token, and then have generic APIs for GET /repositories etc which collate results from both APIs. But that doesn't need to be this PR

I'm going to defer to @malhotra5 and others on final approval here

@wtiger9218
Copy link
Contributor Author

Overall this seems reasonable to me, and a good first start at a GitLab integration.

Can we add docs as a sibling to https://docs.all-hands.dev/modules/usage/how-to/github-action?

Are the API routes used at all currently?

Going forward I'd like to see the frontend accept a gitlab token, and then have generic APIs for GET /repositories etc which collate results from both APIs. But that doesn't need to be this PR

I'm going to defer to @malhotra5 and others on final approval here

@rbren Thank you for your review. I just updated the above suggestion.

Currently, the API routes aren't used.

@malhotra5
Copy link
Contributor

I'm gonna take a pause from reviewing this for tonight - I'll come back to this tomorrow. I've mostly confirmed everything works so far, so we're almost at the finish line!

@malhotra5
Copy link
Contributor

malhotra5 commented Feb 12, 2025

Could you also add a file similar to this https://github.com/All-Hands-AI/OpenHands/blob/main/docs/modules/usage/how-to/github-action.md?

Please include information that is needed to setup Openhands for Gitlab + any other custom variables as well

@wtiger9218 wtiger9218 requested a review from malhotra5 February 13, 2025 16:11
@enyst
Copy link
Collaborator

enyst commented Feb 13, 2025

My concerns were addressed, thank you!

I'll defer to @malhotra5 for final approval and merge.

Copy link
Contributor

@malhotra5 malhotra5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks a lot for your patience during the review process and hard work!

I'll be running GitHub actions to make sure tests are passing before we can merge these changes. Please be on the lookout for failed actions and see if you can update the code until its passing

@wtiger9218
Copy link
Contributor Author

@malhotra5 All tests have passed. ❤

@malhotra5
Copy link
Contributor

Let's merge this 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants