OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

[Feat]: Add GitLab support for repo list in Cloud Openhands

Open malhotra5 opened this issue 9 months ago • 3 comments

  • [ ] This change is worth documenting at https://docs.all-hands.dev/
  • [ ] Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

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

  • These are scaffolding changes, so there are no release notes associated with this
  • Support repo list for multiple providers in cloud openhands

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

We have app installations pagination in the FE to support repo list for github provider

This PR ensures that

  1. All pagination (even for app installations) happens in the BE
  2. All the repos are fetched from one endpoint (that fetches repos based on app mode OSS vs SAAS)

We need these changes because GitLab doesn't have a concept of app installations, and we need a uniform way of retrieving repos for multiple providers


Link of any specific issues this addresses.


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:a15dd2f-nikolaik   --name openhands-app-a15dd2f   docker.all-hands.dev/all-hands-ai/openhands:a15dd2f

malhotra5 avatar Apr 01 '25 18:04 malhotra5

@openhands please fix lint issues on both the backend and frontend

malhotra5 avatar Apr 01 '25 20:04 malhotra5

I'm on it! @malhotra5 can track my progress at all-hands.dev

openhands-ai[bot] avatar Apr 01 '25 20:04 openhands-ai[bot]

Summary of Work

I successfully fixed the lint issues in both the backend and frontend code for PR #7633 in the cloud-oh-gitlab branch.

Frontend Fixes:

  1. Fixed the use-user-repositories.ts file:

    • Added missing dependency config?.APP_MODE to the queryKey array
    • Removed unused pageParam parameter from the queryFn
  2. Fixed the use-settings.ts file:

    • Resolved the object rest destructuring warning by explicitly destructuring only the needed properties
  3. Fixed TypeScript errors in account-settings.tsx:

    • Changed how we access the settings query to avoid TypeScript errors
    • Added proper null checks for settings and resources objects

Backend Fixes:

  • The backend Python files in the PR were already passing the linting checks when run specifically on the changed files.
  • The trailing whitespace issues were automatically fixed by the pre-commit hooks.

Verification:

  • Confirmed that the frontend build process completes successfully
  • Verified that linting passes for the files modified in the PR
  • Successfully committed and pushed the changes to the cloud-oh-gitlab branch

All the requested lint issues have been addressed successfully, and the changes have been pushed to the PR branch.

openhands-ai[bot] avatar Apr 01 '25 20:04 openhands-ai[bot]