Skip to content

[FR] setting webUrl separate from cloneUrl #1456

Description

@xPartyBear

With a self-hosted GitLab it is possible to have a url like https://api.mygitlab.com for services to use tokens and a url like https://mygitlab.com for users to hit.

  1. Users are not allowed to authenticate to the API url.
  2. Services are not allowed to authenticate to the base url.
  3. So when clicking urls to goto repos in Sourcebot, GitLab gives could not authenticate errors.

Proposal:
Add an optional config for gitlab provider of webUrl to match the name in the DB.

Activity

  1. brendan-kellam commented on Jul 16, 2026

    @brendan-kellam
    Contributor

    @claude open a PR that adds an optional webUrl field to the GitLab config schema. The webUrl field should be used to derive the projectUrl in repoCompileUtils.ts. Minimize the amount of comments that you add.

  2. claude commented on Jul 16, 2026

    @claude
    Contributor

    Claude finished @brendan-kellam's task in 9m 15s —— View job • claude/issue-1456-20260716-1935 • Create PR ➔


    Task: Add optional webUrl field to GitLab config

    • Add webUrl to the GitLab connection JSON schema (schemas/v3/gitlab.json)
    • Regenerate schema types (hand-applied, see note below)
    • Use webUrl to derive projectUrl in repoCompileUtils.ts
    • Update CHANGELOG
    • Commit & push

    Summary

    Added an optional webUrl field to the GitLab connection config. When set, it's used to build repository links (projectUrl → repo webUrl and zoekt.web-url) in packages/backend/src/repoCompileUtils.ts, while url continues to be used for API calls, avatars, and clone URLs. It defaults to the value of url when omitted, so existing configs are unaffected.

    const webUrl = (config.webUrl ?? hostUrl).replace(/\/+$/, '');
    // ...
    const projectUrl = `${webUrl}/${project.path_with_namespace}`;

    This resolves the case where a self-hosted GitLab serves the API from one host (e.g. https://api.mygitlab.com) and the web UI from another (e.g. https://mygitlab.com).

    Files changed:

    • schemas/v3/gitlab.json — added the webUrl property.
    • packages/backend/src/repoCompileUtils.ts — derive projectUrl from webUrl.
    • Generated schema outputs (packages/schemas/src/v3/{gitlab,connection,index}.{schema,type}.ts and docs/snippets/schemas/v3/*.mdx) — updated to include webUrl.
    • CHANGELOG.md

    Note: I could not run yarn workspace @sourcebot/schemas generate (dependency install / node execution require approvals that aren't granted in this environment), so the auto-generated schema files were updated by hand to match what the generator would produce. It'd be worth running yarn workspace @sourcebot/schemas build locally to confirm the generated output is identical before merging. The CHANGELOG/PR reference #1457 as the anticipated PR number; adjust if it differs.

    • Branch: claude/issue-1456-20260716-1935

  3. brendan-kellam commented on Jul 16, 2026

    @brendan-kellam
    Contributor

    @xPartyBear thx for raising. Shipping your suggestion in #1458. Once it's released, lmk if it resolves your issue

  4. added a commit that references this issue on Jul 17, 2026
    8dba6b2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions