Skip to content

[bug] Git connections defined using v3 config schema don't load in UI #586

@derek-miller

Description

@derek-miller

Describe the bug

Git connections defined in config.json cause errors and don't load in the UI. The connectionType field gets set to "git" instead of "generic-git-host", causing the application to fail when processing these connections.

packages/backend/src/configManager.ts:85 assigns newConnectionConfig.type (which is "git" from the v3 config schema) directly to the connectionType field, but the codebase expects "generic-git-host".

To reproduce

  1. Add a git connection to config.json:
{
  "connections": {
    "my-repos": {
      "type": "git",
      "url": "file:///repos/my-org/*"
    }
  }
}
  1. Attempt to load the connections view in a browser.

Sourcebot deployment information

Sourcebot version (e.g. v3.0.1): v4.8.1

Additional information

I have applied the following patch to my local build in the meantime to get around the issue:

diff --git a/packages/backend/src/configManager.ts b/packages/backend/src/configManager.ts
index 14c6b0d..2e5ca51 100644
--- a/packages/backend/src/configManager.ts
+++ b/packages/backend/src/configManager.ts
@@ -82,7 +82,7 @@ export class ConfigManager {
                         data: {
                             name: key,
                             config: newConnectionConfig as unknown as Prisma.InputJsonValue,
-                            connectionType: newConnectionConfig.type,
+                            connectionType: newConnectionConfig.type === 'git' ? 'generic-git-host' : newConnectionConfig.type,
                             isDeclarative: true,
                             org: {
                                 connect: {

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions