Skip to content

fix(git): return an empty page from installations search for providers without installations - #1045

Merged
tofarr merged 1 commit into
mainfrom
fix/installations-search-empty-for-unsupported-providers
Oct 27, 2026
Merged

tofarr merged 1 commit into
mainfrom
fix/installations-search-empty-for-unsupported-providers

Conversation

@tofarr

@tofarr tofarr commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

HUMAN:

  • A human has tested these changes.

Fixes error when gitlab was the last selected repository

Screen.Recording.2026-10-27.at.6.29.17.PM.mov

AGENT:


Why

GET /api/v1/git/installations/search returned 400 "Provider ProviderType.GITLAB doesn't support installations" for GitLab and Forgejo. Those providers list repositories directly; they have no level above repositories like GitHub App installations, Bitbucket workspaces or Azure DevOps organizations, so "no installations" is the truthful answer rather than an error. The endpoint is already lenient elsewhere: ProviderHandler.get_github_installations catches failures and returns [].

This started showing up on /canvas locally once #1037 (OHE-3770) made a GitLab login IdP count as a git provider. Agent Canvas is pinned per release, so fixing the client alone does not protect installs that are already deployed.

Summary

  • search_user_installations returns InstallationPage(items=[]) for providers without installations instead of raising a 400. The 403 for users with no git provider token is unchanged.
  • Added a test that sends gitlab and forgejo through the real route.

Issue Number

Related: OHE-3770 / #1037. A matching client-side guard is going into OpenHands/OpenHands (Agent Canvas).

How to Test

  • uv run pytest tests/unit/app_server/test_git_router.py --confcutdir=tests/unit/app_server: 34 passed. The new test fails with assert 400 == 200 on main and passes on this branch.
  • Manual: sign in with GitLab as a git provider, then GET /api/v1/git/installations/search?provider=gitlab&limit=100 returns 200 {"items": [], "next_page_id": null}.

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

Notes

Clients that relied on the 400 to detect "not supported" now get an empty list. Neither frontend did: both decide which providers use installations on the client and never call this for GitLab on the released code path.

This PR was created by an AI agent (OpenHands) on behalf of Tim O'Farrell.

@tofarr can click here to continue refining the PR


Enterprise server image for this PR:

ghcr.io/openhands/enterprise-server:sha-69dce18

…s without installations

GitLab and Forgejo list repositories directly, so they have no installation
concept. /api/v1/git/installations/search answered them with a 400, which
surfaced as a failed request on /canvas once a GitLab login IdP started
counting as a git provider (#1037). An empty page is the truthful answer and
keeps older Agent Canvas builds and other clients from erroring.

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions github-actions Bot added the type: fix A bug fix label Oct 27, 2026
@tofarr
tofarr marked this pull request as ready for review October 27, 2026 18:30
@github-actions

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  openhands/app_server/git
  git_router.py 90-95
Project Total  

This report was generated by python-coverage-comment-action

@hieptl hieptl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you! 🙏

@tofarr
tofarr merged commit 4148a72 into main Oct 27, 2026
26 checks passed
@tofarr
tofarr deleted the fix/installations-search-empty-for-unsupported-providers branch October 27, 2026 18:32
@openhands-release-bot openhands-release-bot Bot added the released: 1.81.0 Shipped in 1.81.0 label Oct 28, 2026
@openhands-release-bot

Copy link
Copy Markdown
Contributor

🚀 Released in 1.81.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released: 1.81.0 Shipped in 1.81.0 type: fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants